Do not cache CodeStubInterfaceDescriptor on the isolate.
authoryangguo@chromium.org <yangguo@chromium.org>
Fri, 5 Sep 2014 15:20:45 +0000 (15:20 +0000)
committeryangguo@chromium.org <yangguo@chromium.org>
Fri, 5 Sep 2014 15:20:45 +0000 (15:20 +0000)
R=mvstanton@chromium.org

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

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23744 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

19 files changed:
src/arm/code-stubs-arm.cc
src/arm/lithium-arm.cc
src/arm64/code-stubs-arm64.cc
src/code-stubs-hydrogen.cc
src/code-stubs.cc
src/code-stubs.h
src/compiler/js-generic-lowering.cc
src/compiler/linkage.cc
src/compiler/raw-machine-assembler.cc
src/compiler/simplified-lowering.cc
src/deoptimizer.cc
src/hydrogen.cc
src/ia32/code-stubs-ia32.cc
src/ia32/lithium-ia32.cc
src/isolate.cc
src/isolate.h
src/mips/code-stubs-mips.cc
src/x64/code-stubs-x64.cc
src/x64/lithium-x64.cc

index 1bc9b2b..69d6752 100644 (file)
@@ -122,19 +122,19 @@ void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) {
   // Update the static counter each time a new code stub is generated.
   isolate()->counters()->code_stubs()->Increment();
 
-  CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor();
-  int param_count = descriptor->GetEnvironmentParameterCount();
+  CodeStubInterfaceDescriptor descriptor;
+  InitializeInterfaceDescriptor(&descriptor);
+  int param_count = descriptor.GetEnvironmentParameterCount();
   {
     // Call the runtime system in a fresh internal frame.
     FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
     DCHECK(param_count == 0 ||
-           r0.is(descriptor->GetEnvironmentParameterRegister(
-               param_count - 1)));
+           r0.is(descriptor.GetEnvironmentParameterRegister(param_count - 1)));
     // Push arguments
     for (int i = 0; i < param_count; ++i) {
-      __ push(descriptor->GetEnvironmentParameterRegister(i));
+      __ push(descriptor.GetEnvironmentParameterRegister(i));
     }
-    ExternalReference miss = descriptor->miss_handler();
+    ExternalReference miss = descriptor.miss_handler();
     __ CallExternalReference(miss, param_count);
   }
 
index 2a5bf28..17bfebc 100644 (file)
@@ -2443,10 +2443,10 @@ LInstruction* LChunkBuilder::DoParameter(HParameter* instr) {
     return DefineAsSpilled(result, spill_index);
   } else {
     DCHECK(info()->IsStub());
-    CodeStubInterfaceDescriptor* descriptor =
-        info()->code_stub()->GetInterfaceDescriptor();
+    CodeStubInterfaceDescriptor descriptor;
+    info()->code_stub()->InitializeInterfaceDescriptor(&descriptor);
     int index = static_cast<int>(instr->index());
-    Register reg = descriptor->GetEnvironmentParameterRegister(index);
+    Register reg = descriptor.GetEnvironmentParameterRegister(index);
     return DefineFixed(result, reg);
   }
 }
index 88a40ee..dfafad9 100644 (file)
@@ -111,22 +111,23 @@ void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) {
   // Update the static counter each time a new code stub is generated.
   isolate()->counters()->code_stubs()->Increment();
 
-  CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor();
-  int param_count = descriptor->GetEnvironmentParameterCount();
+  CodeStubInterfaceDescriptor descriptor;
+  InitializeInterfaceDescriptor(&descriptor);
+  int param_count = descriptor.GetEnvironmentParameterCount();
   {
     // Call the runtime system in a fresh internal frame.
     FrameScope scope(masm, StackFrame::INTERNAL);
     DCHECK((param_count == 0) ||
-           x0.Is(descriptor->GetEnvironmentParameterRegister(param_count - 1)));
+           x0.Is(descriptor.GetEnvironmentParameterRegister(param_count - 1)));
 
     // Push arguments
     MacroAssembler::PushPopQueue queue(masm);
     for (int i = 0; i < param_count; ++i) {
-      queue.Queue(descriptor->GetEnvironmentParameterRegister(i));
+      queue.Queue(descriptor.GetEnvironmentParameterRegister(i));
     }
     queue.PushQueued();
 
-    ExternalReference miss = descriptor->miss_handler();
+    ExternalReference miss = descriptor.miss_handler();
     __ CallExternalReference(miss, param_count);
   }
 
index 22fabbe..f2b04f7 100644 (file)
@@ -38,8 +38,8 @@ class CodeStubGraphBuilderBase : public HGraphBuilder {
         arguments_length_(NULL),
         info_(stub, isolate),
         context_(NULL) {
-    descriptor_ = stub->GetInterfaceDescriptor();
-    int parameter_count = descriptor_->GetEnvironmentParameterCount();
+    stub->InitializeInterfaceDescriptor(&descriptor_);
+    int parameter_count = descriptor_.GetEnvironmentParameterCount();
     parameters_.Reset(new HParameter*[parameter_count]);
   }
   virtual bool BuildGraph();
@@ -47,7 +47,7 @@ class CodeStubGraphBuilderBase : public HGraphBuilder {
  protected:
   virtual HValue* BuildCodeStub() = 0;
   HParameter* GetParameter(int parameter) {
-    DCHECK(parameter < descriptor_->GetEnvironmentParameterCount());
+    DCHECK(parameter < descriptor_.GetEnvironmentParameterCount());
     return parameters_[parameter];
   }
   HValue* GetArgumentsLength() {
@@ -103,7 +103,7 @@ class CodeStubGraphBuilderBase : public HGraphBuilder {
   SmartArrayPointer<HParameter*> parameters_;
   HValue* arguments_length_;
   CompilationInfoWithZone info_;
-  CodeStubInterfaceDescriptor* descriptor_;
+  CodeStubInterfaceDescriptor descriptor_;
   HContext* context_;
 };
 
@@ -119,22 +119,22 @@ bool CodeStubGraphBuilderBase::BuildGraph() {
     isolate()->GetHTracer()->TraceCompilation(&info_);
   }
 
-  int param_count = descriptor_->GetEnvironmentParameterCount();
+  int param_count = descriptor_.GetEnvironmentParameterCount();
   HEnvironment* start_environment = graph()->start_environment();
   HBasicBlock* next_block = CreateBasicBlock(start_environment);
   Goto(next_block);
   next_block->SetJoinId(BailoutId::StubEntry());
   set_current_block(next_block);
 
-  bool runtime_stack_params = descriptor_->stack_parameter_count().is_valid();
+  bool runtime_stack_params = descriptor_.stack_parameter_count().is_valid();
   HInstruction* stack_parameter_count = NULL;
   for (int i = 0; i < param_count; ++i) {
-    Representation r = descriptor_->GetEnvironmentParameterRepresentation(i);
+    Representation r = descriptor_.GetEnvironmentParameterRepresentation(i);
     HParameter* param = Add<HParameter>(i,
                                         HParameter::REGISTER_PARAMETER, r);
     start_environment->Bind(i, param);
     parameters_[i] = param;
-    if (descriptor_->IsEnvironmentParameterCountRegister(i)) {
+    if (descriptor_.IsEnvironmentParameterCountRegister(i)) {
       param->set_type(HType::Smi());
       stack_parameter_count = param;
       arguments_length_ = stack_parameter_count;
@@ -159,16 +159,16 @@ bool CodeStubGraphBuilderBase::BuildGraph() {
   // We might have extra expressions to pop from the stack in addition to the
   // arguments above.
   HInstruction* stack_pop_count = stack_parameter_count;
-  if (descriptor_->function_mode() == JS_FUNCTION_STUB_MODE) {
+  if (descriptor_.function_mode() == JS_FUNCTION_STUB_MODE) {
     if (!stack_parameter_count->IsConstant() &&
-        descriptor_->hint_stack_parameter_count() < 0) {
+        descriptor_.hint_stack_parameter_count() < 0) {
       HInstruction* constant_one = graph()->GetConstant1();
       stack_pop_count = AddUncasted<HAdd>(stack_parameter_count, constant_one);
       stack_pop_count->ClearFlag(HValue::kCanOverflow);
       // TODO(mvstanton): verify that stack_parameter_count+1 really fits in a
       // smi.
     } else {
-      int count = descriptor_->hint_stack_parameter_count();
+      int count = descriptor_.hint_stack_parameter_count();
       stack_pop_count = Add<HConstant>(count);
     }
   }
@@ -251,18 +251,14 @@ Handle<Code> HydrogenCodeStub::GenerateLightweightMissCode() {
 template <class Stub>
 static Handle<Code> DoGenerateCode(Stub* stub) {
   Isolate* isolate = stub->isolate();
-  CodeStub::Major major_key = static_cast<CodeStub*>(stub)->MajorKey();
-  CodeStubInterfaceDescriptor* descriptor =
-      isolate->code_stub_interface_descriptor(major_key);
-  if (!descriptor->IsInitialized()) {
-    stub->InitializeInterfaceDescriptor(descriptor);
-  }
+  CodeStubInterfaceDescriptor descriptor;
+  stub->InitializeInterfaceDescriptor(&descriptor);
 
   // If we are uninitialized we can use a light-weight stub to enter
   // the runtime that is significantly faster than using the standard
   // stub-failure deopt mechanism.
-  if (stub->IsUninitialized() && descriptor->has_miss_handler()) {
-    DCHECK(!descriptor->stack_parameter_count().is_valid());
+  if (stub->IsUninitialized() && descriptor.has_miss_handler()) {
+    DCHECK(!descriptor.stack_parameter_count().is_valid());
     return stub->GenerateLightweightMissCode();
   }
   base::ElapsedTimer timer;
index 09d2e3d..d831c61 100644 (file)
@@ -177,15 +177,13 @@ const char* CodeStub::MajorName(CodeStub::Major major_key,
 #define DEF_CASE(name) case name: return #name "Stub";
     CODE_STUB_LIST(DEF_CASE)
 #undef DEF_CASE
-    case UninitializedMajorKey: return "<UninitializedMajorKey>Stub";
     case NoCache:
       return "<NoCache>Stub";
-    default:
-      if (!allow_unknown_keys) {
-        UNREACHABLE();
-      }
+    case NUMBER_OF_IDS:
+      UNREACHABLE();
       return NULL;
   }
+  return NULL;
 }
 
 
@@ -200,6 +198,42 @@ void CodeStub::PrintName(OStream& os) const {  // NOLINT
 }
 
 
+void CodeStub::Dispatch(Isolate* isolate, uint32_t key, void** value_out,
+                        DispatchedCall call) {
+  switch (MajorKeyFromKey(key)) {
+#define DEF_CASE(NAME)             \
+  case NAME: {                     \
+    NAME##Stub stub(key, isolate); \
+    CodeStub* pstub = &stub;       \
+    call(pstub, value_out);        \
+    break;                         \
+  }
+    CODE_STUB_LIST(DEF_CASE)
+#undef DEF_CASE
+    case NUMBER_OF_IDS:
+      UNREACHABLE();
+    case NoCache:
+      *value_out = NULL;
+      break;
+  }
+}
+
+
+static void GetInterfaceDescriptorDispatchedCall(CodeStub* stub,
+                                                 void** value_out) {
+  CodeStubInterfaceDescriptor* descriptor_out =
+      reinterpret_cast<CodeStubInterfaceDescriptor*>(value_out);
+  stub->InitializeInterfaceDescriptor(descriptor_out);
+}
+
+
+void CodeStub::InitializeInterfaceDescriptor(
+    Isolate* isolate, uint32_t key, CodeStubInterfaceDescriptor* desc) {
+  void** value_out = reinterpret_cast<void**>(desc);
+  Dispatch(isolate, key, value_out, &GetInterfaceDescriptorDispatchedCall);
+}
+
+
 // static
 void BinaryOpICStub::GenerateAheadOfTime(Isolate* isolate) {
   // Generate the uninitialized versions of the stub.
@@ -928,102 +962,6 @@ void ProfileEntryHookStub::EntryHookTrampoline(intptr_t function,
 }
 
 
-static void InstallDescriptor(Isolate* isolate, HydrogenCodeStub* stub) {
-  int major_key = stub->MajorKey();
-  CodeStubInterfaceDescriptor* descriptor =
-      isolate->code_stub_interface_descriptor(major_key);
-  if (!descriptor->IsInitialized()) {
-    stub->InitializeInterfaceDescriptor(descriptor);
-  }
-}
-
-
-void ArrayConstructorStubBase::InstallDescriptors(Isolate* isolate) {
-  ArrayNoArgumentConstructorStub stub1(isolate, GetInitialFastElementsKind());
-  InstallDescriptor(isolate, &stub1);
-  ArraySingleArgumentConstructorStub stub2(isolate,
-                                           GetInitialFastElementsKind());
-  InstallDescriptor(isolate, &stub2);
-  ArrayNArgumentsConstructorStub stub3(isolate, GetInitialFastElementsKind());
-  InstallDescriptor(isolate, &stub3);
-}
-
-
-void NumberToStringStub::InstallDescriptors(Isolate* isolate) {
-  NumberToStringStub stub(isolate);
-  InstallDescriptor(isolate, &stub);
-}
-
-
-void FastNewClosureStub::InstallDescriptors(Isolate* isolate) {
-  FastNewClosureStub stub(isolate, STRICT, false);
-  InstallDescriptor(isolate, &stub);
-}
-
-
-void FastNewContextStub::InstallDescriptors(Isolate* isolate) {
-  FastNewContextStub stub(isolate, FastNewContextStub::kMaximumSlots);
-  InstallDescriptor(isolate, &stub);
-}
-
-
-// static
-void FastCloneShallowArrayStub::InstallDescriptors(Isolate* isolate) {
-  FastCloneShallowArrayStub stub(isolate, DONT_TRACK_ALLOCATION_SITE);
-  InstallDescriptor(isolate, &stub);
-}
-
-
-// static
-void BinaryOpICStub::InstallDescriptors(Isolate* isolate) {
-  BinaryOpICStub stub(isolate, Token::ADD, NO_OVERWRITE);
-  InstallDescriptor(isolate, &stub);
-}
-
-
-// static
-void BinaryOpWithAllocationSiteStub::InstallDescriptors(Isolate* isolate) {
-  BinaryOpWithAllocationSiteStub stub(isolate, Token::ADD, NO_OVERWRITE);
-  InstallDescriptor(isolate, &stub);
-}
-
-
-// static
-void StringAddStub::InstallDescriptors(Isolate* isolate) {
-  StringAddStub stub(isolate, STRING_ADD_CHECK_NONE, NOT_TENURED);
-  InstallDescriptor(isolate, &stub);
-}
-
-
-// static
-void RegExpConstructResultStub::InstallDescriptors(Isolate* isolate) {
-  RegExpConstructResultStub stub(isolate);
-  InstallDescriptor(isolate, &stub);
-}
-
-
-// static
-void KeyedLoadGenericStub::InstallDescriptors(Isolate* isolate) {
-  KeyedLoadGenericStub stub(isolate);
-  InstallDescriptor(isolate, &stub);
-}
-
-
-// static
-void StoreFieldStub::InstallDescriptors(Isolate* isolate) {
-  StoreFieldStub stub(isolate, FieldIndex::ForInObjectOffset(0),
-                      Representation::None());
-  InstallDescriptor(isolate, &stub);
-}
-
-
-// static
-void LoadFastElementStub::InstallDescriptors(Isolate* isolate) {
-  LoadFastElementStub stub(isolate, true, FAST_ELEMENTS);
-  InstallDescriptor(isolate, &stub);
-}
-
-
 ArrayConstructorStub::ArrayConstructorStub(Isolate* isolate)
     : PlatformCodeStub(isolate) {
   minor_key_ = ArgumentCountBits::encode(ANY);
@@ -1047,15 +985,6 @@ ArrayConstructorStub::ArrayConstructorStub(Isolate* isolate,
 }
 
 
-void InternalArrayConstructorStubBase::InstallDescriptors(Isolate* isolate) {
-  InternalArrayNoArgumentConstructorStub stub1(isolate, FAST_ELEMENTS);
-  InstallDescriptor(isolate, &stub1);
-  InternalArraySingleArgumentConstructorStub stub2(isolate, FAST_ELEMENTS);
-  InstallDescriptor(isolate, &stub2);
-  InternalArrayNArgumentsConstructorStub stub3(isolate, FAST_ELEMENTS);
-  InstallDescriptor(isolate, &stub3);
-}
-
 InternalArrayConstructorStub::InternalArrayConstructorStub(
     Isolate* isolate) : PlatformCodeStub(isolate) {
   InternalArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate);
index 4cdc3c4..8683837 100644 (file)
@@ -133,7 +133,6 @@ namespace internal {
 class CodeStub BASE_EMBEDDED {
  public:
   enum Major {
-    UninitializedMajorKey = 0,
 #define DEF_ENUM(name) name,
     CODE_STUB_LIST(DEF_ENUM)
 #undef DEF_ENUM
@@ -180,6 +179,12 @@ class CodeStub BASE_EMBEDDED {
   // Lookup the code in the (possibly custom) cache.
   bool FindCodeInCache(Code** code_out);
 
+  virtual void InitializeInterfaceDescriptor(
+      CodeStubInterfaceDescriptor* descriptor) {}
+
+  static void InitializeInterfaceDescriptor(Isolate* isolate, uint32_t key,
+                                            CodeStubInterfaceDescriptor* desc);
+
   // Returns information for computing the number key.
   virtual Major MajorKey() const = 0;
   uint32_t MinorKey() const { return minor_key_; }
@@ -248,6 +253,12 @@ class CodeStub BASE_EMBEDDED {
   // If a stub uses a special cache override this.
   virtual bool UseSpecialCache() { return false; }
 
+  // We use this dispatch to statically instantiate the correct code stub for
+  // the given stub key and call the passed function with that code stub.
+  typedef void (*DispatchedCall)(CodeStub* stub, void** value_out);
+  static void Dispatch(Isolate* isolate, uint32_t key, void** value_out,
+                       DispatchedCall call);
+
   STATIC_ASSERT(NUMBER_OF_IDS < (1 << kStubMajorKeyBits));
   class MajorKeyBits: public BitField<uint32_t, 0, kStubMajorKeyBits> {};
   class MinorKeyBits: public BitField<uint32_t,
@@ -426,19 +437,12 @@ class HydrogenCodeStub : public CodeStub {
 
   virtual Code::Kind GetCodeKind() const { return Code::STUB; }
 
-  CodeStubInterfaceDescriptor* GetInterfaceDescriptor() {
-    return isolate()->code_stub_interface_descriptor(MajorKey());
-  }
-
   template<class SubClass>
   static Handle<Code> GetUninitialized(Isolate* isolate) {
     SubClass::GenerateAheadOfTime(isolate);
     return SubClass().GetCode(isolate);
   }
 
-  virtual void InitializeInterfaceDescriptor(
-      CodeStubInterfaceDescriptor* descriptor) = 0;
-
   // Retrieve the code for the stub. Generate the code if needed.
   virtual Handle<Code> GenerateCode() = 0;
 
@@ -542,12 +546,6 @@ class ToNumberStub: public HydrogenCodeStub {
  public:
   explicit ToNumberStub(Isolate* isolate) : HydrogenCodeStub(isolate) { }
 
-  static void InstallDescriptors(Isolate* isolate) {
-    ToNumberStub stub(isolate);
-    stub.InitializeInterfaceDescriptor(
-        isolate->code_stub_interface_descriptor(CodeStub::ToNumber));
-  }
-
   DEFINE_HYDROGEN_CODE_STUB(ToNumber, HydrogenCodeStub);
 };
 
@@ -556,8 +554,6 @@ class NumberToStringStub FINAL : public HydrogenCodeStub {
  public:
   explicit NumberToStringStub(Isolate* isolate) : HydrogenCodeStub(isolate) {}
 
-  static void InstallDescriptors(Isolate* isolate);
-
   // Parameters accessed via CodeStubGraphBuilder::GetParameter()
   static const int kNumber = 0;
 
@@ -574,8 +570,6 @@ class FastNewClosureStub : public HydrogenCodeStub {
                       IsGeneratorBits::encode(is_generator));
   }
 
-  static void InstallDescriptors(Isolate* isolate);
-
   StrictMode strict_mode() const {
     return StrictModeBits::decode(sub_minor_key());
   }
@@ -599,8 +593,6 @@ class FastNewContextStub FINAL : public HydrogenCodeStub {
     set_sub_minor_key(SlotsBits::encode(slots));
   }
 
-  static void InstallDescriptors(Isolate* isolate);
-
   int slots() const { return SlotsBits::decode(sub_minor_key()); }
 
   // Parameters accessed via CodeStubGraphBuilder::GetParameter()
@@ -625,8 +617,6 @@ class FastCloneShallowArrayStub : public HydrogenCodeStub {
     return AllocationSiteModeBits::decode(sub_minor_key());
   }
 
-  static void InstallDescriptors(Isolate* isolate);
-
  private:
   class AllocationSiteModeBits: public BitField<AllocationSiteMode, 0, 1> {};
 
@@ -931,8 +921,6 @@ class StoreFieldStub : public HandlerStub {
     return PropertyDetails::DecodeRepresentation(repr);
   }
 
-  static void InstallDescriptors(Isolate* isolate);
-
  protected:
   virtual Code::Kind kind() const { return Code::STORE_IC; }
   virtual Code::StubType GetStubType() { return Code::FAST; }
@@ -1052,8 +1040,6 @@ class BinaryOpICStub : public HydrogenCodeStub {
 
   static void GenerateAheadOfTime(Isolate* isolate);
 
-  static void InstallDescriptors(Isolate* isolate);
-
   virtual Code::Kind GetCodeKind() const OVERRIDE {
     return Code::BINARY_OP_IC;
   }
@@ -1139,8 +1125,6 @@ class BinaryOpWithAllocationSiteStub FINAL : public BinaryOpICStub {
                                  const BinaryOpIC::State& state)
       : BinaryOpICStub(isolate, state) {}
 
-  static void InstallDescriptors(Isolate* isolate);
-
   virtual Code::Kind GetCodeKind() const FINAL OVERRIDE {
     return Code::STUB;
   }
@@ -1183,8 +1167,6 @@ class StringAddStub FINAL : public HydrogenCodeStub {
     return PretenureFlagBits::decode(sub_minor_key());
   }
 
-  static void InstallDescriptors(Isolate* isolate);
-
   // Parameters accessed via CodeStubGraphBuilder::GetParameter()
   static const int kLeft = 0;
   static const int kRight = 1;
@@ -1272,12 +1254,6 @@ class CompareNilICStub : public HydrogenCodeStub  {
     return CompareNilICStub(isolate, nil, UNINITIALIZED).GetCode();
   }
 
-  static void InstallDescriptors(Isolate* isolate) {
-    CompareNilICStub compare_stub(isolate, kNullValue, UNINITIALIZED);
-    compare_stub.InitializeInterfaceDescriptor(
-        isolate->code_stub_interface_descriptor(CodeStub::CompareNilIC));
-  }
-
   virtual InlineCacheState GetICState() const {
     State state = this->state();
     if (state.Contains(GENERIC)) {
@@ -1450,8 +1426,6 @@ class RegExpConstructResultStub FINAL : public HydrogenCodeStub {
   explicit RegExpConstructResultStub(Isolate* isolate)
       : HydrogenCodeStub(isolate) { }
 
-  static void InstallDescriptors(Isolate* isolate);
-
   // Parameters accessed via CodeStubGraphBuilder::GetParameter()
   static const int kLength = 0;
   static const int kIndex = 1;
@@ -1713,8 +1687,6 @@ class KeyedLoadGenericStub : public HydrogenCodeStub {
  public:
   explicit KeyedLoadGenericStub(Isolate* isolate) : HydrogenCodeStub(isolate) {}
 
-  static void InstallDescriptors(Isolate* isolate);
-
   virtual Code::Kind GetCodeKind() const { return Code::KEYED_LOAD_IC; }
   virtual InlineCacheState GetICState() const { return GENERIC; }
 
@@ -1768,8 +1740,6 @@ class VectorLoadStub : public HydrogenCodeStub {
     set_sub_minor_key(state.GetExtraICState());
   }
 
-  static void InstallDescriptors(Isolate* isolate);
-
   virtual Code::Kind GetCodeKind() const OVERRIDE { return Code::LOAD_IC; }
 
   virtual InlineCacheState GetICState() const FINAL OVERRIDE {
@@ -1792,8 +1762,6 @@ class VectorKeyedLoadStub : public VectorLoadStub {
   explicit VectorKeyedLoadStub(Isolate* isolate)
       : VectorLoadStub(isolate, LoadIC::State(0)) {}
 
-  static void InstallDescriptors(Isolate* isolate);
-
   virtual Code::Kind GetCodeKind() const OVERRIDE {
     return Code::KEYED_LOAD_IC;
   }
@@ -1863,8 +1831,6 @@ class LoadFastElementStub : public HydrogenCodeStub {
     return ElementsKindBits::decode(sub_minor_key());
   }
 
-  static void InstallDescriptors(Isolate* isolate);
-
  private:
   class ElementsKindBits: public BitField<ElementsKind, 0, 8> {};
   class IsJSArrayBits: public BitField<bool, 8, 1> {};
@@ -1954,7 +1920,6 @@ class ArrayConstructorStubBase : public HydrogenCodeStub {
   }
 
   static void GenerateStubsAheadOfTime(Isolate* isolate);
-  static void InstallDescriptors(Isolate* isolate);
 
   // Parameters accessed via CodeStubGraphBuilder::GetParameter()
   static const int kConstructor = 0;
@@ -2040,7 +2005,6 @@ class InternalArrayConstructorStubBase : public HydrogenCodeStub {
   }
 
   static void GenerateStubsAheadOfTime(Isolate* isolate);
-  static void InstallDescriptors(Isolate* isolate);
 
   // Parameters accessed via CodeStubGraphBuilder::GetParameter()
   static const int kConstructor = 0;
@@ -2168,12 +2132,6 @@ class ToBooleanStub: public HydrogenCodeStub {
 
   virtual bool SometimesSetsUpAFrame() { return false; }
 
-  static void InstallDescriptors(Isolate* isolate) {
-    ToBooleanStub stub(isolate, RESULT_AS_SMI);
-    stub.InitializeInterfaceDescriptor(
-        isolate->code_stub_interface_descriptor(CodeStub::ToBoolean));
-  }
-
   static Handle<Code> GetUninitialized(Isolate* isolate) {
     return ToBooleanStub(isolate, UNINITIALIZED).GetCode();
   }
index 06b9b3d..dbda563 100644 (file)
@@ -16,28 +16,13 @@ namespace internal {
 namespace compiler {
 
 
-// TODO(mstarzinger): This is a temporary workaround for non-hydrogen stubs for
-// which we don't have an interface descriptor yet. Use ReplaceWithStubCall
-// once these stub have been made into a HydrogenCodeStub.
-template <typename T>
-static CodeStubInterfaceDescriptor* GetInterfaceDescriptor(Isolate* isolate,
-                                                           T* stub) {
-  CodeStub::Major key = static_cast<CodeStub*>(stub)->MajorKey();
-  CodeStubInterfaceDescriptor* d = isolate->code_stub_interface_descriptor(key);
-  stub->InitializeInterfaceDescriptor(d);
-  return d;
-}
-
-
 // TODO(mstarzinger): This is a temporary shim to be able to call an IC stub
 // which doesn't have an interface descriptor yet. It mimics a hydrogen code
 // stub for the underlying IC stub code.
 class LoadICStubShim : public HydrogenCodeStub {
  public:
   LoadICStubShim(Isolate* isolate, ContextualMode contextual_mode)
-      : HydrogenCodeStub(isolate), contextual_mode_(contextual_mode) {
-    i::compiler::GetInterfaceDescriptor(isolate, this);
-  }
+      : HydrogenCodeStub(isolate), contextual_mode_(contextual_mode) {}
 
   virtual Handle<Code> GenerateCode() OVERRIDE {
     ExtraICState extra_state = LoadIC::ComputeExtraICState(contextual_mode_);
@@ -63,9 +48,7 @@ class LoadICStubShim : public HydrogenCodeStub {
 // stub for the underlying IC stub code.
 class KeyedLoadICStubShim : public HydrogenCodeStub {
  public:
-  explicit KeyedLoadICStubShim(Isolate* isolate) : HydrogenCodeStub(isolate) {
-    i::compiler::GetInterfaceDescriptor(isolate, this);
-  }
+  explicit KeyedLoadICStubShim(Isolate* isolate) : HydrogenCodeStub(isolate) {}
 
   virtual Handle<Code> GenerateCode() OVERRIDE {
     return isolate()->builtins()->KeyedLoadIC_Initialize();
@@ -89,9 +72,7 @@ class KeyedLoadICStubShim : public HydrogenCodeStub {
 class StoreICStubShim : public HydrogenCodeStub {
  public:
   StoreICStubShim(Isolate* isolate, StrictMode strict_mode)
-      : HydrogenCodeStub(isolate), strict_mode_(strict_mode) {
-    i::compiler::GetInterfaceDescriptor(isolate, this);
-  }
+      : HydrogenCodeStub(isolate), strict_mode_(strict_mode) {}
 
   virtual Handle<Code> GenerateCode() OVERRIDE {
     return StoreIC::initialize_stub(isolate(), strict_mode_);
@@ -117,9 +98,7 @@ class StoreICStubShim : public HydrogenCodeStub {
 class KeyedStoreICStubShim : public HydrogenCodeStub {
  public:
   KeyedStoreICStubShim(Isolate* isolate, StrictMode strict_mode)
-      : HydrogenCodeStub(isolate), strict_mode_(strict_mode) {
-    i::compiler::GetInterfaceDescriptor(isolate, this);
-  }
+      : HydrogenCodeStub(isolate), strict_mode_(strict_mode) {}
 
   virtual Handle<Code> GenerateCode() OVERRIDE {
     return strict_mode_ == SLOPPY
@@ -290,10 +269,11 @@ static CallDescriptor::Flags FlagsForNode(Node* node) {
 void JSGenericLowering::ReplaceWithCompareIC(Node* node, Token::Value token,
                                              bool pure) {
   BinaryOpICStub stub(isolate(), Token::ADD);  // TODO(mstarzinger): Hack.
-  CodeStubInterfaceDescriptor* d = stub.GetInterfaceDescriptor();
+  CodeStubInterfaceDescriptor d;
+  stub.InitializeInterfaceDescriptor(&d);
   bool has_frame_state = OperatorProperties::HasFrameStateInput(node->op());
   CallDescriptor* desc_compare = linkage()->GetStubCallDescriptor(
-      d, 0, CallDescriptor::kPatchableCallSiteWithNop | FlagsForNode(node));
+      &d, 0, CallDescriptor::kPatchableCallSiteWithNop | FlagsForNode(node));
   Handle<Code> ic = CompareIC::GetUninitialized(isolate(), token);
   NodeVector inputs(zone());
   inputs.reserve(node->InputCount() + 1);
@@ -340,9 +320,10 @@ void JSGenericLowering::ReplaceWithCompareIC(Node* node, Token::Value token,
 
 void JSGenericLowering::ReplaceWithStubCall(Node* node, HydrogenCodeStub* stub,
                                             CallDescriptor::Flags flags) {
-  CodeStubInterfaceDescriptor* d = stub->GetInterfaceDescriptor();
+  CodeStubInterfaceDescriptor d;
+  stub->InitializeInterfaceDescriptor(&d);
   CallDescriptor* desc =
-      linkage()->GetStubCallDescriptor(d, 0, flags | FlagsForNode(node));
+      linkage()->GetStubCallDescriptor(&d, 0, flags | FlagsForNode(node));
   Node* stub_code = CodeConstant(stub->GetCode());
   PatchInsertInput(node, 0, stub_code);
   PatchOperator(node, common()->Call(desc));
@@ -353,8 +334,9 @@ void JSGenericLowering::ReplaceWithBuiltinCall(Node* node,
                                                Builtins::JavaScript id,
                                                int nargs) {
   CallFunctionStub stub(isolate(), nargs - 1, NO_CALL_FUNCTION_FLAGS);
-  CodeStubInterfaceDescriptor* d = GetInterfaceDescriptor(isolate(), &stub);
-  CallDescriptor* desc = linkage()->GetStubCallDescriptor(d, nargs);
+  CodeStubInterfaceDescriptor d;
+  stub.InitializeInterfaceDescriptor(&d);
+  CallDescriptor* desc = linkage()->GetStubCallDescriptor(&d, nargs);
   // TODO(mstarzinger): Accessing the builtins object this way prevents sharing
   // of code across native contexts. Fix this by loading from given context.
   Handle<JSFunction> function(
@@ -478,8 +460,9 @@ Node* JSGenericLowering::LowerJSInstanceOf(Node* node) {
       InstanceofStub::kReturnTrueFalseObject |
       InstanceofStub::kArgsInRegisters);
   InstanceofStub stub(isolate(), flags);
-  CodeStubInterfaceDescriptor* d = GetInterfaceDescriptor(isolate(), &stub);
-  CallDescriptor* desc = linkage()->GetStubCallDescriptor(d, 0);
+  CodeStubInterfaceDescriptor d;
+  stub.InitializeInterfaceDescriptor(&d);
+  CallDescriptor* desc = linkage()->GetStubCallDescriptor(&d, 0);
   Node* stub_code = CodeConstant(stub.GetCode());
   PatchInsertInput(node, 0, stub_code);
   PatchOperator(node, common()->Call(desc));
@@ -527,9 +510,10 @@ Node* JSGenericLowering::LowerJSStoreContext(Node* node) {
 Node* JSGenericLowering::LowerJSCallConstruct(Node* node) {
   int arity = OpParameter<int>(node);
   CallConstructStub stub(isolate(), NO_CALL_CONSTRUCTOR_FLAGS);
-  CodeStubInterfaceDescriptor* d = GetInterfaceDescriptor(isolate(), &stub);
+  CodeStubInterfaceDescriptor d;
+  stub.InitializeInterfaceDescriptor(&d);
   CallDescriptor* desc =
-      linkage()->GetStubCallDescriptor(d, arity, FlagsForNode(node));
+      linkage()->GetStubCallDescriptor(&d, arity, FlagsForNode(node));
   Node* stub_code = CodeConstant(stub.GetCode());
   Node* construct = NodeProperties::GetValueInput(node, 0);
   PatchInsertInput(node, 0, stub_code);
@@ -544,9 +528,10 @@ Node* JSGenericLowering::LowerJSCallConstruct(Node* node) {
 Node* JSGenericLowering::LowerJSCallFunction(Node* node) {
   CallParameters p = OpParameter<CallParameters>(node);
   CallFunctionStub stub(isolate(), p.arity - 2, p.flags);
-  CodeStubInterfaceDescriptor* d = GetInterfaceDescriptor(isolate(), &stub);
+  CodeStubInterfaceDescriptor d;
+  stub.InitializeInterfaceDescriptor(&d);
   CallDescriptor* desc =
-      linkage()->GetStubCallDescriptor(d, p.arity - 1, FlagsForNode(node));
+      linkage()->GetStubCallDescriptor(&d, p.arity - 1, FlagsForNode(node));
   Node* stub_code = CodeConstant(stub.GetCode());
   PatchInsertInput(node, 0, stub_code);
   PatchOperator(node, common()->Call(desc));
index 9fac9c3..e6e53b1 100644 (file)
@@ -52,9 +52,9 @@ Linkage::Linkage(CompilationInfo* info) : info_(info) {
   } else if (info->code_stub() != NULL) {
     // Use the code stub interface descriptor.
     HydrogenCodeStub* stub = info->code_stub();
-    CodeStubInterfaceDescriptor* descriptor =
-        info_->isolate()->code_stub_interface_descriptor(stub->MajorKey());
-    incoming_ = GetStubCallDescriptor(descriptor);
+    CodeStubInterfaceDescriptor descriptor;
+    stub->InitializeInterfaceDescriptor(&descriptor);
+    incoming_ = GetStubCallDescriptor(&descriptor);
   } else {
     incoming_ = NULL;  // TODO(titzer): ?
   }
index 329d8de..1af8339 100644 (file)
@@ -84,12 +84,11 @@ Node* RawMachineAssembler::CallFunctionStub0(Node* function, Node* receiver,
                                              Node* context, Node* frame_state,
                                              CallFunctionFlags flags) {
   CallFunctionStub stub(isolate(), 0, flags);
-  CodeStubInterfaceDescriptor* d = isolate()->code_stub_interface_descriptor(
-      reinterpret_cast<CodeStub*>(&stub)->MajorKey());
-  stub.InitializeInterfaceDescriptor(d);
+  CodeStubInterfaceDescriptor d;
+  stub.InitializeInterfaceDescriptor(&d);
 
   CallDescriptor* desc = Linkage::GetStubCallDescriptor(
-      d, 1, CallDescriptor::kNeedsFrameState, zone());
+      &d, 1, CallDescriptor::kNeedsFrameState, zone());
   Node* stub_code = HeapConstant(stub.GetCode());
   Node* call = graph()->NewNode(common()->Call(desc), stub_code, function,
                                 receiver, context, frame_state);
index a635f98..98cb0f3 100644 (file)
@@ -852,9 +852,10 @@ void SimplifiedLowering::DoStoreElement(Node* node) {
 
 void SimplifiedLowering::DoStringAdd(Node* node) {
   StringAddStub stub(zone()->isolate(), STRING_ADD_CHECK_NONE, NOT_TENURED);
-  CodeStubInterfaceDescriptor* d = stub.GetInterfaceDescriptor();
+  CodeStubInterfaceDescriptor d;
+  stub.InitializeInterfaceDescriptor(&d);
   CallDescriptor::Flags flags = CallDescriptor::kNoFlags;
-  CallDescriptor* desc = Linkage::GetStubCallDescriptor(d, 0, flags, zone());
+  CallDescriptor* desc = Linkage::GetStubCallDescriptor(&d, 0, flags, zone());
   node->set_op(common()->Call(desc));
   node->InsertInput(zone(), 0, jsgraph()->HeapConstant(stub.GetCode()));
   node->AppendInput(zone(), jsgraph()->UndefinedConstant());
index e874122..c590d66 100644 (file)
@@ -1622,17 +1622,18 @@ void Deoptimizer::DoComputeCompiledStubFrame(TranslationIterator* iterator,
 
   CHECK(compiled_code_->is_hydrogen_stub());
   int major_key = CodeStub::GetMajorKey(compiled_code_);
-  CodeStubInterfaceDescriptor* descriptor =
-      isolate_->code_stub_interface_descriptor(major_key);
+  CodeStubInterfaceDescriptor descriptor;
+  CodeStub::InitializeInterfaceDescriptor(isolate_, compiled_code_->stub_key(),
+                                          &descriptor);
   // Check that there is a matching descriptor to the major key.
   // This will fail if there has not been one installed to the isolate.
-  DCHECK_EQ(descriptor->MajorKey(), major_key);
+  DCHECK_EQ(descriptor.MajorKey(), major_key);
 
   // The output frame must have room for all pushed register parameters
   // and the standard stack frame slots.  Include space for an argument
   // object to the callee and optionally the space to pass the argument
   // object to the stub failure handler.
-  int param_count = descriptor->GetEnvironmentParameterCount();
+  int param_count = descriptor.GetEnvironmentParameterCount();
   CHECK_GE(param_count, 0);
 
   int height_in_bytes = kPointerSize * param_count + sizeof(Arguments) +
@@ -1730,7 +1731,7 @@ void Deoptimizer::DoComputeCompiledStubFrame(TranslationIterator* iterator,
   }
 
   intptr_t caller_arg_count = 0;
-  bool arg_count_known = !descriptor->stack_parameter_count().is_valid();
+  bool arg_count_known = !descriptor.stack_parameter_count().is_valid();
 
   // Build the Arguments object for the caller's parameters and a pointer to it.
   output_frame_offset -= kPointerSize;
@@ -1782,8 +1783,7 @@ void Deoptimizer::DoComputeCompiledStubFrame(TranslationIterator* iterator,
     output_frame_offset -= kPointerSize;
     DoTranslateCommand(iterator, 0, output_frame_offset);
 
-    if (!arg_count_known &&
-        descriptor->IsEnvironmentParameterCountRegister(i)) {
+    if (!arg_count_known && descriptor.IsEnvironmentParameterCountRegister(i)) {
       arguments_length_offset = output_frame_offset;
     }
   }
@@ -1822,11 +1822,11 @@ void Deoptimizer::DoComputeCompiledStubFrame(TranslationIterator* iterator,
   CopyDoubleRegisters(output_frame);
 
   // Fill registers containing handler and number of parameters.
-  SetPlatformCompiledStubRegisters(output_frame, descriptor);
+  SetPlatformCompiledStubRegisters(output_frame, &descriptor);
 
   // Compute this frame's PC, state, and continuation.
   Code* trampoline = NULL;
-  StubFunctionMode function_mode = descriptor->function_mode();
+  StubFunctionMode function_mode = descriptor.function_mode();
   StubFailureTrampolineStub(isolate_,
                             function_mode).FindCodeInCache(&trampoline);
   DCHECK(trampoline != NULL);
index 6be8d65..86f9d6b 100644 (file)
@@ -3435,9 +3435,10 @@ HGraph::HGraph(CompilationInfo* info)
       inlined_functions_(5, info->zone()) {
   if (info->IsStub()) {
     HydrogenCodeStub* stub = info->code_stub();
-    CodeStubInterfaceDescriptor* descriptor = stub->GetInterfaceDescriptor();
-    start_environment_ = new(zone_) HEnvironment(
-        zone_, descriptor->GetEnvironmentParameterCount());
+    CodeStubInterfaceDescriptor descriptor;
+    stub->InitializeInterfaceDescriptor(&descriptor);
+    start_environment_ = new (zone_)
+        HEnvironment(zone_, descriptor.GetEnvironmentParameterCount());
   } else {
     TraceInlinedFunction(info->shared_info(), HSourcePosition::Unknown());
     start_environment_ =
index 11065ec..4760669 100644 (file)
@@ -115,19 +115,19 @@ void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) {
   // Update the static counter each time a new code stub is generated.
   isolate()->counters()->code_stubs()->Increment();
 
-  CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor();
-  int param_count = descriptor->GetEnvironmentParameterCount();
+  CodeStubInterfaceDescriptor descriptor;
+  InitializeInterfaceDescriptor(&descriptor);
+  int param_count = descriptor.GetEnvironmentParameterCount();
   {
     // Call the runtime system in a fresh internal frame.
     FrameScope scope(masm, StackFrame::INTERNAL);
     DCHECK(param_count == 0 ||
-           eax.is(descriptor->GetEnvironmentParameterRegister(
-               param_count - 1)));
+           eax.is(descriptor.GetEnvironmentParameterRegister(param_count - 1)));
     // Push arguments
     for (int i = 0; i < param_count; ++i) {
-      __ push(descriptor->GetEnvironmentParameterRegister(i));
+      __ push(descriptor.GetEnvironmentParameterRegister(i));
     }
-    ExternalReference miss = descriptor->miss_handler();
+    ExternalReference miss = descriptor.miss_handler();
     __ CallExternalReference(miss, param_count);
   }
 
index b99a3b1..1764dd6 100644 (file)
@@ -2501,10 +2501,10 @@ LInstruction* LChunkBuilder::DoParameter(HParameter* instr) {
     return DefineAsSpilled(result, spill_index);
   } else {
     DCHECK(info()->IsStub());
-    CodeStubInterfaceDescriptor* descriptor =
-        info()->code_stub()->GetInterfaceDescriptor();
+    CodeStubInterfaceDescriptor descriptor;
+    info()->code_stub()->InitializeInterfaceDescriptor(&descriptor);
     int index = static_cast<int>(instr->index());
-    Register reg = descriptor->GetEnvironmentParameterRegister(index);
+    Register reg = descriptor.GetEnvironmentParameterRegister(index);
     return DefineFixed(result, reg);
   }
 }
index f4addcf..9702f0e 100644 (file)
@@ -1504,7 +1504,6 @@ Isolate::Isolate()
       string_tracker_(NULL),
       regexp_stack_(NULL),
       date_cache_(NULL),
-      code_stub_interface_descriptors_(NULL),
       call_descriptor_data_(NULL),
       // TODO(bmeurer) Initialized lazily because it depends on flags; can
       // be fixed once the default isolate cleanup is done.
@@ -1701,9 +1700,6 @@ Isolate::~Isolate() {
   delete date_cache_;
   date_cache_ = NULL;
 
-  delete[] code_stub_interface_descriptors_;
-  code_stub_interface_descriptors_ = NULL;
-
   delete[] call_descriptor_data_;
   call_descriptor_data_ = NULL;
 
@@ -1880,8 +1876,6 @@ bool Isolate::Init(Deserializer* des) {
   regexp_stack_ = new RegExpStack();
   regexp_stack_->isolate_ = this;
   date_cache_ = new DateCache();
-  code_stub_interface_descriptors_ =
-      new CodeStubInterfaceDescriptor[CodeStub::NUMBER_OF_IDS];
   call_descriptor_data_ =
       new CallInterfaceDescriptorData[CallDescriptors::NUMBER_OF_DESCRIPTORS];
   cpu_profiler_ = new CpuProfiler(this);
@@ -2034,24 +2028,6 @@ bool Isolate::Init(Deserializer* des) {
     CodeStub::GenerateFPStubs(this);
     StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime(this);
     StubFailureTrampolineStub::GenerateAheadOfTime(this);
-    // Ensure interface descriptors are initialized even when stubs have been
-    // deserialized out of the snapshot without using the graph builder.
-    FastCloneShallowArrayStub::InstallDescriptors(this);
-    BinaryOpICStub::InstallDescriptors(this);
-    BinaryOpWithAllocationSiteStub::InstallDescriptors(this);
-    CompareNilICStub::InstallDescriptors(this);
-    ToBooleanStub::InstallDescriptors(this);
-    ToNumberStub::InstallDescriptors(this);
-    ArrayConstructorStubBase::InstallDescriptors(this);
-    InternalArrayConstructorStubBase::InstallDescriptors(this);
-    FastNewClosureStub::InstallDescriptors(this);
-    FastNewContextStub::InstallDescriptors(this);
-    NumberToStringStub::InstallDescriptors(this);
-    StringAddStub::InstallDescriptors(this);
-    RegExpConstructResultStub::InstallDescriptors(this);
-    KeyedLoadGenericStub::InstallDescriptors(this);
-    StoreFieldStub::InstallDescriptors(this);
-    LoadFastElementStub::InstallDescriptors(this);
   }
 
   initialized_from_snapshot_ = (des != NULL);
@@ -2231,12 +2207,6 @@ bool Isolate::IsFastArrayConstructorPrototypeChainIntact() {
 }
 
 
-CodeStubInterfaceDescriptor*
-    Isolate::code_stub_interface_descriptor(int index) {
-  return code_stub_interface_descriptors_ + index;
-}
-
-
 CallInterfaceDescriptorData* Isolate::call_descriptor_data(int index) {
   DCHECK(0 <= index && index < CallDescriptors::NUMBER_OF_DESCRIPTORS);
   return &call_descriptor_data_[index];
index f3030a9..d2df773 100644 (file)
@@ -1034,9 +1034,6 @@ class Isolate {
 
   bool IsFastArrayConstructorPrototypeChainIntact();
 
-  CodeStubInterfaceDescriptor*
-      code_stub_interface_descriptor(int index);
-
   CallInterfaceDescriptorData* call_descriptor_data(int index);
 
   void IterateDeferredHandles(ObjectVisitor* visitor);
index 103693f..4f7bdcd 100644 (file)
@@ -122,7 +122,7 @@ void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) {
   // Update the static counter each time a new code stub is generated.
   isolate()->counters()->code_stubs()->Increment();
 
-  CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor();
+  CodeStubInterfaceDescriptor descriptor = GetInterfaceDescriptor();
   int param_count = descriptor->GetEnvironmentParameterCount();
   {
     // Call the runtime system in a fresh internal frame.
index bbe5b64..12e6638 100644 (file)
@@ -107,19 +107,19 @@ void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) {
   // Update the static counter each time a new code stub is generated.
   isolate()->counters()->code_stubs()->Increment();
 
-  CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor();
-  int param_count = descriptor->GetEnvironmentParameterCount();
+  CodeStubInterfaceDescriptor descriptor;
+  InitializeInterfaceDescriptor(&descriptor);
+  int param_count = descriptor.GetEnvironmentParameterCount();
   {
     // Call the runtime system in a fresh internal frame.
     FrameScope scope(masm, StackFrame::INTERNAL);
     DCHECK(param_count == 0 ||
-           rax.is(descriptor->GetEnvironmentParameterRegister(
-               param_count - 1)));
+           rax.is(descriptor.GetEnvironmentParameterRegister(param_count - 1)));
     // Push arguments
     for (int i = 0; i < param_count; ++i) {
-      __ Push(descriptor->GetEnvironmentParameterRegister(i));
+      __ Push(descriptor.GetEnvironmentParameterRegister(i));
     }
-    ExternalReference miss = descriptor->miss_handler();
+    ExternalReference miss = descriptor.miss_handler();
     __ CallExternalReference(miss, param_count);
   }
 
index 6b123e6..c343afd 100644 (file)
@@ -2481,10 +2481,10 @@ LInstruction* LChunkBuilder::DoParameter(HParameter* instr) {
     return DefineAsSpilled(result, spill_index);
   } else {
     DCHECK(info()->IsStub());
-    CodeStubInterfaceDescriptor* descriptor =
-        info()->code_stub()->GetInterfaceDescriptor();
+    CodeStubInterfaceDescriptor descriptor;
+    info()->code_stub()->InitializeInterfaceDescriptor(&descriptor);
     int index = static_cast<int>(instr->index());
-    Register reg = descriptor->GetEnvironmentParameterRegister(index);
+    Register reg = descriptor.GetEnvironmentParameterRegister(index);
     return DefineFixed(result, reg);
   }
 }