From 0f715540a2ab28a476ef98d75b41829ff72f6a59 Mon Sep 17 00:00:00 2001 From: "verwaest@chromium.org" Date: Mon, 30 Sep 2013 13:53:21 +0000 Subject: [PATCH] Tag handlers as HANDLER rather than STUB. R=ulan@chromium.org Review URL: https://chromiumcodereview.appspot.com/25044002 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17012 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/arm/ic-arm.cc | 4 ++-- src/builtins.h | 4 ++-- src/code-stubs.h | 2 +- src/disassembler.cc | 2 +- src/ia32/ic-ia32.cc | 4 ++-- src/ic.cc | 2 +- src/log.cc | 4 ++++ src/log.h | 1 + src/mips/ic-mips.cc | 4 ++-- src/objects-inl.h | 2 ++ src/objects.cc | 2 +- src/objects.h | 1 + src/stub-cache.cc | 8 ++++---- src/type-info.cc | 4 ++-- src/x64/ic-x64.cc | 4 ++-- 15 files changed, 28 insertions(+), 20 deletions(-) diff --git a/src/arm/ic-arm.cc b/src/arm/ic-arm.cc index b39a0edfb8..aded4c1dd8 100644 --- a/src/arm/ic-arm.cc +++ b/src/arm/ic-arm.cc @@ -656,7 +656,7 @@ void LoadIC::GenerateMegamorphic(MacroAssembler* masm) { // Probe the stub cache. Code::Flags flags = Code::ComputeFlags( - Code::STUB, MONOMORPHIC, Code::kNoExtraICState, + Code::HANDLER, MONOMORPHIC, Code::kNoExtraICState, Code::NORMAL, Code::LOAD_IC); masm->isolate()->stub_cache()->GenerateProbe( masm, flags, r0, r2, r3, r4, r5, r6); @@ -1487,7 +1487,7 @@ void StoreIC::GenerateMegamorphic(MacroAssembler* masm, // Get the receiver from the stack and probe the stub cache. Code::Flags flags = Code::ComputeFlags( - Code::STUB, MONOMORPHIC, strict_mode, + Code::HANDLER, MONOMORPHIC, strict_mode, Code::NORMAL, Code::STORE_IC); masm->isolate()->stub_cache()->GenerateProbe( diff --git a/src/builtins.h b/src/builtins.h index 682fa1ca5b..612f85a36a 100644 --- a/src/builtins.h +++ b/src/builtins.h @@ -115,7 +115,7 @@ enum BuiltinExtraArguments { Code::kNoExtraICState) \ V(KeyedLoadIC_MissForceGeneric, BUILTIN, UNINITIALIZED, \ Code::kNoExtraICState) \ - V(KeyedLoadIC_Slow, STUB, MONOMORPHIC, \ + V(KeyedLoadIC_Slow, HANDLER, MONOMORPHIC, \ Code::kNoExtraICState) \ V(StoreIC_Miss, BUILTIN, UNINITIALIZED, \ Code::kNoExtraICState) \ @@ -137,7 +137,7 @@ enum BuiltinExtraArguments { Code::kNoExtraICState) \ V(LoadIC_Getter_ForDeopt, LOAD_IC, MONOMORPHIC, \ Code::kNoExtraICState) \ - V(LoadIC_Slow, STUB, MONOMORPHIC, \ + V(LoadIC_Slow, HANDLER, MONOMORPHIC, \ Code::kNoExtraICState) \ \ V(KeyedLoadIC_Initialize, KEYED_LOAD_IC, UNINITIALIZED, \ diff --git a/src/code-stubs.h b/src/code-stubs.h index a5c2f88b22..d1a5b73df0 100644 --- a/src/code-stubs.h +++ b/src/code-stubs.h @@ -904,7 +904,7 @@ class HICStub: public HydrogenCodeStub { class HandlerStub: public HICStub { public: - virtual Code::Kind GetCodeKind() const { return Code::STUB; } + virtual Code::Kind GetCodeKind() const { return Code::HANDLER; } virtual int GetStubFlags() { return kind(); } protected: diff --git a/src/disassembler.cc b/src/disassembler.cc index dd620fb345..d7898ddcd9 100644 --- a/src/disassembler.cc +++ b/src/disassembler.cc @@ -250,7 +250,7 @@ static int DecodeIt(Isolate* isolate, if (kind == Code::CALL_IC || kind == Code::KEYED_CALL_IC) { out.AddFormatted(", argc = %d", code->arguments_count()); } - } else if (kind == Code::STUB) { + } else if (kind == Code::STUB || kind == Code::HANDLER) { // Reverse lookup required as the minor key cannot be retrieved // from the code object. Object* obj = heap->code_stubs()->SlowReverseLookup(code); diff --git a/src/ia32/ic-ia32.cc b/src/ia32/ic-ia32.cc index 327ac57623..f8e4ea53d0 100644 --- a/src/ia32/ic-ia32.cc +++ b/src/ia32/ic-ia32.cc @@ -1304,7 +1304,7 @@ void LoadIC::GenerateMegamorphic(MacroAssembler* masm) { // Probe the stub cache. Code::Flags flags = Code::ComputeFlags( - Code::STUB, MONOMORPHIC, Code::kNoExtraICState, + Code::HANDLER, MONOMORPHIC, Code::kNoExtraICState, Code::NORMAL, Code::LOAD_IC); masm->isolate()->stub_cache()->GenerateProbe( masm, flags, edx, ecx, ebx, eax); @@ -1423,7 +1423,7 @@ void StoreIC::GenerateMegamorphic(MacroAssembler* masm, // ----------------------------------- Code::Flags flags = Code::ComputeFlags( - Code::STUB, MONOMORPHIC, strict_mode, + Code::HANDLER, MONOMORPHIC, strict_mode, Code::NORMAL, Code::STORE_IC); masm->isolate()->stub_cache()->GenerateProbe( masm, flags, edx, ecx, ebx, no_reg); diff --git a/src/ic.cc b/src/ic.cc index 43d162c84a..579e268bad 100644 --- a/src/ic.cc +++ b/src/ic.cc @@ -999,7 +999,7 @@ bool IC::UpdatePolymorphicIC(State state, Handle name, Handle code, StrictModeFlag strict_mode) { - if (code->type() == Code::NORMAL) return false; + if (code->kind() != Code::HANDLER) return false; if (target()->ic_state() == MONOMORPHIC && target()->type() == Code::NORMAL) { return false; diff --git a/src/log.cc b/src/log.cc index 5c404bb952..92555b9136 100644 --- a/src/log.cc +++ b/src/log.cc @@ -1629,6 +1629,10 @@ void Logger::LogCodeObject(Object* object) { description = "A builtin from the snapshot"; tag = Logger::BUILTIN_TAG; break; + case Code::HANDLER: + description = "An IC handler from the snapshot"; + tag = Logger::HANDLER_TAG; + break; case Code::KEYED_LOAD_IC: description = "A keyed load IC from the snapshot"; tag = Logger::KEYED_LOAD_IC_TAG; diff --git a/src/log.h b/src/log.h index 81d45e507b..d61c985292 100644 --- a/src/log.h +++ b/src/log.h @@ -131,6 +131,7 @@ struct TickSample; V(CALLBACK_TAG, "Callback") \ V(EVAL_TAG, "Eval") \ V(FUNCTION_TAG, "Function") \ + V(HANDLER_TAG, "Handler") \ V(KEYED_LOAD_IC_TAG, "KeyedLoadIC") \ V(KEYED_LOAD_POLYMORPHIC_IC_TAG, "KeyedLoadPolymorphicIC") \ V(KEYED_EXTERNAL_ARRAY_LOAD_IC_TAG, "KeyedExternalArrayLoadIC") \ diff --git a/src/mips/ic-mips.cc b/src/mips/ic-mips.cc index e250e0ee4a..aa2773462c 100644 --- a/src/mips/ic-mips.cc +++ b/src/mips/ic-mips.cc @@ -656,7 +656,7 @@ void LoadIC::GenerateMegamorphic(MacroAssembler* masm) { // Probe the stub cache. Code::Flags flags = Code::ComputeFlags( - Code::STUB, MONOMORPHIC, Code::kNoExtraICState, + Code::HANDLER, MONOMORPHIC, Code::kNoExtraICState, Code::NORMAL, Code::LOAD_IC); masm->isolate()->stub_cache()->GenerateProbe( masm, flags, a0, a2, a3, t0, t1, t2); @@ -1496,7 +1496,7 @@ void StoreIC::GenerateMegamorphic(MacroAssembler* masm, // Get the receiver from the stack and probe the stub cache. Code::Flags flags = Code::ComputeFlags( - Code::STUB, MONOMORPHIC, strict_mode, + Code::HANDLER, MONOMORPHIC, strict_mode, Code::NORMAL, Code::STORE_IC); masm->isolate()->stub_cache()->GenerateProbe( masm, flags, a1, a2, a3, t0, t1, t2); diff --git a/src/objects-inl.h b/src/objects-inl.h index 48bd78e754..f1603b488a 100644 --- a/src/objects-inl.h +++ b/src/objects-inl.h @@ -3776,6 +3776,7 @@ inline void Code::set_is_crankshafted(bool value) { int Code::major_key() { ASSERT(kind() == STUB || + kind() == HANDLER || kind() == BINARY_OP_IC || kind() == COMPARE_IC || kind() == COMPARE_NIL_IC || @@ -3790,6 +3791,7 @@ int Code::major_key() { void Code::set_major_key(int major) { ASSERT(kind() == STUB || + kind() == HANDLER || kind() == BINARY_OP_IC || kind() == COMPARE_IC || kind() == COMPARE_NIL_IC || diff --git a/src/objects.cc b/src/objects.cc index 6ca8bdf4fd..c55a9aaf1b 100644 --- a/src/objects.cc +++ b/src/objects.cc @@ -10384,7 +10384,7 @@ void Code::FindAllCode(CodeHandleList* code_list, int length) { if (i++ == length) return; RelocInfo* info = it.rinfo(); Code* code = Code::GetCodeFromTargetAddress(info->target_address()); - ASSERT(code->kind() == Code::STUB); + ASSERT(code->kind() == Code::HANDLER); code_list->Add(Handle(code)); } UNREACHABLE(); diff --git a/src/objects.h b/src/objects.h index 3f229a85bf..0e065e6785 100644 --- a/src/objects.h +++ b/src/objects.h @@ -4763,6 +4763,7 @@ class Code: public HeapObject { V(FUNCTION) \ V(OPTIMIZED_FUNCTION) \ V(STUB) \ + V(HANDLER) \ V(BUILTIN) \ V(REGEXP) diff --git a/src/stub-cache.cc b/src/stub-cache.cc index 0318a3967c..a2bb810266 100644 --- a/src/stub-cache.cc +++ b/src/stub-cache.cc @@ -140,7 +140,7 @@ Handle StubCache::FindLoadHandler(Handle name, ? OWN_MAP : PROTOTYPE_MAP; ASSERT(type != Code::NORMAL); Code::Flags flags = Code::ComputeMonomorphicFlags( - Code::STUB, Code::kNoExtraICState, type, kind, holder_flag); + Code::HANDLER, Code::kNoExtraICState, type, kind, holder_flag); Handle probe(stub_holder->map()->FindInCodeCache(*name, flags), isolate_); if (probe->IsCode()) return Handle::cast(probe); @@ -157,7 +157,7 @@ Handle StubCache::FindStoreHandler(Handle name, STANDARD_STORE, strict_mode); ASSERT(type != Code::NORMAL); Code::Flags flags = Code::ComputeMonomorphicFlags( - Code::STUB, extra_ic_state, type, kind); + Code::HANDLER, extra_ic_state, type, kind); Handle probe(receiver->map()->FindInCodeCache(*name, flags), isolate_); if (probe->IsCode()) return Handle::cast(probe); @@ -1987,7 +1987,7 @@ Handle BaseLoadStubCompiler::GetCode(Code::Kind kind, Handle name) { ASSERT(type != Code::NORMAL); Code::Flags flags = Code::ComputeFlags( - Code::STUB, MONOMORPHIC, Code::kNoExtraICState, type, kind); + Code::HANDLER, MONOMORPHIC, Code::kNoExtraICState, type, kind); Handle code = GetCodeWithFlags(flags, name); PROFILE(isolate(), CodeCreateEvent(log_kind(code), *code, *name)); JitEvent(name, code); @@ -2000,7 +2000,7 @@ Handle BaseStoreStubCompiler::GetCode(Code::Kind kind, Handle name) { ASSERT(type != Code::NORMAL); Code::Flags flags = Code::ComputeFlags( - Code::STUB, MONOMORPHIC, extra_state(), type, kind); + Code::HANDLER, MONOMORPHIC, extra_state(), type, kind); Handle code = GetCodeWithFlags(flags, name); PROFILE(isolate(), CodeCreateEvent(log_kind(code), *code, *name)); JitEvent(name, code); diff --git a/src/type-info.cc b/src/type-info.cc index 190eb3e6ff..dbd37f7f79 100644 --- a/src/type-info.cc +++ b/src/type-info.cc @@ -251,7 +251,7 @@ void TypeFeedbackOracle::LoadReceiverTypes(Property* expr, Handle name, SmallMapList* types) { Code::Flags flags = Code::ComputeFlags( - Code::STUB, MONOMORPHIC, Code::kNoExtraICState, + Code::HANDLER, MONOMORPHIC, Code::kNoExtraICState, Code::NORMAL, Code::LOAD_IC); CollectReceiverTypes(expr->PropertyFeedbackId(), name, flags, types); } @@ -261,7 +261,7 @@ void TypeFeedbackOracle::StoreReceiverTypes(Assignment* expr, Handle name, SmallMapList* types) { Code::Flags flags = Code::ComputeFlags( - Code::STUB, MONOMORPHIC, Code::kNoExtraICState, + Code::HANDLER, MONOMORPHIC, Code::kNoExtraICState, Code::NORMAL, Code::STORE_IC); CollectReceiverTypes(expr->AssignmentFeedbackId(), name, flags, types); } diff --git a/src/x64/ic-x64.cc b/src/x64/ic-x64.cc index 4a7c68a53c..15f410c134 100644 --- a/src/x64/ic-x64.cc +++ b/src/x64/ic-x64.cc @@ -1330,7 +1330,7 @@ void LoadIC::GenerateMegamorphic(MacroAssembler* masm) { // Probe the stub cache. Code::Flags flags = Code::ComputeFlags( - Code::STUB, MONOMORPHIC, Code::kNoExtraICState, + Code::HANDLER, MONOMORPHIC, Code::kNoExtraICState, Code::NORMAL, Code::LOAD_IC); masm->isolate()->stub_cache()->GenerateProbe( masm, flags, rax, rcx, rbx, rdx); @@ -1451,7 +1451,7 @@ void StoreIC::GenerateMegamorphic(MacroAssembler* masm, // Get the receiver from the stack and probe the stub cache. Code::Flags flags = Code::ComputeFlags( - Code::STUB, MONOMORPHIC, strict_mode, + Code::HANDLER, MONOMORPHIC, strict_mode, Code::NORMAL, Code::STORE_IC); masm->isolate()->stub_cache()->GenerateProbe( masm, flags, rdx, rcx, rbx, no_reg);