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
This commit is contained in:
verwaest@chromium.org 2013-09-30 13:53:21 +00:00
parent de446c636e
commit 0f715540a2
15 changed files with 28 additions and 20 deletions

View File

@ -656,7 +656,7 @@ void LoadIC::GenerateMegamorphic(MacroAssembler* masm) {
// Probe the stub cache. // Probe the stub cache.
Code::Flags flags = Code::ComputeFlags( Code::Flags flags = Code::ComputeFlags(
Code::STUB, MONOMORPHIC, Code::kNoExtraICState, Code::HANDLER, MONOMORPHIC, Code::kNoExtraICState,
Code::NORMAL, Code::LOAD_IC); Code::NORMAL, Code::LOAD_IC);
masm->isolate()->stub_cache()->GenerateProbe( masm->isolate()->stub_cache()->GenerateProbe(
masm, flags, r0, r2, r3, r4, r5, r6); 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. // Get the receiver from the stack and probe the stub cache.
Code::Flags flags = Code::ComputeFlags( Code::Flags flags = Code::ComputeFlags(
Code::STUB, MONOMORPHIC, strict_mode, Code::HANDLER, MONOMORPHIC, strict_mode,
Code::NORMAL, Code::STORE_IC); Code::NORMAL, Code::STORE_IC);
masm->isolate()->stub_cache()->GenerateProbe( masm->isolate()->stub_cache()->GenerateProbe(

View File

@ -115,7 +115,7 @@ enum BuiltinExtraArguments {
Code::kNoExtraICState) \ Code::kNoExtraICState) \
V(KeyedLoadIC_MissForceGeneric, BUILTIN, UNINITIALIZED, \ V(KeyedLoadIC_MissForceGeneric, BUILTIN, UNINITIALIZED, \
Code::kNoExtraICState) \ Code::kNoExtraICState) \
V(KeyedLoadIC_Slow, STUB, MONOMORPHIC, \ V(KeyedLoadIC_Slow, HANDLER, MONOMORPHIC, \
Code::kNoExtraICState) \ Code::kNoExtraICState) \
V(StoreIC_Miss, BUILTIN, UNINITIALIZED, \ V(StoreIC_Miss, BUILTIN, UNINITIALIZED, \
Code::kNoExtraICState) \ Code::kNoExtraICState) \
@ -137,7 +137,7 @@ enum BuiltinExtraArguments {
Code::kNoExtraICState) \ Code::kNoExtraICState) \
V(LoadIC_Getter_ForDeopt, LOAD_IC, MONOMORPHIC, \ V(LoadIC_Getter_ForDeopt, LOAD_IC, MONOMORPHIC, \
Code::kNoExtraICState) \ Code::kNoExtraICState) \
V(LoadIC_Slow, STUB, MONOMORPHIC, \ V(LoadIC_Slow, HANDLER, MONOMORPHIC, \
Code::kNoExtraICState) \ Code::kNoExtraICState) \
\ \
V(KeyedLoadIC_Initialize, KEYED_LOAD_IC, UNINITIALIZED, \ V(KeyedLoadIC_Initialize, KEYED_LOAD_IC, UNINITIALIZED, \

View File

@ -904,7 +904,7 @@ class HICStub: public HydrogenCodeStub {
class HandlerStub: public HICStub { class HandlerStub: public HICStub {
public: public:
virtual Code::Kind GetCodeKind() const { return Code::STUB; } virtual Code::Kind GetCodeKind() const { return Code::HANDLER; }
virtual int GetStubFlags() { return kind(); } virtual int GetStubFlags() { return kind(); }
protected: protected:

View File

@ -250,7 +250,7 @@ static int DecodeIt(Isolate* isolate,
if (kind == Code::CALL_IC || kind == Code::KEYED_CALL_IC) { if (kind == Code::CALL_IC || kind == Code::KEYED_CALL_IC) {
out.AddFormatted(", argc = %d", code->arguments_count()); 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 // Reverse lookup required as the minor key cannot be retrieved
// from the code object. // from the code object.
Object* obj = heap->code_stubs()->SlowReverseLookup(code); Object* obj = heap->code_stubs()->SlowReverseLookup(code);

View File

@ -1304,7 +1304,7 @@ void LoadIC::GenerateMegamorphic(MacroAssembler* masm) {
// Probe the stub cache. // Probe the stub cache.
Code::Flags flags = Code::ComputeFlags( Code::Flags flags = Code::ComputeFlags(
Code::STUB, MONOMORPHIC, Code::kNoExtraICState, Code::HANDLER, MONOMORPHIC, Code::kNoExtraICState,
Code::NORMAL, Code::LOAD_IC); Code::NORMAL, Code::LOAD_IC);
masm->isolate()->stub_cache()->GenerateProbe( masm->isolate()->stub_cache()->GenerateProbe(
masm, flags, edx, ecx, ebx, eax); masm, flags, edx, ecx, ebx, eax);
@ -1423,7 +1423,7 @@ void StoreIC::GenerateMegamorphic(MacroAssembler* masm,
// ----------------------------------- // -----------------------------------
Code::Flags flags = Code::ComputeFlags( Code::Flags flags = Code::ComputeFlags(
Code::STUB, MONOMORPHIC, strict_mode, Code::HANDLER, MONOMORPHIC, strict_mode,
Code::NORMAL, Code::STORE_IC); Code::NORMAL, Code::STORE_IC);
masm->isolate()->stub_cache()->GenerateProbe( masm->isolate()->stub_cache()->GenerateProbe(
masm, flags, edx, ecx, ebx, no_reg); masm, flags, edx, ecx, ebx, no_reg);

View File

@ -999,7 +999,7 @@ bool IC::UpdatePolymorphicIC(State state,
Handle<String> name, Handle<String> name,
Handle<Code> code, Handle<Code> code,
StrictModeFlag strict_mode) { StrictModeFlag strict_mode) {
if (code->type() == Code::NORMAL) return false; if (code->kind() != Code::HANDLER) return false;
if (target()->ic_state() == MONOMORPHIC && if (target()->ic_state() == MONOMORPHIC &&
target()->type() == Code::NORMAL) { target()->type() == Code::NORMAL) {
return false; return false;

View File

@ -1629,6 +1629,10 @@ void Logger::LogCodeObject(Object* object) {
description = "A builtin from the snapshot"; description = "A builtin from the snapshot";
tag = Logger::BUILTIN_TAG; tag = Logger::BUILTIN_TAG;
break; break;
case Code::HANDLER:
description = "An IC handler from the snapshot";
tag = Logger::HANDLER_TAG;
break;
case Code::KEYED_LOAD_IC: case Code::KEYED_LOAD_IC:
description = "A keyed load IC from the snapshot"; description = "A keyed load IC from the snapshot";
tag = Logger::KEYED_LOAD_IC_TAG; tag = Logger::KEYED_LOAD_IC_TAG;

View File

@ -131,6 +131,7 @@ struct TickSample;
V(CALLBACK_TAG, "Callback") \ V(CALLBACK_TAG, "Callback") \
V(EVAL_TAG, "Eval") \ V(EVAL_TAG, "Eval") \
V(FUNCTION_TAG, "Function") \ V(FUNCTION_TAG, "Function") \
V(HANDLER_TAG, "Handler") \
V(KEYED_LOAD_IC_TAG, "KeyedLoadIC") \ V(KEYED_LOAD_IC_TAG, "KeyedLoadIC") \
V(KEYED_LOAD_POLYMORPHIC_IC_TAG, "KeyedLoadPolymorphicIC") \ V(KEYED_LOAD_POLYMORPHIC_IC_TAG, "KeyedLoadPolymorphicIC") \
V(KEYED_EXTERNAL_ARRAY_LOAD_IC_TAG, "KeyedExternalArrayLoadIC") \ V(KEYED_EXTERNAL_ARRAY_LOAD_IC_TAG, "KeyedExternalArrayLoadIC") \

View File

@ -656,7 +656,7 @@ void LoadIC::GenerateMegamorphic(MacroAssembler* masm) {
// Probe the stub cache. // Probe the stub cache.
Code::Flags flags = Code::ComputeFlags( Code::Flags flags = Code::ComputeFlags(
Code::STUB, MONOMORPHIC, Code::kNoExtraICState, Code::HANDLER, MONOMORPHIC, Code::kNoExtraICState,
Code::NORMAL, Code::LOAD_IC); Code::NORMAL, Code::LOAD_IC);
masm->isolate()->stub_cache()->GenerateProbe( masm->isolate()->stub_cache()->GenerateProbe(
masm, flags, a0, a2, a3, t0, t1, t2); 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. // Get the receiver from the stack and probe the stub cache.
Code::Flags flags = Code::ComputeFlags( Code::Flags flags = Code::ComputeFlags(
Code::STUB, MONOMORPHIC, strict_mode, Code::HANDLER, MONOMORPHIC, strict_mode,
Code::NORMAL, Code::STORE_IC); Code::NORMAL, Code::STORE_IC);
masm->isolate()->stub_cache()->GenerateProbe( masm->isolate()->stub_cache()->GenerateProbe(
masm, flags, a1, a2, a3, t0, t1, t2); masm, flags, a1, a2, a3, t0, t1, t2);

View File

@ -3776,6 +3776,7 @@ inline void Code::set_is_crankshafted(bool value) {
int Code::major_key() { int Code::major_key() {
ASSERT(kind() == STUB || ASSERT(kind() == STUB ||
kind() == HANDLER ||
kind() == BINARY_OP_IC || kind() == BINARY_OP_IC ||
kind() == COMPARE_IC || kind() == COMPARE_IC ||
kind() == COMPARE_NIL_IC || kind() == COMPARE_NIL_IC ||
@ -3790,6 +3791,7 @@ int Code::major_key() {
void Code::set_major_key(int major) { void Code::set_major_key(int major) {
ASSERT(kind() == STUB || ASSERT(kind() == STUB ||
kind() == HANDLER ||
kind() == BINARY_OP_IC || kind() == BINARY_OP_IC ||
kind() == COMPARE_IC || kind() == COMPARE_IC ||
kind() == COMPARE_NIL_IC || kind() == COMPARE_NIL_IC ||

View File

@ -10384,7 +10384,7 @@ void Code::FindAllCode(CodeHandleList* code_list, int length) {
if (i++ == length) return; if (i++ == length) return;
RelocInfo* info = it.rinfo(); RelocInfo* info = it.rinfo();
Code* code = Code::GetCodeFromTargetAddress(info->target_address()); Code* code = Code::GetCodeFromTargetAddress(info->target_address());
ASSERT(code->kind() == Code::STUB); ASSERT(code->kind() == Code::HANDLER);
code_list->Add(Handle<Code>(code)); code_list->Add(Handle<Code>(code));
} }
UNREACHABLE(); UNREACHABLE();

View File

@ -4763,6 +4763,7 @@ class Code: public HeapObject {
V(FUNCTION) \ V(FUNCTION) \
V(OPTIMIZED_FUNCTION) \ V(OPTIMIZED_FUNCTION) \
V(STUB) \ V(STUB) \
V(HANDLER) \
V(BUILTIN) \ V(BUILTIN) \
V(REGEXP) V(REGEXP)

View File

@ -140,7 +140,7 @@ Handle<Code> StubCache::FindLoadHandler(Handle<Name> name,
? OWN_MAP : PROTOTYPE_MAP; ? OWN_MAP : PROTOTYPE_MAP;
ASSERT(type != Code::NORMAL); ASSERT(type != Code::NORMAL);
Code::Flags flags = Code::ComputeMonomorphicFlags( Code::Flags flags = Code::ComputeMonomorphicFlags(
Code::STUB, Code::kNoExtraICState, type, kind, holder_flag); Code::HANDLER, Code::kNoExtraICState, type, kind, holder_flag);
Handle<Object> probe(stub_holder->map()->FindInCodeCache(*name, flags), Handle<Object> probe(stub_holder->map()->FindInCodeCache(*name, flags),
isolate_); isolate_);
if (probe->IsCode()) return Handle<Code>::cast(probe); if (probe->IsCode()) return Handle<Code>::cast(probe);
@ -157,7 +157,7 @@ Handle<Code> StubCache::FindStoreHandler(Handle<Name> name,
STANDARD_STORE, strict_mode); STANDARD_STORE, strict_mode);
ASSERT(type != Code::NORMAL); ASSERT(type != Code::NORMAL);
Code::Flags flags = Code::ComputeMonomorphicFlags( Code::Flags flags = Code::ComputeMonomorphicFlags(
Code::STUB, extra_ic_state, type, kind); Code::HANDLER, extra_ic_state, type, kind);
Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags), Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags),
isolate_); isolate_);
if (probe->IsCode()) return Handle<Code>::cast(probe); if (probe->IsCode()) return Handle<Code>::cast(probe);
@ -1987,7 +1987,7 @@ Handle<Code> BaseLoadStubCompiler::GetCode(Code::Kind kind,
Handle<Name> name) { Handle<Name> name) {
ASSERT(type != Code::NORMAL); ASSERT(type != Code::NORMAL);
Code::Flags flags = Code::ComputeFlags( Code::Flags flags = Code::ComputeFlags(
Code::STUB, MONOMORPHIC, Code::kNoExtraICState, type, kind); Code::HANDLER, MONOMORPHIC, Code::kNoExtraICState, type, kind);
Handle<Code> code = GetCodeWithFlags(flags, name); Handle<Code> code = GetCodeWithFlags(flags, name);
PROFILE(isolate(), CodeCreateEvent(log_kind(code), *code, *name)); PROFILE(isolate(), CodeCreateEvent(log_kind(code), *code, *name));
JitEvent(name, code); JitEvent(name, code);
@ -2000,7 +2000,7 @@ Handle<Code> BaseStoreStubCompiler::GetCode(Code::Kind kind,
Handle<Name> name) { Handle<Name> name) {
ASSERT(type != Code::NORMAL); ASSERT(type != Code::NORMAL);
Code::Flags flags = Code::ComputeFlags( Code::Flags flags = Code::ComputeFlags(
Code::STUB, MONOMORPHIC, extra_state(), type, kind); Code::HANDLER, MONOMORPHIC, extra_state(), type, kind);
Handle<Code> code = GetCodeWithFlags(flags, name); Handle<Code> code = GetCodeWithFlags(flags, name);
PROFILE(isolate(), CodeCreateEvent(log_kind(code), *code, *name)); PROFILE(isolate(), CodeCreateEvent(log_kind(code), *code, *name));
JitEvent(name, code); JitEvent(name, code);

View File

@ -251,7 +251,7 @@ void TypeFeedbackOracle::LoadReceiverTypes(Property* expr,
Handle<String> name, Handle<String> name,
SmallMapList* types) { SmallMapList* types) {
Code::Flags flags = Code::ComputeFlags( Code::Flags flags = Code::ComputeFlags(
Code::STUB, MONOMORPHIC, Code::kNoExtraICState, Code::HANDLER, MONOMORPHIC, Code::kNoExtraICState,
Code::NORMAL, Code::LOAD_IC); Code::NORMAL, Code::LOAD_IC);
CollectReceiverTypes(expr->PropertyFeedbackId(), name, flags, types); CollectReceiverTypes(expr->PropertyFeedbackId(), name, flags, types);
} }
@ -261,7 +261,7 @@ void TypeFeedbackOracle::StoreReceiverTypes(Assignment* expr,
Handle<String> name, Handle<String> name,
SmallMapList* types) { SmallMapList* types) {
Code::Flags flags = Code::ComputeFlags( Code::Flags flags = Code::ComputeFlags(
Code::STUB, MONOMORPHIC, Code::kNoExtraICState, Code::HANDLER, MONOMORPHIC, Code::kNoExtraICState,
Code::NORMAL, Code::STORE_IC); Code::NORMAL, Code::STORE_IC);
CollectReceiverTypes(expr->AssignmentFeedbackId(), name, flags, types); CollectReceiverTypes(expr->AssignmentFeedbackId(), name, flags, types);
} }

View File

@ -1330,7 +1330,7 @@ void LoadIC::GenerateMegamorphic(MacroAssembler* masm) {
// Probe the stub cache. // Probe the stub cache.
Code::Flags flags = Code::ComputeFlags( Code::Flags flags = Code::ComputeFlags(
Code::STUB, MONOMORPHIC, Code::kNoExtraICState, Code::HANDLER, MONOMORPHIC, Code::kNoExtraICState,
Code::NORMAL, Code::LOAD_IC); Code::NORMAL, Code::LOAD_IC);
masm->isolate()->stub_cache()->GenerateProbe( masm->isolate()->stub_cache()->GenerateProbe(
masm, flags, rax, rcx, rbx, rdx); 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. // Get the receiver from the stack and probe the stub cache.
Code::Flags flags = Code::ComputeFlags( Code::Flags flags = Code::ComputeFlags(
Code::STUB, MONOMORPHIC, strict_mode, Code::HANDLER, MONOMORPHIC, strict_mode,
Code::NORMAL, Code::STORE_IC); Code::NORMAL, Code::STORE_IC);
masm->isolate()->stub_cache()->GenerateProbe( masm->isolate()->stub_cache()->GenerateProbe(
masm, flags, rdx, rcx, rbx, no_reg); masm, flags, rdx, rcx, rbx, no_reg);