Commit 1d0df88b authored by bmeurer's avatar bmeurer Committed by Commit bot

[intrinsics] Remove unused intrinsic %_IncrementStatsCounter.

This was once meant to be used for JavaScript code stubs, but since we
found a better way to do code stubs using TurboFan, we don't need this
runtime entry and intrinsic anymore.

R=jarin@chromium.org

Review URL: https://codereview.chromium.org/1821123002

Cr-Commit-Position: refs/heads/master@{#34976}
parent 4c0ad049
......@@ -45,8 +45,6 @@ Reduction JSIntrinsicLowering::Reduce(Node* node) {
return ReduceDoubleHi(node);
case Runtime::kInlineDoubleLo:
return ReduceDoubleLo(node);
case Runtime::kInlineIncrementStatsCounter:
return ReduceIncrementStatsCounter(node);
case Runtime::kInlineIsArray:
return ReduceIsInstanceType(node, JS_ARRAY_TYPE);
case Runtime::kInlineIsTypedArray:
......@@ -158,31 +156,6 @@ Reduction JSIntrinsicLowering::ReduceDoubleLo(Node* node) {
}
Reduction JSIntrinsicLowering::ReduceIncrementStatsCounter(Node* node) {
if (!FLAG_native_code_counters) return ChangeToUndefined(node);
HeapObjectMatcher m(NodeProperties::GetValueInput(node, 0));
if (!m.HasValue() || !m.Value()->IsString()) {
return ChangeToUndefined(node);
}
base::SmartArrayPointer<char> name =
Handle<String>::cast(m.Value())->ToCString();
StatsCounter counter(jsgraph()->isolate(), name.get());
if (!counter.Enabled()) return ChangeToUndefined(node);
Node* effect = NodeProperties::GetEffectInput(node);
Node* control = NodeProperties::GetControlInput(node);
FieldAccess access = AccessBuilder::ForStatsCounter();
Node* cnt = jsgraph()->ExternalConstant(ExternalReference(&counter));
Node* load =
graph()->NewNode(simplified()->LoadField(access), cnt, effect, control);
Node* inc =
graph()->NewNode(machine()->Int32Add(), load, jsgraph()->OneConstant());
Node* store = graph()->NewNode(simplified()->StoreField(access), cnt, inc,
load, control);
return ChangeToUndefined(node, store);
}
Reduction JSIntrinsicLowering::ReduceIsInstanceType(
Node* node, InstanceType instance_type) {
// if (%_IsSmi(value)) {
......
......@@ -43,7 +43,6 @@ class JSIntrinsicLowering final : public AdvancedReducer {
Reduction ReduceDeoptimizeNow(Node* node);
Reduction ReduceDoubleHi(Node* node);
Reduction ReduceDoubleLo(Node* node);
Reduction ReduceIncrementStatsCounter(Node* node);
Reduction ReduceIsInstanceType(Node* node, InstanceType instance_type);
Reduction ReduceIsJSReceiver(Node* node);
Reduction ReduceIsSmi(Node* node);
......
......@@ -357,18 +357,6 @@ RUNTIME_FUNCTION(Runtime_IS_VAR) {
}
RUNTIME_FUNCTION(Runtime_IncrementStatsCounter) {
SealHandleScope shs(isolate);
DCHECK(args.length() == 1);
CONVERT_ARG_CHECKED(String, name, 0);
if (FLAG_native_code_counters) {
StatsCounter(isolate, name->ToCString().get()).Increment();
}
return isolate->heap()->undefined_value();
}
namespace {
bool ComputeLocation(Isolate* isolate, MessageLocation* target) {
......
......@@ -314,7 +314,6 @@ namespace internal {
F(CallSiteIsEvalRT, 1, 1) \
F(CallSiteIsConstructorRT, 1, 1) \
F(IS_VAR, 1, 1) \
F(IncrementStatsCounter, 1, 1) \
F(ThrowConstructedNonConstructable, 1, 1) \
F(ThrowDerivedConstructorReturnedNonObject, 0, 1) \
F(ThrowCalledNonCallable, 1, 1) \
......
......@@ -34,31 +34,6 @@ TEST(ClassOf) {
}
#define COUNTER_NAME "hurz"
static int* LookupCounter(const char* name) {
static int counter = 1234;
return strcmp(name, COUNTER_NAME) == 0 ? &counter : nullptr;
}
TEST(IncrementStatsCounter) {
FLAG_native_code_counters = true;
reinterpret_cast<v8::Isolate*>(CcTest::InitIsolateOnce())
->SetCounterFunction(LookupCounter);
FunctionTester T(
"(function() { %_IncrementStatsCounter('" COUNTER_NAME "'); })", flags);
StatsCounter counter(T.main_isolate(), COUNTER_NAME);
if (!counter.Enabled()) return;
int old_value = *counter.GetInternalPointer();
T.CheckCall(T.undefined());
CHECK_EQ(old_value + 1, *counter.GetInternalPointer());
}
#undef COUNTER_NAME
TEST(IsArray) {
FunctionTester T("(function(a) { return %_IsArray(a); })", flags);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment