Commit ed9bbc70 authored by verwaest@chromium.org's avatar verwaest@chromium.org

Remove HandlerKindField and just encode the handlerkind as the only extra-ic-state.

R=ishell@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19385 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 209b17ac
...@@ -426,8 +426,7 @@ static MemOperand GenerateUnmappedArgumentsLookup(MacroAssembler* masm, ...@@ -426,8 +426,7 @@ static MemOperand GenerateUnmappedArgumentsLookup(MacroAssembler* masm,
} }
void LoadIC::GenerateMegamorphic(MacroAssembler* masm, void LoadIC::GenerateMegamorphic(MacroAssembler* masm) {
ExtraICState extra_state) {
// ----------- S t a t e ------------- // ----------- S t a t e -------------
// -- x2 : name // -- x2 : name
// -- lr : return address // -- lr : return address
...@@ -435,7 +434,7 @@ void LoadIC::GenerateMegamorphic(MacroAssembler* masm, ...@@ -435,7 +434,7 @@ void LoadIC::GenerateMegamorphic(MacroAssembler* masm,
// ----------------------------------- // -----------------------------------
// Probe the stub cache. // Probe the stub cache.
Code::Flags flags = Code::ComputeHandlerFlags(Code::LOAD_IC, extra_state); Code::Flags flags = Code::ComputeHandlerFlags(Code::LOAD_IC);
masm->isolate()->stub_cache()->GenerateProbe( masm->isolate()->stub_cache()->GenerateProbe(
masm, flags, x0, x2, x3, x4, x5, x6); masm, flags, x0, x2, x3, x4, x5, x6);
...@@ -1217,8 +1216,7 @@ void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm, ...@@ -1217,8 +1216,7 @@ void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm,
} }
void StoreIC::GenerateMegamorphic(MacroAssembler* masm, void StoreIC::GenerateMegamorphic(MacroAssembler* masm) {
ExtraICState extra_state) {
// ----------- S t a t e ------------- // ----------- S t a t e -------------
// -- x0 : value // -- x0 : value
// -- x1 : receiver // -- x1 : receiver
...@@ -1227,8 +1225,7 @@ void StoreIC::GenerateMegamorphic(MacroAssembler* masm, ...@@ -1227,8 +1225,7 @@ void StoreIC::GenerateMegamorphic(MacroAssembler* masm,
// ----------------------------------- // -----------------------------------
// Probe the stub cache. // Probe the stub cache.
Code::Flags flags = Code::ComputeHandlerFlags(Code::STORE_IC, extra_state); Code::Flags flags = Code::ComputeHandlerFlags(Code::STORE_IC);
masm->isolate()->stub_cache()->GenerateProbe( masm->isolate()->stub_cache()->GenerateProbe(
masm, flags, x1, x2, x3, x4, x5, x6); masm, flags, x1, x2, x3, x4, x5, x6);
......
...@@ -333,8 +333,7 @@ static void GenerateKeyNameCheck(MacroAssembler* masm, ...@@ -333,8 +333,7 @@ static void GenerateKeyNameCheck(MacroAssembler* masm,
} }
void LoadIC::GenerateMegamorphic(MacroAssembler* masm, void LoadIC::GenerateMegamorphic(MacroAssembler* masm) {
ExtraICState extra_state) {
// ----------- S t a t e ------------- // ----------- S t a t e -------------
// -- r2 : name // -- r2 : name
// -- lr : return address // -- lr : return address
...@@ -342,7 +341,7 @@ void LoadIC::GenerateMegamorphic(MacroAssembler* masm, ...@@ -342,7 +341,7 @@ void LoadIC::GenerateMegamorphic(MacroAssembler* masm,
// ----------------------------------- // -----------------------------------
// Probe the stub cache. // Probe the stub cache.
Code::Flags flags = Code::ComputeHandlerFlags(Code::LOAD_IC, extra_state); Code::Flags flags = Code::ComputeHandlerFlags(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);
...@@ -1160,8 +1159,7 @@ void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm, ...@@ -1160,8 +1159,7 @@ void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm,
} }
void StoreIC::GenerateMegamorphic(MacroAssembler* masm, void StoreIC::GenerateMegamorphic(MacroAssembler* masm) {
ExtraICState extra_state) {
// ----------- S t a t e ------------- // ----------- S t a t e -------------
// -- r0 : value // -- r0 : value
// -- r1 : receiver // -- r1 : receiver
...@@ -1170,7 +1168,7 @@ void StoreIC::GenerateMegamorphic(MacroAssembler* masm, ...@@ -1170,7 +1168,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::ComputeHandlerFlags(Code::STORE_IC, extra_state); Code::Flags flags = Code::ComputeHandlerFlags(Code::STORE_IC);
masm->isolate()->stub_cache()->GenerateProbe( masm->isolate()->stub_cache()->GenerateProbe(
masm, flags, r1, r2, r3, r4, r5, r6); masm, flags, r1, r2, r3, r4, r5, r6);
......
...@@ -882,9 +882,7 @@ class HICStub: public HydrogenCodeStub { ...@@ -882,9 +882,7 @@ class HICStub: public HydrogenCodeStub {
class HandlerStub: public HICStub { class HandlerStub: public HICStub {
public: public:
virtual Code::Kind GetCodeKind() const { return Code::HANDLER; } virtual Code::Kind GetCodeKind() const { return Code::HANDLER; }
virtual ExtraICState GetExtraICState() { virtual ExtraICState GetExtraICState() { return kind(); }
return Code::HandlerKindField::encode(kind());
}
protected: protected:
HandlerStub() : HICStub() { } HandlerStub() : HICStub() { }
......
...@@ -947,8 +947,7 @@ void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm, ...@@ -947,8 +947,7 @@ void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm,
} }
void LoadIC::GenerateMegamorphic(MacroAssembler* masm, void LoadIC::GenerateMegamorphic(MacroAssembler* masm) {
ExtraICState extra_state) {
// ----------- S t a t e ------------- // ----------- S t a t e -------------
// -- ecx : name // -- ecx : name
// -- edx : receiver // -- edx : receiver
...@@ -956,7 +955,7 @@ void LoadIC::GenerateMegamorphic(MacroAssembler* masm, ...@@ -956,7 +955,7 @@ void LoadIC::GenerateMegamorphic(MacroAssembler* masm,
// ----------------------------------- // -----------------------------------
// Probe the stub cache. // Probe the stub cache.
Code::Flags flags = Code::ComputeHandlerFlags(Code::LOAD_IC, extra_state); Code::Flags flags = Code::ComputeHandlerFlags(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);
...@@ -1062,15 +1061,14 @@ void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { ...@@ -1062,15 +1061,14 @@ void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
} }
void StoreIC::GenerateMegamorphic(MacroAssembler* masm, void StoreIC::GenerateMegamorphic(MacroAssembler* masm) {
ExtraICState extra_state) {
// ----------- S t a t e ------------- // ----------- S t a t e -------------
// -- eax : value // -- eax : value
// -- ecx : name // -- ecx : name
// -- edx : receiver // -- edx : receiver
// -- esp[0] : return address // -- esp[0] : return address
// ----------------------------------- // -----------------------------------
Code::Flags flags = Code::ComputeHandlerFlags(Code::STORE_IC, extra_state); Code::Flags flags = Code::ComputeHandlerFlags(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);
......
...@@ -320,8 +320,7 @@ class LoadIC: public IC { ...@@ -320,8 +320,7 @@ class LoadIC: public IC {
GenerateMiss(masm); GenerateMiss(masm);
} }
static void GenerateMiss(MacroAssembler* masm); static void GenerateMiss(MacroAssembler* masm);
static void GenerateMegamorphic(MacroAssembler* masm, static void GenerateMegamorphic(MacroAssembler* masm);
ExtraICState extra_state);
static void GenerateNormal(MacroAssembler* masm); static void GenerateNormal(MacroAssembler* masm);
static void GenerateRuntimeGetProperty(MacroAssembler* masm); static void GenerateRuntimeGetProperty(MacroAssembler* masm);
...@@ -482,8 +481,7 @@ class StoreIC: public IC { ...@@ -482,8 +481,7 @@ class StoreIC: public IC {
GenerateMiss(masm); GenerateMiss(masm);
} }
static void GenerateMiss(MacroAssembler* masm); static void GenerateMiss(MacroAssembler* masm);
static void GenerateMegamorphic(MacroAssembler* masm, static void GenerateMegamorphic(MacroAssembler* masm);
ExtraICState extra_ic_state);
static void GenerateNormal(MacroAssembler* masm); static void GenerateNormal(MacroAssembler* masm);
static void GenerateRuntimeSetProperty(MacroAssembler* masm, static void GenerateRuntimeSetProperty(MacroAssembler* masm,
StrictModeFlag strict_mode); StrictModeFlag strict_mode);
......
...@@ -4498,11 +4498,9 @@ Code::Flags Code::ComputeMonomorphicFlags(Kind kind, ...@@ -4498,11 +4498,9 @@ Code::Flags Code::ComputeMonomorphicFlags(Kind kind,
Code::Flags Code::ComputeHandlerFlags(Kind handler_kind, Code::Flags Code::ComputeHandlerFlags(Kind handler_kind,
ExtraICState extra_ic_state,
StubType type, StubType type,
InlineCacheHolderFlag holder) { InlineCacheHolderFlag holder) {
ExtraICState extra = HandlerKindField::encode(handler_kind) | extra_ic_state; return ComputeFlags(Code::HANDLER, MONOMORPHIC, handler_kind, type, holder);
return ComputeFlags(Code::HANDLER, MONOMORPHIC, extra, type, holder);
} }
......
...@@ -5385,7 +5385,6 @@ class Code: public HeapObject { ...@@ -5385,7 +5385,6 @@ class Code: public HeapObject {
static inline Flags ComputeHandlerFlags( static inline Flags ComputeHandlerFlags(
Kind handler_kind, Kind handler_kind,
ExtraICState extra_ic_state = kNoExtraICState,
StubType type = NORMAL, StubType type = NORMAL,
InlineCacheHolderFlag holder = OWN_MAP); InlineCacheHolderFlag holder = OWN_MAP);
...@@ -5613,8 +5612,6 @@ class Code: public HeapObject { ...@@ -5613,8 +5612,6 @@ class Code: public HeapObject {
class BackEdgesPatchedForOSRField: public BitField<bool, class BackEdgesPatchedForOSRField: public BitField<bool,
kIsCrankshaftedBit + 1 + 29, 1> {}; // NOLINT kIsCrankshaftedBit + 1 + 29, 1> {}; // NOLINT
class HandlerKindField: public BitField<Kind, 17, 4> {};
static const int kArgumentsBits = 16; static const int kArgumentsBits = 16;
static const int kMaxArguments = (1 << kArgumentsBits) - 1; static const int kMaxArguments = (1 << kArgumentsBits) - 1;
......
...@@ -689,9 +689,7 @@ Handle<Code> StubCompiler::CompileLoadPreMonomorphic(Code::Flags flags) { ...@@ -689,9 +689,7 @@ Handle<Code> StubCompiler::CompileLoadPreMonomorphic(Code::Flags flags) {
Handle<Code> StubCompiler::CompileLoadMegamorphic(Code::Flags flags) { Handle<Code> StubCompiler::CompileLoadMegamorphic(Code::Flags flags) {
ExtraICState extra_state = Code::ExtractExtraICStateFromFlags(flags); LoadIC::GenerateMegamorphic(masm());
ContextualMode mode = LoadIC::GetContextualMode(extra_state);
LoadIC::GenerateMegamorphic(masm(), mode);
Handle<Code> code = GetCodeWithFlags(flags, "CompileLoadMegamorphic"); Handle<Code> code = GetCodeWithFlags(flags, "CompileLoadMegamorphic");
PROFILE(isolate(), PROFILE(isolate(),
CodeCreateEvent(Logger::LOAD_MEGAMORPHIC_TAG, *code, 0)); CodeCreateEvent(Logger::LOAD_MEGAMORPHIC_TAG, *code, 0));
...@@ -733,8 +731,7 @@ Handle<Code> StubCompiler::CompileStoreGeneric(Code::Flags flags) { ...@@ -733,8 +731,7 @@ Handle<Code> StubCompiler::CompileStoreGeneric(Code::Flags flags) {
Handle<Code> StubCompiler::CompileStoreMegamorphic(Code::Flags flags) { Handle<Code> StubCompiler::CompileStoreMegamorphic(Code::Flags flags) {
ExtraICState extra_state = Code::ExtractExtraICStateFromFlags(flags); StoreIC::GenerateMegamorphic(masm());
StoreIC::GenerateMegamorphic(masm(), extra_state);
Handle<Code> code = GetCodeWithFlags(flags, "CompileStoreMegamorphic"); Handle<Code> code = GetCodeWithFlags(flags, "CompileStoreMegamorphic");
PROFILE(isolate(), PROFILE(isolate(),
CodeCreateEvent(Logger::STORE_MEGAMORPHIC_TAG, *code, 0)); CodeCreateEvent(Logger::STORE_MEGAMORPHIC_TAG, *code, 0));
...@@ -1235,8 +1232,8 @@ Handle<Code> BaseLoadStoreStubCompiler::GetICCode(Code::Kind kind, ...@@ -1235,8 +1232,8 @@ Handle<Code> BaseLoadStoreStubCompiler::GetICCode(Code::Kind kind,
Handle<Code> BaseLoadStoreStubCompiler::GetCode(Code::Kind kind, Handle<Code> BaseLoadStoreStubCompiler::GetCode(Code::Kind kind,
Code::StubType type, Code::StubType type,
Handle<Name> name) { Handle<Name> name) {
Code::Flags flags = Code::ComputeHandlerFlags( ASSERT_EQ(kNoExtraICState, extra_state());
kind, extra_state(), type, cache_holder_); Code::Flags flags = Code::ComputeHandlerFlags(kind, type, cache_holder_);
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);
......
...@@ -973,8 +973,7 @@ void KeyedStoreIC::GenerateNonStrictArguments(MacroAssembler* masm) { ...@@ -973,8 +973,7 @@ void KeyedStoreIC::GenerateNonStrictArguments(MacroAssembler* masm) {
} }
void LoadIC::GenerateMegamorphic(MacroAssembler* masm, void LoadIC::GenerateMegamorphic(MacroAssembler* masm) {
ExtraICState extra_state) {
// ----------- S t a t e ------------- // ----------- S t a t e -------------
// -- rax : receiver // -- rax : receiver
// -- rcx : name // -- rcx : name
...@@ -982,7 +981,7 @@ void LoadIC::GenerateMegamorphic(MacroAssembler* masm, ...@@ -982,7 +981,7 @@ void LoadIC::GenerateMegamorphic(MacroAssembler* masm,
// ----------------------------------- // -----------------------------------
// Probe the stub cache. // Probe the stub cache.
Code::Flags flags = Code::ComputeHandlerFlags(Code::LOAD_IC, extra_state); Code::Flags flags = Code::ComputeHandlerFlags(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);
...@@ -1089,8 +1088,7 @@ void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { ...@@ -1089,8 +1088,7 @@ void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
} }
void StoreIC::GenerateMegamorphic(MacroAssembler* masm, void StoreIC::GenerateMegamorphic(MacroAssembler* masm) {
ExtraICState extra_state) {
// ----------- S t a t e ------------- // ----------- S t a t e -------------
// -- rax : value // -- rax : value
// -- rcx : name // -- rcx : name
...@@ -1099,7 +1097,7 @@ void StoreIC::GenerateMegamorphic(MacroAssembler* masm, ...@@ -1099,7 +1097,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::ComputeHandlerFlags(Code::STORE_IC, extra_state); Code::Flags flags = Code::ComputeHandlerFlags(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);
......
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