| Index: src/code-stubs.h | 
| diff --git a/src/code-stubs.h b/src/code-stubs.h | 
| index 0168683298db8dffd957d3d8b35fa4c6589d4ea0..450d0c12c29215c3b1af2c8f29037547a063e23c 100644 | 
| --- a/src/code-stubs.h | 
| +++ b/src/code-stubs.h | 
| @@ -370,6 +370,7 @@ | 
| public:                                                   \ | 
| inline Major MajorKey() const override { return NAME; }; \ | 
| \ | 
| + protected:                                                \ | 
| DEFINE_CODE_STUB_BASE(NAME##Stub, SUPER) | 
|  | 
|  | 
| @@ -385,27 +386,59 @@ | 
| Handle<Code> GenerateCode() override;                               \ | 
| DEFINE_CODE_STUB(NAME, SUPER) | 
|  | 
| -#define DEFINE_TURBOFAN_CODE_STUB(NAME, SUPER)                               \ | 
| - public:                                                                     \ | 
| -  void GenerateAssembly(compiler::CodeAssemblerState* state) const override; \ | 
| +#define DEFINE_TURBOFAN_CODE_STUB(NAME, SUPER)                        \ | 
| + public:                                                              \ | 
| +  void GenerateAssembly(CodeStubAssembler* assembler) const override; \ | 
| DEFINE_CODE_STUB(NAME, SUPER) | 
|  | 
| -#define DEFINE_TURBOFAN_BINARY_OP_CODE_STUB_WITH_FEEDBACK(NAME, SUPER)       \ | 
| - public:                                                                     \ | 
| -  static compiler::Node* Generate(                                           \ | 
| -      CodeStubAssembler* assembler, compiler::Node* left,                    \ | 
| -      compiler::Node* right, compiler::Node* slot_id,                        \ | 
| -      compiler::Node* type_feedback_vector, compiler::Node* context);        \ | 
| -  void GenerateAssembly(compiler::CodeAssemblerState* state) const override; \ | 
| +#define DEFINE_TURBOFAN_BINARY_OP_CODE_STUB(NAME, SUPER)                       \ | 
| + public:                                                                       \ | 
| +  static compiler::Node* Generate(CodeStubAssembler* assembler,                \ | 
| +                                  compiler::Node* left, compiler::Node* right, \ | 
| +                                  compiler::Node* context);                    \ | 
| +  void GenerateAssembly(CodeStubAssembler* assembler) const override {         \ | 
| +    assembler->Return(Generate(assembler, assembler->Parameter(0),             \ | 
| +                               assembler->Parameter(1),                        \ | 
| +                               assembler->Parameter(2)));                      \ | 
| +  }                                                                            \ | 
| DEFINE_CODE_STUB(NAME, SUPER) | 
|  | 
| -#define DEFINE_TURBOFAN_UNARY_OP_CODE_STUB_WITH_FEEDBACK(NAME, SUPER)        \ | 
| - public:                                                                     \ | 
| -  static compiler::Node* Generate(                                           \ | 
| -      CodeStubAssembler* assembler, compiler::Node* value,                   \ | 
| -      compiler::Node* context, compiler::Node* type_feedback_vector,         \ | 
| -      compiler::Node* slot_id);                                              \ | 
| -  void GenerateAssembly(compiler::CodeAssemblerState* state) const override; \ | 
| +#define DEFINE_TURBOFAN_BINARY_OP_CODE_STUB_WITH_FEEDBACK(NAME, SUPER)        \ | 
| + public:                                                                      \ | 
| +  static compiler::Node* Generate(                                            \ | 
| +      CodeStubAssembler* assembler, compiler::Node* left,                     \ | 
| +      compiler::Node* right, compiler::Node* slot_id,                         \ | 
| +      compiler::Node* type_feedback_vector, compiler::Node* context);         \ | 
| +  void GenerateAssembly(CodeStubAssembler* assembler) const override {        \ | 
| +    assembler->Return(                                                        \ | 
| +        Generate(assembler, assembler->Parameter(0), assembler->Parameter(1), \ | 
| +                 assembler->Parameter(2), assembler->Parameter(3),            \ | 
| +                 assembler->Parameter(4)));                                   \ | 
| +  }                                                                           \ | 
| +  DEFINE_CODE_STUB(NAME, SUPER) | 
| + | 
| +#define DEFINE_TURBOFAN_UNARY_OP_CODE_STUB(NAME, SUPER)                \ | 
| + public:                                                               \ | 
| +  static compiler::Node* Generate(CodeStubAssembler* assembler,        \ | 
| +                                  compiler::Node* value,               \ | 
| +                                  compiler::Node* context);            \ | 
| +  void GenerateAssembly(CodeStubAssembler* assembler) const override { \ | 
| +    assembler->Return(Generate(assembler, assembler->Parameter(0),     \ | 
| +                               assembler->Parameter(1)));              \ | 
| +  }                                                                    \ | 
| +  DEFINE_CODE_STUB(NAME, SUPER) | 
| + | 
| +#define DEFINE_TURBOFAN_UNARY_OP_CODE_STUB_WITH_FEEDBACK(NAME, SUPER)         \ | 
| + public:                                                                      \ | 
| +  static compiler::Node* Generate(                                            \ | 
| +      CodeStubAssembler* assembler, compiler::Node* value,                    \ | 
| +      compiler::Node* context, compiler::Node* type_feedback_vector,          \ | 
| +      compiler::Node* slot_id);                                               \ | 
| +  void GenerateAssembly(CodeStubAssembler* assembler) const override {        \ | 
| +    assembler->Return(                                                        \ | 
| +        Generate(assembler, assembler->Parameter(0), assembler->Parameter(1), \ | 
| +                 assembler->Parameter(2), assembler->Parameter(3)));          \ | 
| +  }                                                                           \ | 
| DEFINE_CODE_STUB(NAME, SUPER) | 
|  | 
| #define DEFINE_HANDLER_CODE_STUB(NAME, SUPER) \ | 
| @@ -605,7 +638,7 @@ | 
| protected: | 
| explicit TurboFanCodeStub(Isolate* isolate) : CodeStub(isolate) {} | 
|  | 
| -  virtual void GenerateAssembly(compiler::CodeAssemblerState* state) const = 0; | 
| +  virtual void GenerateAssembly(CodeStubAssembler* assembler) const = 0; | 
|  | 
| private: | 
| DEFINE_CODE_STUB_BASE(TurboFanCodeStub, CodeStub); | 
| @@ -761,11 +794,13 @@ | 
| public: | 
| explicit StoreInterceptorStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} | 
|  | 
| +  void GenerateAssembly(CodeStubAssembler* assember) const override; | 
| + | 
| Code::Kind GetCodeKind() const override { return Code::HANDLER; } | 
| ExtraICState GetExtraICState() const override { return Code::STORE_IC; } | 
|  | 
| DEFINE_CALL_INTERFACE_DESCRIPTOR(StoreWithVector); | 
| -  DEFINE_TURBOFAN_CODE_STUB(StoreInterceptor, TurboFanCodeStub); | 
| +  DEFINE_CODE_STUB(StoreInterceptor, TurboFanCodeStub); | 
| }; | 
|  | 
| class LoadIndexedInterceptorStub : public TurboFanCodeStub { | 
| @@ -1940,10 +1975,12 @@ | 
| public: | 
| explicit LoadICTrampolineStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} | 
|  | 
| +  void GenerateAssembly(CodeStubAssembler* assembler) const override; | 
| + | 
| Code::Kind GetCodeKind() const override { return Code::LOAD_IC; } | 
|  | 
| DEFINE_CALL_INTERFACE_DESCRIPTOR(Load); | 
| -  DEFINE_TURBOFAN_CODE_STUB(LoadICTrampoline, TurboFanCodeStub); | 
| +  DEFINE_CODE_STUB(LoadICTrampoline, TurboFanCodeStub); | 
| }; | 
|  | 
| class LoadGlobalICTrampolineStub : public TurboFanCodeStub { | 
| @@ -1954,6 +1991,8 @@ | 
| minor_key_ = state.GetExtraICState(); | 
| } | 
|  | 
| +  void GenerateAssembly(CodeStubAssembler* assembler) const override; | 
| + | 
| Code::Kind GetCodeKind() const override { return Code::LOAD_GLOBAL_IC; } | 
|  | 
| ExtraICState GetExtraICState() const final { | 
| @@ -1961,7 +2000,7 @@ | 
| } | 
|  | 
| DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadGlobal); | 
| -  DEFINE_TURBOFAN_CODE_STUB(LoadGlobalICTrampoline, TurboFanCodeStub); | 
| +  DEFINE_CODE_STUB(LoadGlobalICTrampoline, TurboFanCodeStub); | 
| }; | 
|  | 
| class KeyedLoadICTrampolineTFStub : public LoadICTrampolineStub { | 
| @@ -1969,9 +2008,11 @@ | 
| explicit KeyedLoadICTrampolineTFStub(Isolate* isolate) | 
| : LoadICTrampolineStub(isolate) {} | 
|  | 
| +  void GenerateAssembly(CodeStubAssembler* assembler) const override; | 
| + | 
| Code::Kind GetCodeKind() const override { return Code::KEYED_LOAD_IC; } | 
|  | 
| -  DEFINE_TURBOFAN_CODE_STUB(KeyedLoadICTrampolineTF, LoadICTrampolineStub); | 
| +  DEFINE_CODE_STUB(KeyedLoadICTrampolineTF, LoadICTrampolineStub); | 
| }; | 
|  | 
| class StoreICTrampolineStub : public TurboFanCodeStub { | 
| @@ -1981,6 +2022,8 @@ | 
| minor_key_ = state.GetExtraICState(); | 
| } | 
|  | 
| +  void GenerateAssembly(CodeStubAssembler* assembler) const override; | 
| + | 
| Code::Kind GetCodeKind() const override { return Code::STORE_IC; } | 
|  | 
| ExtraICState GetExtraICState() const final { | 
| @@ -1991,7 +2034,7 @@ | 
| StoreICState state() const { return StoreICState(GetExtraICState()); } | 
|  | 
| DEFINE_CALL_INTERFACE_DESCRIPTOR(Store); | 
| -  DEFINE_TURBOFAN_CODE_STUB(StoreICTrampoline, TurboFanCodeStub); | 
| +  DEFINE_CODE_STUB(StoreICTrampoline, TurboFanCodeStub); | 
| }; | 
|  | 
| class KeyedStoreICTrampolineStub : public PlatformCodeStub { | 
| @@ -2020,9 +2063,11 @@ | 
| KeyedStoreICTrampolineTFStub(Isolate* isolate, const StoreICState& state) | 
| : StoreICTrampolineStub(isolate, state) {} | 
|  | 
| +  void GenerateAssembly(CodeStubAssembler* assembler) const override; | 
| + | 
| Code::Kind GetCodeKind() const override { return Code::KEYED_STORE_IC; } | 
|  | 
| -  DEFINE_TURBOFAN_CODE_STUB(KeyedStoreICTrampolineTF, StoreICTrampolineStub); | 
| +  DEFINE_CODE_STUB(KeyedStoreICTrampolineTF, StoreICTrampolineStub); | 
| }; | 
|  | 
| class CallICTrampolineStub : public PlatformCodeStub { | 
| @@ -2051,18 +2096,22 @@ | 
| public: | 
| explicit LoadICStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} | 
|  | 
| +  void GenerateAssembly(CodeStubAssembler* assembler) const override; | 
| + | 
| Code::Kind GetCodeKind() const override { return Code::LOAD_IC; } | 
|  | 
| DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); | 
| -  DEFINE_TURBOFAN_CODE_STUB(LoadIC, TurboFanCodeStub); | 
| +  DEFINE_CODE_STUB(LoadIC, TurboFanCodeStub); | 
| }; | 
|  | 
| class LoadICProtoArrayStub : public TurboFanCodeStub { | 
| public: | 
| explicit LoadICProtoArrayStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} | 
|  | 
| +  void GenerateAssembly(CodeStubAssembler* assembler) const override; | 
| + | 
| DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadICProtoArray); | 
| -  DEFINE_TURBOFAN_CODE_STUB(LoadICProtoArray, TurboFanCodeStub); | 
| +  DEFINE_CODE_STUB(LoadICProtoArray, TurboFanCodeStub); | 
| }; | 
|  | 
| class LoadGlobalICStub : public TurboFanCodeStub { | 
| @@ -2072,6 +2121,8 @@ | 
| minor_key_ = state.GetExtraICState(); | 
| } | 
|  | 
| +  void GenerateAssembly(CodeStubAssembler* assembler) const override; | 
| + | 
| Code::Kind GetCodeKind() const override { return Code::LOAD_GLOBAL_IC; } | 
|  | 
| ExtraICState GetExtraICState() const final { | 
| @@ -2079,16 +2130,18 @@ | 
| } | 
|  | 
| DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadGlobalWithVector); | 
| -  DEFINE_TURBOFAN_CODE_STUB(LoadGlobalIC, TurboFanCodeStub); | 
| +  DEFINE_CODE_STUB(LoadGlobalIC, TurboFanCodeStub); | 
| }; | 
|  | 
| class KeyedLoadICTFStub : public LoadICStub { | 
| public: | 
| explicit KeyedLoadICTFStub(Isolate* isolate) : LoadICStub(isolate) {} | 
|  | 
| +  void GenerateAssembly(CodeStubAssembler* assembler) const override; | 
| + | 
| Code::Kind GetCodeKind() const override { return Code::KEYED_LOAD_IC; } | 
|  | 
| -  DEFINE_TURBOFAN_CODE_STUB(KeyedLoadICTF, LoadICStub); | 
| +  DEFINE_CODE_STUB(KeyedLoadICTF, LoadICStub); | 
| }; | 
|  | 
| class StoreICStub : public TurboFanCodeStub { | 
| @@ -2098,13 +2151,15 @@ | 
| minor_key_ = state.GetExtraICState(); | 
| } | 
|  | 
| +  void GenerateAssembly(CodeStubAssembler* assembler) const override; | 
| + | 
| Code::Kind GetCodeKind() const override { return Code::STORE_IC; } | 
| ExtraICState GetExtraICState() const final { | 
| return static_cast<ExtraICState>(minor_key_); | 
| } | 
|  | 
| DEFINE_CALL_INTERFACE_DESCRIPTOR(StoreWithVector); | 
| -  DEFINE_TURBOFAN_CODE_STUB(StoreIC, TurboFanCodeStub); | 
| +  DEFINE_CODE_STUB(StoreIC, TurboFanCodeStub); | 
| }; | 
|  | 
| class KeyedStoreICStub : public PlatformCodeStub { | 
| @@ -2134,9 +2189,11 @@ | 
| KeyedStoreICTFStub(Isolate* isolate, const StoreICState& state) | 
| : StoreICStub(isolate, state) {} | 
|  | 
| +  void GenerateAssembly(CodeStubAssembler* assembler) const override; | 
| + | 
| Code::Kind GetCodeKind() const override { return Code::KEYED_STORE_IC; } | 
|  | 
| -  DEFINE_TURBOFAN_CODE_STUB(KeyedStoreICTF, StoreICStub); | 
| +  DEFINE_CODE_STUB(KeyedStoreICTF, StoreICStub); | 
| }; | 
|  | 
| class DoubleToIStub : public PlatformCodeStub { | 
| @@ -2341,22 +2398,23 @@ | 
| : TurboFanCodeStub(isolate) {} | 
|  | 
| void InitializeDescriptor(CodeStubDescriptor* descriptor) override; | 
| +  void GenerateAssembly(CodeStubAssembler* assembler) const override; | 
|  | 
| DEFINE_CALL_INTERFACE_DESCRIPTOR(AllocateHeapNumber); | 
| -  DEFINE_TURBOFAN_CODE_STUB(AllocateHeapNumber, TurboFanCodeStub); | 
| -}; | 
| - | 
| -#define SIMD128_ALLOC_STUB(TYPE, Type, type, lane_count, lane_type)            \ | 
| -  class Allocate##Type##Stub : public TurboFanCodeStub {                       \ | 
| -   public:                                                                     \ | 
| -    explicit Allocate##Type##Stub(Isolate* isolate)                            \ | 
| -        : TurboFanCodeStub(isolate) {}                                         \ | 
| -                                                                               \ | 
| -    void InitializeDescriptor(CodeStubDescriptor* descriptor) override;        \ | 
| -    void GenerateAssembly(compiler::CodeAssemblerState* state) const override; \ | 
| -                                                                               \ | 
| -    DEFINE_CALL_INTERFACE_DESCRIPTOR(Allocate##Type);                          \ | 
| -    DEFINE_CODE_STUB(Allocate##Type, TurboFanCodeStub);                        \ | 
| +  DEFINE_CODE_STUB(AllocateHeapNumber, TurboFanCodeStub); | 
| +}; | 
| + | 
| +#define SIMD128_ALLOC_STUB(TYPE, Type, type, lane_count, lane_type)     \ | 
| +  class Allocate##Type##Stub : public TurboFanCodeStub {                \ | 
| +   public:                                                              \ | 
| +    explicit Allocate##Type##Stub(Isolate* isolate)                     \ | 
| +        : TurboFanCodeStub(isolate) {}                                  \ | 
| +                                                                        \ | 
| +    void InitializeDescriptor(CodeStubDescriptor* descriptor) override; \ | 
| +    void GenerateAssembly(CodeStubAssembler* assembler) const override; \ | 
| +                                                                        \ | 
| +    DEFINE_CALL_INTERFACE_DESCRIPTOR(Allocate##Type);                   \ | 
| +    DEFINE_CODE_STUB(Allocate##Type, TurboFanCodeStub);                 \ | 
| }; | 
| SIMD128_TYPES(SIMD128_ALLOC_STUB) | 
| #undef SIMD128_ALLOC_STUB | 
| @@ -2655,8 +2713,16 @@ | 
| compiler::Node* string, compiler::Node* from, | 
| compiler::Node* to, compiler::Node* context); | 
|  | 
| +  void GenerateAssembly(CodeStubAssembler* assembler) const override { | 
| +    assembler->Return(Generate(assembler, | 
| +                               assembler->Parameter(Descriptor::kString), | 
| +                               assembler->Parameter(Descriptor::kFrom), | 
| +                               assembler->Parameter(Descriptor::kTo), | 
| +                               assembler->Parameter(Descriptor::kContext))); | 
| +  } | 
| + | 
| DEFINE_CALL_INTERFACE_DESCRIPTOR(SubString); | 
| -  DEFINE_TURBOFAN_CODE_STUB(SubString, TurboFanCodeStub); | 
| +  DEFINE_CODE_STUB(SubString, TurboFanCodeStub); | 
| }; | 
|  | 
|  | 
|  |