Reviewers: Igor Sheludko,

Message:
PTAL

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

Please review this at https://codereview.chromium.org/166883002/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+24, -45 lines):
  M src/a64/ic-a64.cc
  M src/arm/ic-arm.cc
  M src/code-stubs.h
  M src/ia32/ic-ia32.cc
  M src/ic.h
  M src/objects-inl.h
  M src/objects.h
  M src/stub-cache.cc
  M src/x64/ic-x64.cc


Index: src/a64/ic-a64.cc
diff --git a/src/a64/ic-a64.cc b/src/a64/ic-a64.cc
index d4ac5564692fc64e6f23c33a90639f7d66af2d39..93d7857b050527004e4a672dac1392421796397b 100644
--- a/src/a64/ic-a64.cc
+++ b/src/a64/ic-a64.cc
@@ -426,8 +426,7 @@ static MemOperand GenerateUnmappedArgumentsLookup(MacroAssembler* masm,
 }


-void LoadIC::GenerateMegamorphic(MacroAssembler* masm,
-                                 ExtraICState extra_state) {
+void LoadIC::GenerateMegamorphic(MacroAssembler* masm) {
   // ----------- S t a t e -------------
   //  -- x2    : name
   //  -- lr    : return address
@@ -435,7 +434,7 @@ void LoadIC::GenerateMegamorphic(MacroAssembler* masm,
   // -----------------------------------

   // 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, flags, x0, x2, x3, x4, x5, x6);

@@ -1217,8 +1216,7 @@ void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm,
 }


-void StoreIC::GenerateMegamorphic(MacroAssembler* masm,
-                                  ExtraICState extra_state) {
+void StoreIC::GenerateMegamorphic(MacroAssembler* masm) {
   // ----------- S t a t e -------------
   //  -- x0    : value
   //  -- x1    : receiver
@@ -1227,8 +1225,7 @@ void StoreIC::GenerateMegamorphic(MacroAssembler* masm,
   // -----------------------------------

   // 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, flags, x1, x2, x3, x4, x5, x6);

Index: src/arm/ic-arm.cc
diff --git a/src/arm/ic-arm.cc b/src/arm/ic-arm.cc
index 314a07f4dc517e395f56b7b947e70a116fc62683..1af6cf87b8f4b2dd0b2a2fb0e736428084973114 100644
--- a/src/arm/ic-arm.cc
+++ b/src/arm/ic-arm.cc
@@ -333,8 +333,7 @@ static void GenerateKeyNameCheck(MacroAssembler* masm,
 }


-void LoadIC::GenerateMegamorphic(MacroAssembler* masm,
-                                 ExtraICState extra_state) {
+void LoadIC::GenerateMegamorphic(MacroAssembler* masm) {
   // ----------- S t a t e -------------
   //  -- r2    : name
   //  -- lr    : return address
@@ -342,7 +341,7 @@ void LoadIC::GenerateMegamorphic(MacroAssembler* masm,
   // -----------------------------------

   // 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, flags, r0, r2, r3, r4, r5, r6);

@@ -1160,8 +1159,7 @@ void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm,
 }


-void StoreIC::GenerateMegamorphic(MacroAssembler* masm,
-                                  ExtraICState extra_state) {
+void StoreIC::GenerateMegamorphic(MacroAssembler* masm) {
   // ----------- S t a t e -------------
   //  -- r0    : value
   //  -- r1    : receiver
@@ -1170,7 +1168,7 @@ void StoreIC::GenerateMegamorphic(MacroAssembler* masm,
   // -----------------------------------

   // 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, flags, r1, r2, r3, r4, r5, r6);
Index: src/code-stubs.h
diff --git a/src/code-stubs.h b/src/code-stubs.h
index 5cbeaacb5c262e4f21fbc106ccf91d6f8ce8d4e6..90e7c0ddaddb97d399f75e8de42c79abbaa679b6 100644
--- a/src/code-stubs.h
+++ b/src/code-stubs.h
@@ -882,9 +882,7 @@ class HICStub: public HydrogenCodeStub {
 class HandlerStub: public HICStub {
  public:
   virtual Code::Kind GetCodeKind() const { return Code::HANDLER; }
-  virtual ExtraICState GetExtraICState() {
-    return Code::HandlerKindField::encode(kind());
-  }
+  virtual ExtraICState GetExtraICState() { return kind(); }

  protected:
   HandlerStub() : HICStub() { }
Index: src/ia32/ic-ia32.cc
diff --git a/src/ia32/ic-ia32.cc b/src/ia32/ic-ia32.cc
index 729a3daee751bda8cd6723f07c97db1fe05ab024..69f6e3a6bb583010c6e2470dc52b09b7c6cb30f0 100644
--- a/src/ia32/ic-ia32.cc
+++ b/src/ia32/ic-ia32.cc
@@ -947,8 +947,7 @@ void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm,
 }


-void LoadIC::GenerateMegamorphic(MacroAssembler* masm,
-                                 ExtraICState extra_state) {
+void LoadIC::GenerateMegamorphic(MacroAssembler* masm) {
   // ----------- S t a t e -------------
   //  -- ecx    : name
   //  -- edx    : receiver
@@ -956,7 +955,7 @@ void LoadIC::GenerateMegamorphic(MacroAssembler* masm,
   // -----------------------------------

   // 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, flags, edx, ecx, ebx, eax);

@@ -1062,15 +1061,14 @@ void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
 }


-void StoreIC::GenerateMegamorphic(MacroAssembler* masm,
-                                  ExtraICState extra_state) {
+void StoreIC::GenerateMegamorphic(MacroAssembler* masm) {
   // ----------- S t a t e -------------
   //  -- eax    : value
   //  -- ecx    : name
   //  -- edx    : receiver
   //  -- 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, flags, edx, ecx, ebx, no_reg);

Index: src/ic.h
diff --git a/src/ic.h b/src/ic.h
index 99309f4edf261a53871bd9f9e031016c2e69f4b7..213a48182635badf5c833729e0d8d143e999b6c8 100644
--- a/src/ic.h
+++ b/src/ic.h
@@ -320,8 +320,7 @@ class LoadIC: public IC {
     GenerateMiss(masm);
   }
   static void GenerateMiss(MacroAssembler* masm);
-  static void GenerateMegamorphic(MacroAssembler* masm,
-                                  ExtraICState extra_state);
+  static void GenerateMegamorphic(MacroAssembler* masm);
   static void GenerateNormal(MacroAssembler* masm);
   static void GenerateRuntimeGetProperty(MacroAssembler* masm);

@@ -482,8 +481,7 @@ class StoreIC: public IC {
     GenerateMiss(masm);
   }
   static void GenerateMiss(MacroAssembler* masm);
-  static void GenerateMegamorphic(MacroAssembler* masm,
-                                  ExtraICState extra_ic_state);
+  static void GenerateMegamorphic(MacroAssembler* masm);
   static void GenerateNormal(MacroAssembler* masm);
   static void GenerateRuntimeSetProperty(MacroAssembler* masm,
                                          StrictModeFlag strict_mode);
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 387065ffe04a886062ae36b622e0f15554cabda9..97f00ade4da389da6f87be5f7f4fd2ea47fe983d 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -4498,11 +4498,9 @@ Code::Flags Code::ComputeMonomorphicFlags(Kind kind,


 Code::Flags Code::ComputeHandlerFlags(Kind handler_kind,
-                                      ExtraICState extra_ic_state,
                                       StubType type,
                                       InlineCacheHolderFlag holder) {
- ExtraICState extra = HandlerKindField::encode(handler_kind) | extra_ic_state;
-  return ComputeFlags(Code::HANDLER, MONOMORPHIC, extra, type, holder);
+ return ComputeFlags(Code::HANDLER, MONOMORPHIC, handler_kind, type, holder);
 }


Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index eb8a7565233cbae8965c465bb7b54af0856a1e01..62251fb32dbed76a7d3f7e510a41c94be01b5179 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -5385,7 +5385,6 @@ class Code: public HeapObject {

   static inline Flags ComputeHandlerFlags(
       Kind handler_kind,
-      ExtraICState extra_ic_state = kNoExtraICState,
       StubType type = NORMAL,
       InlineCacheHolderFlag holder = OWN_MAP);

@@ -5613,8 +5612,6 @@ class Code: public HeapObject {
   class BackEdgesPatchedForOSRField: public BitField<bool,
       kIsCrankshaftedBit + 1 + 29, 1> {};  // NOLINT

-  class HandlerKindField: public BitField<Kind, 17, 4> {};
-
   static const int kArgumentsBits = 16;
   static const int kMaxArguments = (1 << kArgumentsBits) - 1;

Index: src/stub-cache.cc
diff --git a/src/stub-cache.cc b/src/stub-cache.cc
index bf449d8bf7347c2982f3c3271c2aa7d7f83456da..36e59bd21c406c1d5c070288bf7bc99b93149201 100644
--- a/src/stub-cache.cc
+++ b/src/stub-cache.cc
@@ -689,9 +689,7 @@ Handle<Code> StubCompiler::CompileLoadPreMonomorphic(Code::Flags flags) {


 Handle<Code> StubCompiler::CompileLoadMegamorphic(Code::Flags flags) {
-  ExtraICState extra_state = Code::ExtractExtraICStateFromFlags(flags);
-  ContextualMode mode = LoadIC::GetContextualMode(extra_state);
-  LoadIC::GenerateMegamorphic(masm(), mode);
+  LoadIC::GenerateMegamorphic(masm());
   Handle<Code> code = GetCodeWithFlags(flags, "CompileLoadMegamorphic");
   PROFILE(isolate(),
           CodeCreateEvent(Logger::LOAD_MEGAMORPHIC_TAG, *code, 0));
@@ -733,8 +731,7 @@ Handle<Code> StubCompiler::CompileStoreGeneric(Code::Flags flags) {


 Handle<Code> StubCompiler::CompileStoreMegamorphic(Code::Flags flags) {
-  ExtraICState extra_state = Code::ExtractExtraICStateFromFlags(flags);
-  StoreIC::GenerateMegamorphic(masm(), extra_state);
+  StoreIC::GenerateMegamorphic(masm());
   Handle<Code> code = GetCodeWithFlags(flags, "CompileStoreMegamorphic");
   PROFILE(isolate(),
           CodeCreateEvent(Logger::STORE_MEGAMORPHIC_TAG, *code, 0));
@@ -1235,8 +1232,8 @@ Handle<Code> BaseLoadStoreStubCompiler::GetICCode(Code::Kind kind,
 Handle<Code> BaseLoadStoreStubCompiler::GetCode(Code::Kind kind,
                                                 Code::StubType type,
                                                 Handle<Name> name) {
-  Code::Flags flags = Code::ComputeHandlerFlags(
-      kind, extra_state(), type, cache_holder_);
+  ASSERT_EQ(kNoExtraICState, extra_state());
+  Code::Flags flags = Code::ComputeHandlerFlags(kind, type, cache_holder_);
   Handle<Code> code = GetCodeWithFlags(flags, name);
   PROFILE(isolate(), CodeCreateEvent(log_kind(code), *code, *name));
   JitEvent(name, code);
Index: src/x64/ic-x64.cc
diff --git a/src/x64/ic-x64.cc b/src/x64/ic-x64.cc
index 06105f30ae860053d8612063dcf8c9fb945a9973..d2340c83c45b7cf1b4c1fef2b9bc5194ea53d189 100644
--- a/src/x64/ic-x64.cc
+++ b/src/x64/ic-x64.cc
@@ -973,8 +973,7 @@ void KeyedStoreIC::GenerateNonStrictArguments(MacroAssembler* masm) {
 }


-void LoadIC::GenerateMegamorphic(MacroAssembler* masm,
-                                 ExtraICState extra_state) {
+void LoadIC::GenerateMegamorphic(MacroAssembler* masm) {
   // ----------- S t a t e -------------
   //  -- rax    : receiver
   //  -- rcx    : name
@@ -982,7 +981,7 @@ void LoadIC::GenerateMegamorphic(MacroAssembler* masm,
   // -----------------------------------

   // 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, flags, rax, rcx, rbx, rdx);

@@ -1089,8 +1088,7 @@ void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
 }


-void StoreIC::GenerateMegamorphic(MacroAssembler* masm,
-                                  ExtraICState extra_state) {
+void StoreIC::GenerateMegamorphic(MacroAssembler* masm) {
   // ----------- S t a t e -------------
   //  -- rax    : value
   //  -- rcx    : name
@@ -1099,7 +1097,7 @@ void StoreIC::GenerateMegamorphic(MacroAssembler* masm,
   // -----------------------------------

   // 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, flags, rdx, rcx, rbx, no_reg);



--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to