| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_CODE_STUBS_H_ | 5 #ifndef V8_CODE_STUBS_H_ |
| 6 #define V8_CODE_STUBS_H_ | 6 #define V8_CODE_STUBS_H_ |
| 7 | 7 |
| 8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
| 9 #include "src/assembler.h" | 9 #include "src/assembler.h" |
| 10 #include "src/code-stub-assembler.h" | 10 #include "src/code-stub-assembler.h" |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 NAME(uint32_t key, Isolate* isolate) : SUPER(key, isolate) {} \ | 362 NAME(uint32_t key, Isolate* isolate) : SUPER(key, isolate) {} \ |
| 363 \ | 363 \ |
| 364 private: \ | 364 private: \ |
| 365 DISALLOW_COPY_AND_ASSIGN(NAME) | 365 DISALLOW_COPY_AND_ASSIGN(NAME) |
| 366 | 366 |
| 367 | 367 |
| 368 #define DEFINE_CODE_STUB(NAME, SUPER) \ | 368 #define DEFINE_CODE_STUB(NAME, SUPER) \ |
| 369 public: \ | 369 public: \ |
| 370 inline Major MajorKey() const override { return NAME; }; \ | 370 inline Major MajorKey() const override { return NAME; }; \ |
| 371 \ | 371 \ |
| 372 protected: \ | |
| 373 DEFINE_CODE_STUB_BASE(NAME##Stub, SUPER) | 372 DEFINE_CODE_STUB_BASE(NAME##Stub, SUPER) |
| 374 | 373 |
| 375 | 374 |
| 376 #define DEFINE_PLATFORM_CODE_STUB(NAME, SUPER) \ | 375 #define DEFINE_PLATFORM_CODE_STUB(NAME, SUPER) \ |
| 377 private: \ | 376 private: \ |
| 378 void Generate(MacroAssembler* masm) override; \ | 377 void Generate(MacroAssembler* masm) override; \ |
| 379 DEFINE_CODE_STUB(NAME, SUPER) | 378 DEFINE_CODE_STUB(NAME, SUPER) |
| 380 | 379 |
| 381 | 380 |
| 382 #define DEFINE_HYDROGEN_CODE_STUB(NAME, SUPER) \ | 381 #define DEFINE_HYDROGEN_CODE_STUB(NAME, SUPER) \ |
| 383 public: \ | 382 public: \ |
| 384 void InitializeDescriptor(CodeStubDescriptor* descriptor) override; \ | 383 void InitializeDescriptor(CodeStubDescriptor* descriptor) override; \ |
| 385 Handle<Code> GenerateCode() override; \ | 384 Handle<Code> GenerateCode() override; \ |
| 386 DEFINE_CODE_STUB(NAME, SUPER) | 385 DEFINE_CODE_STUB(NAME, SUPER) |
| 387 | 386 |
| 388 #define DEFINE_TURBOFAN_CODE_STUB(NAME, SUPER) \ | 387 #define DEFINE_TURBOFAN_CODE_STUB(NAME, SUPER) \ |
| 389 public: \ | 388 public: \ |
| 390 void GenerateAssembly(CodeStubAssembler* assembler) const override; \ | 389 void GenerateAssembly(compiler::CodeAssemblerState* state) const override; \ |
| 391 DEFINE_CODE_STUB(NAME, SUPER) | 390 DEFINE_CODE_STUB(NAME, SUPER) |
| 392 | 391 |
| 393 #define DEFINE_TURBOFAN_BINARY_OP_CODE_STUB(NAME, SUPER) \ | 392 #define DEFINE_TURBOFAN_BINARY_OP_CODE_STUB_WITH_FEEDBACK(NAME, SUPER) \ |
| 394 public: \ | 393 public: \ |
| 395 static compiler::Node* Generate(CodeStubAssembler* assembler, \ | 394 static compiler::Node* Generate( \ |
| 396 compiler::Node* left, compiler::Node* right, \ | 395 CodeStubAssembler* assembler, compiler::Node* left, \ |
| 397 compiler::Node* context); \ | 396 compiler::Node* right, compiler::Node* slot_id, \ |
| 398 void GenerateAssembly(CodeStubAssembler* assembler) const override { \ | 397 compiler::Node* type_feedback_vector, compiler::Node* context); \ |
| 399 assembler->Return(Generate(assembler, assembler->Parameter(0), \ | 398 void GenerateAssembly(compiler::CodeAssemblerState* state) const override; \ |
| 400 assembler->Parameter(1), \ | |
| 401 assembler->Parameter(2))); \ | |
| 402 } \ | |
| 403 DEFINE_CODE_STUB(NAME, SUPER) | 399 DEFINE_CODE_STUB(NAME, SUPER) |
| 404 | 400 |
| 405 #define DEFINE_TURBOFAN_BINARY_OP_CODE_STUB_WITH_FEEDBACK(NAME, SUPER) \ | 401 #define DEFINE_TURBOFAN_UNARY_OP_CODE_STUB_WITH_FEEDBACK(NAME, SUPER) \ |
| 406 public: \ | 402 public: \ |
| 407 static compiler::Node* Generate( \ | 403 static compiler::Node* Generate( \ |
| 408 CodeStubAssembler* assembler, compiler::Node* left, \ | 404 CodeStubAssembler* assembler, compiler::Node* value, \ |
| 409 compiler::Node* right, compiler::Node* slot_id, \ | 405 compiler::Node* context, compiler::Node* type_feedback_vector, \ |
| 410 compiler::Node* type_feedback_vector, compiler::Node* context); \ | 406 compiler::Node* slot_id); \ |
| 411 void GenerateAssembly(CodeStubAssembler* assembler) const override { \ | 407 void GenerateAssembly(compiler::CodeAssemblerState* state) const override; \ |
| 412 assembler->Return( \ | |
| 413 Generate(assembler, assembler->Parameter(0), assembler->Parameter(1), \ | |
| 414 assembler->Parameter(2), assembler->Parameter(3), \ | |
| 415 assembler->Parameter(4))); \ | |
| 416 } \ | |
| 417 DEFINE_CODE_STUB(NAME, SUPER) | |
| 418 | |
| 419 #define DEFINE_TURBOFAN_UNARY_OP_CODE_STUB(NAME, SUPER) \ | |
| 420 public: \ | |
| 421 static compiler::Node* Generate(CodeStubAssembler* assembler, \ | |
| 422 compiler::Node* value, \ | |
| 423 compiler::Node* context); \ | |
| 424 void GenerateAssembly(CodeStubAssembler* assembler) const override { \ | |
| 425 assembler->Return(Generate(assembler, assembler->Parameter(0), \ | |
| 426 assembler->Parameter(1))); \ | |
| 427 } \ | |
| 428 DEFINE_CODE_STUB(NAME, SUPER) | |
| 429 | |
| 430 #define DEFINE_TURBOFAN_UNARY_OP_CODE_STUB_WITH_FEEDBACK(NAME, SUPER) \ | |
| 431 public: \ | |
| 432 static compiler::Node* Generate( \ | |
| 433 CodeStubAssembler* assembler, compiler::Node* value, \ | |
| 434 compiler::Node* context, compiler::Node* type_feedback_vector, \ | |
| 435 compiler::Node* slot_id); \ | |
| 436 void GenerateAssembly(CodeStubAssembler* assembler) const override { \ | |
| 437 assembler->Return( \ | |
| 438 Generate(assembler, assembler->Parameter(0), assembler->Parameter(1), \ | |
| 439 assembler->Parameter(2), assembler->Parameter(3))); \ | |
| 440 } \ | |
| 441 DEFINE_CODE_STUB(NAME, SUPER) | 408 DEFINE_CODE_STUB(NAME, SUPER) |
| 442 | 409 |
| 443 #define DEFINE_HANDLER_CODE_STUB(NAME, SUPER) \ | 410 #define DEFINE_HANDLER_CODE_STUB(NAME, SUPER) \ |
| 444 public: \ | 411 public: \ |
| 445 Handle<Code> GenerateCode() override; \ | 412 Handle<Code> GenerateCode() override; \ |
| 446 DEFINE_CODE_STUB(NAME, SUPER) | 413 DEFINE_CODE_STUB(NAME, SUPER) |
| 447 | 414 |
| 448 #define DEFINE_CALL_INTERFACE_DESCRIPTOR(NAME) \ | 415 #define DEFINE_CALL_INTERFACE_DESCRIPTOR(NAME) \ |
| 449 public: \ | 416 public: \ |
| 450 typedef NAME##Descriptor Descriptor; \ | 417 typedef NAME##Descriptor Descriptor; \ |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 630 // Retrieve the code for the stub. Generate the code if needed. | 597 // Retrieve the code for the stub. Generate the code if needed. |
| 631 Handle<Code> GenerateCode() override; | 598 Handle<Code> GenerateCode() override; |
| 632 | 599 |
| 633 int GetStackParameterCount() const override { | 600 int GetStackParameterCount() const override { |
| 634 return GetCallInterfaceDescriptor().GetStackParameterCount(); | 601 return GetCallInterfaceDescriptor().GetStackParameterCount(); |
| 635 } | 602 } |
| 636 | 603 |
| 637 protected: | 604 protected: |
| 638 explicit TurboFanCodeStub(Isolate* isolate) : CodeStub(isolate) {} | 605 explicit TurboFanCodeStub(Isolate* isolate) : CodeStub(isolate) {} |
| 639 | 606 |
| 640 virtual void GenerateAssembly(CodeStubAssembler* assembler) const = 0; | 607 virtual void GenerateAssembly(compiler::CodeAssemblerState* state) const = 0; |
| 641 | 608 |
| 642 private: | 609 private: |
| 643 DEFINE_CODE_STUB_BASE(TurboFanCodeStub, CodeStub); | 610 DEFINE_CODE_STUB_BASE(TurboFanCodeStub, CodeStub); |
| 644 }; | 611 }; |
| 645 | 612 |
| 646 | 613 |
| 647 // Helper interface to prepare to/restore after making runtime calls. | 614 // Helper interface to prepare to/restore after making runtime calls. |
| 648 class RuntimeCallHelper { | 615 class RuntimeCallHelper { |
| 649 public: | 616 public: |
| 650 virtual ~RuntimeCallHelper() {} | 617 virtual ~RuntimeCallHelper() {} |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 786 explicit DecStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} | 753 explicit DecStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} |
| 787 | 754 |
| 788 DEFINE_CALL_INTERFACE_DESCRIPTOR(CountOp); | 755 DEFINE_CALL_INTERFACE_DESCRIPTOR(CountOp); |
| 789 DEFINE_TURBOFAN_UNARY_OP_CODE_STUB_WITH_FEEDBACK(Dec, TurboFanCodeStub); | 756 DEFINE_TURBOFAN_UNARY_OP_CODE_STUB_WITH_FEEDBACK(Dec, TurboFanCodeStub); |
| 790 }; | 757 }; |
| 791 | 758 |
| 792 class StoreInterceptorStub : public TurboFanCodeStub { | 759 class StoreInterceptorStub : public TurboFanCodeStub { |
| 793 public: | 760 public: |
| 794 explicit StoreInterceptorStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} | 761 explicit StoreInterceptorStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} |
| 795 | 762 |
| 796 void GenerateAssembly(CodeStubAssembler* assember) const override; | |
| 797 | |
| 798 Code::Kind GetCodeKind() const override { return Code::HANDLER; } | 763 Code::Kind GetCodeKind() const override { return Code::HANDLER; } |
| 799 ExtraICState GetExtraICState() const override { return Code::STORE_IC; } | 764 ExtraICState GetExtraICState() const override { return Code::STORE_IC; } |
| 800 | 765 |
| 801 DEFINE_CALL_INTERFACE_DESCRIPTOR(StoreWithVector); | 766 DEFINE_CALL_INTERFACE_DESCRIPTOR(StoreWithVector); |
| 802 DEFINE_CODE_STUB(StoreInterceptor, TurboFanCodeStub); | 767 DEFINE_TURBOFAN_CODE_STUB(StoreInterceptor, TurboFanCodeStub); |
| 803 }; | 768 }; |
| 804 | 769 |
| 805 class LoadIndexedInterceptorStub : public TurboFanCodeStub { | 770 class LoadIndexedInterceptorStub : public TurboFanCodeStub { |
| 806 public: | 771 public: |
| 807 explicit LoadIndexedInterceptorStub(Isolate* isolate) | 772 explicit LoadIndexedInterceptorStub(Isolate* isolate) |
| 808 : TurboFanCodeStub(isolate) {} | 773 : TurboFanCodeStub(isolate) {} |
| 809 | 774 |
| 810 Code::Kind GetCodeKind() const override { return Code::HANDLER; } | 775 Code::Kind GetCodeKind() const override { return Code::HANDLER; } |
| 811 ExtraICState GetExtraICState() const override { return Code::KEYED_LOAD_IC; } | 776 ExtraICState GetExtraICState() const override { return Code::KEYED_LOAD_IC; } |
| 812 | 777 |
| (...skipping 1154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1967 : HydrogenCodeStub(isolate) {} | 1932 : HydrogenCodeStub(isolate) {} |
| 1968 | 1933 |
| 1969 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); | 1934 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); |
| 1970 DEFINE_HYDROGEN_CODE_STUB(LoadDictionaryElement, HydrogenCodeStub); | 1935 DEFINE_HYDROGEN_CODE_STUB(LoadDictionaryElement, HydrogenCodeStub); |
| 1971 }; | 1936 }; |
| 1972 | 1937 |
| 1973 class LoadICTrampolineStub : public TurboFanCodeStub { | 1938 class LoadICTrampolineStub : public TurboFanCodeStub { |
| 1974 public: | 1939 public: |
| 1975 explicit LoadICTrampolineStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} | 1940 explicit LoadICTrampolineStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} |
| 1976 | 1941 |
| 1977 void GenerateAssembly(CodeStubAssembler* assembler) const override; | |
| 1978 | |
| 1979 Code::Kind GetCodeKind() const override { return Code::LOAD_IC; } | 1942 Code::Kind GetCodeKind() const override { return Code::LOAD_IC; } |
| 1980 | 1943 |
| 1981 DEFINE_CALL_INTERFACE_DESCRIPTOR(Load); | 1944 DEFINE_CALL_INTERFACE_DESCRIPTOR(Load); |
| 1982 DEFINE_CODE_STUB(LoadICTrampoline, TurboFanCodeStub); | 1945 DEFINE_TURBOFAN_CODE_STUB(LoadICTrampoline, TurboFanCodeStub); |
| 1983 }; | 1946 }; |
| 1984 | 1947 |
| 1985 class LoadGlobalICTrampolineStub : public TurboFanCodeStub { | 1948 class LoadGlobalICTrampolineStub : public TurboFanCodeStub { |
| 1986 public: | 1949 public: |
| 1987 explicit LoadGlobalICTrampolineStub(Isolate* isolate, | 1950 explicit LoadGlobalICTrampolineStub(Isolate* isolate, |
| 1988 const LoadGlobalICState& state) | 1951 const LoadGlobalICState& state) |
| 1989 : TurboFanCodeStub(isolate) { | 1952 : TurboFanCodeStub(isolate) { |
| 1990 minor_key_ = state.GetExtraICState(); | 1953 minor_key_ = state.GetExtraICState(); |
| 1991 } | 1954 } |
| 1992 | 1955 |
| 1993 void GenerateAssembly(CodeStubAssembler* assembler) const override; | |
| 1994 | |
| 1995 Code::Kind GetCodeKind() const override { return Code::LOAD_GLOBAL_IC; } | 1956 Code::Kind GetCodeKind() const override { return Code::LOAD_GLOBAL_IC; } |
| 1996 | 1957 |
| 1997 ExtraICState GetExtraICState() const final { | 1958 ExtraICState GetExtraICState() const final { |
| 1998 return static_cast<ExtraICState>(minor_key_); | 1959 return static_cast<ExtraICState>(minor_key_); |
| 1999 } | 1960 } |
| 2000 | 1961 |
| 2001 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadGlobal); | 1962 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadGlobal); |
| 2002 DEFINE_CODE_STUB(LoadGlobalICTrampoline, TurboFanCodeStub); | 1963 DEFINE_TURBOFAN_CODE_STUB(LoadGlobalICTrampoline, TurboFanCodeStub); |
| 2003 }; | 1964 }; |
| 2004 | 1965 |
| 2005 class KeyedLoadICTrampolineTFStub : public LoadICTrampolineStub { | 1966 class KeyedLoadICTrampolineTFStub : public LoadICTrampolineStub { |
| 2006 public: | 1967 public: |
| 2007 explicit KeyedLoadICTrampolineTFStub(Isolate* isolate) | 1968 explicit KeyedLoadICTrampolineTFStub(Isolate* isolate) |
| 2008 : LoadICTrampolineStub(isolate) {} | 1969 : LoadICTrampolineStub(isolate) {} |
| 2009 | 1970 |
| 2010 void GenerateAssembly(CodeStubAssembler* assembler) const override; | |
| 2011 | |
| 2012 Code::Kind GetCodeKind() const override { return Code::KEYED_LOAD_IC; } | 1971 Code::Kind GetCodeKind() const override { return Code::KEYED_LOAD_IC; } |
| 2013 | 1972 |
| 2014 DEFINE_CODE_STUB(KeyedLoadICTrampolineTF, LoadICTrampolineStub); | 1973 DEFINE_TURBOFAN_CODE_STUB(KeyedLoadICTrampolineTF, LoadICTrampolineStub); |
| 2015 }; | 1974 }; |
| 2016 | 1975 |
| 2017 class StoreICTrampolineStub : public TurboFanCodeStub { | 1976 class StoreICTrampolineStub : public TurboFanCodeStub { |
| 2018 public: | 1977 public: |
| 2019 StoreICTrampolineStub(Isolate* isolate, const StoreICState& state) | 1978 StoreICTrampolineStub(Isolate* isolate, const StoreICState& state) |
| 2020 : TurboFanCodeStub(isolate) { | 1979 : TurboFanCodeStub(isolate) { |
| 2021 minor_key_ = state.GetExtraICState(); | 1980 minor_key_ = state.GetExtraICState(); |
| 2022 } | 1981 } |
| 2023 | 1982 |
| 2024 void GenerateAssembly(CodeStubAssembler* assembler) const override; | |
| 2025 | |
| 2026 Code::Kind GetCodeKind() const override { return Code::STORE_IC; } | 1983 Code::Kind GetCodeKind() const override { return Code::STORE_IC; } |
| 2027 | 1984 |
| 2028 ExtraICState GetExtraICState() const final { | 1985 ExtraICState GetExtraICState() const final { |
| 2029 return static_cast<ExtraICState>(minor_key_); | 1986 return static_cast<ExtraICState>(minor_key_); |
| 2030 } | 1987 } |
| 2031 | 1988 |
| 2032 protected: | 1989 protected: |
| 2033 StoreICState state() const { return StoreICState(GetExtraICState()); } | 1990 StoreICState state() const { return StoreICState(GetExtraICState()); } |
| 2034 | 1991 |
| 2035 DEFINE_CALL_INTERFACE_DESCRIPTOR(Store); | 1992 DEFINE_CALL_INTERFACE_DESCRIPTOR(Store); |
| 2036 DEFINE_CODE_STUB(StoreICTrampoline, TurboFanCodeStub); | 1993 DEFINE_TURBOFAN_CODE_STUB(StoreICTrampoline, TurboFanCodeStub); |
| 2037 }; | 1994 }; |
| 2038 | 1995 |
| 2039 class KeyedStoreICTrampolineStub : public PlatformCodeStub { | 1996 class KeyedStoreICTrampolineStub : public PlatformCodeStub { |
| 2040 public: | 1997 public: |
| 2041 KeyedStoreICTrampolineStub(Isolate* isolate, const StoreICState& state) | 1998 KeyedStoreICTrampolineStub(Isolate* isolate, const StoreICState& state) |
| 2042 : PlatformCodeStub(isolate) { | 1999 : PlatformCodeStub(isolate) { |
| 2043 minor_key_ = state.GetExtraICState(); | 2000 minor_key_ = state.GetExtraICState(); |
| 2044 } | 2001 } |
| 2045 | 2002 |
| 2046 Code::Kind GetCodeKind() const override { return Code::KEYED_STORE_IC; } | 2003 Code::Kind GetCodeKind() const override { return Code::KEYED_STORE_IC; } |
| 2047 | 2004 |
| 2048 ExtraICState GetExtraICState() const final { | 2005 ExtraICState GetExtraICState() const final { |
| 2049 return static_cast<ExtraICState>(minor_key_); | 2006 return static_cast<ExtraICState>(minor_key_); |
| 2050 } | 2007 } |
| 2051 | 2008 |
| 2052 protected: | 2009 protected: |
| 2053 StoreICState state() const { return StoreICState(GetExtraICState()); } | 2010 StoreICState state() const { return StoreICState(GetExtraICState()); } |
| 2054 | 2011 |
| 2055 private: | 2012 private: |
| 2056 DEFINE_CALL_INTERFACE_DESCRIPTOR(Store); | 2013 DEFINE_CALL_INTERFACE_DESCRIPTOR(Store); |
| 2057 DEFINE_PLATFORM_CODE_STUB(KeyedStoreICTrampoline, PlatformCodeStub); | 2014 DEFINE_PLATFORM_CODE_STUB(KeyedStoreICTrampoline, PlatformCodeStub); |
| 2058 }; | 2015 }; |
| 2059 | 2016 |
| 2060 class KeyedStoreICTrampolineTFStub : public StoreICTrampolineStub { | 2017 class KeyedStoreICTrampolineTFStub : public StoreICTrampolineStub { |
| 2061 public: | 2018 public: |
| 2062 KeyedStoreICTrampolineTFStub(Isolate* isolate, const StoreICState& state) | 2019 KeyedStoreICTrampolineTFStub(Isolate* isolate, const StoreICState& state) |
| 2063 : StoreICTrampolineStub(isolate, state) {} | 2020 : StoreICTrampolineStub(isolate, state) {} |
| 2064 | 2021 |
| 2065 void GenerateAssembly(CodeStubAssembler* assembler) const override; | |
| 2066 | |
| 2067 Code::Kind GetCodeKind() const override { return Code::KEYED_STORE_IC; } | 2022 Code::Kind GetCodeKind() const override { return Code::KEYED_STORE_IC; } |
| 2068 | 2023 |
| 2069 DEFINE_CODE_STUB(KeyedStoreICTrampolineTF, StoreICTrampolineStub); | 2024 DEFINE_TURBOFAN_CODE_STUB(KeyedStoreICTrampolineTF, StoreICTrampolineStub); |
| 2070 }; | 2025 }; |
| 2071 | 2026 |
| 2072 class CallICTrampolineStub : public PlatformCodeStub { | 2027 class CallICTrampolineStub : public PlatformCodeStub { |
| 2073 public: | 2028 public: |
| 2074 CallICTrampolineStub(Isolate* isolate, const CallICState& state) | 2029 CallICTrampolineStub(Isolate* isolate, const CallICState& state) |
| 2075 : PlatformCodeStub(isolate) { | 2030 : PlatformCodeStub(isolate) { |
| 2076 minor_key_ = state.GetExtraICState(); | 2031 minor_key_ = state.GetExtraICState(); |
| 2077 } | 2032 } |
| 2078 | 2033 |
| 2079 Code::Kind GetCodeKind() const override { return Code::CALL_IC; } | 2034 Code::Kind GetCodeKind() const override { return Code::CALL_IC; } |
| 2080 | 2035 |
| 2081 ExtraICState GetExtraICState() const final { | 2036 ExtraICState GetExtraICState() const final { |
| 2082 return static_cast<ExtraICState>(minor_key_); | 2037 return static_cast<ExtraICState>(minor_key_); |
| 2083 } | 2038 } |
| 2084 | 2039 |
| 2085 protected: | 2040 protected: |
| 2086 CallICState state() const { | 2041 CallICState state() const { |
| 2087 return CallICState(static_cast<ExtraICState>(minor_key_)); | 2042 return CallICState(static_cast<ExtraICState>(minor_key_)); |
| 2088 } | 2043 } |
| 2089 | 2044 |
| 2090 DEFINE_CALL_INTERFACE_DESCRIPTOR(CallFunctionWithFeedback); | 2045 DEFINE_CALL_INTERFACE_DESCRIPTOR(CallFunctionWithFeedback); |
| 2091 DEFINE_PLATFORM_CODE_STUB(CallICTrampoline, PlatformCodeStub); | 2046 DEFINE_PLATFORM_CODE_STUB(CallICTrampoline, PlatformCodeStub); |
| 2092 }; | 2047 }; |
| 2093 | 2048 |
| 2094 class LoadICStub : public TurboFanCodeStub { | 2049 class LoadICStub : public TurboFanCodeStub { |
| 2095 public: | 2050 public: |
| 2096 explicit LoadICStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} | 2051 explicit LoadICStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} |
| 2097 | 2052 |
| 2098 void GenerateAssembly(CodeStubAssembler* assembler) const override; | |
| 2099 | |
| 2100 Code::Kind GetCodeKind() const override { return Code::LOAD_IC; } | 2053 Code::Kind GetCodeKind() const override { return Code::LOAD_IC; } |
| 2101 | 2054 |
| 2102 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); | 2055 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); |
| 2103 DEFINE_CODE_STUB(LoadIC, TurboFanCodeStub); | 2056 DEFINE_TURBOFAN_CODE_STUB(LoadIC, TurboFanCodeStub); |
| 2104 }; | 2057 }; |
| 2105 | 2058 |
| 2106 class LoadGlobalICStub : public TurboFanCodeStub { | 2059 class LoadGlobalICStub : public TurboFanCodeStub { |
| 2107 public: | 2060 public: |
| 2108 explicit LoadGlobalICStub(Isolate* isolate, const LoadGlobalICState& state) | 2061 explicit LoadGlobalICStub(Isolate* isolate, const LoadGlobalICState& state) |
| 2109 : TurboFanCodeStub(isolate) { | 2062 : TurboFanCodeStub(isolate) { |
| 2110 minor_key_ = state.GetExtraICState(); | 2063 minor_key_ = state.GetExtraICState(); |
| 2111 } | 2064 } |
| 2112 | 2065 |
| 2113 void GenerateAssembly(CodeStubAssembler* assembler) const override; | |
| 2114 | |
| 2115 Code::Kind GetCodeKind() const override { return Code::LOAD_GLOBAL_IC; } | 2066 Code::Kind GetCodeKind() const override { return Code::LOAD_GLOBAL_IC; } |
| 2116 | 2067 |
| 2117 ExtraICState GetExtraICState() const final { | 2068 ExtraICState GetExtraICState() const final { |
| 2118 return static_cast<ExtraICState>(minor_key_); | 2069 return static_cast<ExtraICState>(minor_key_); |
| 2119 } | 2070 } |
| 2120 | 2071 |
| 2121 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadGlobalWithVector); | 2072 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadGlobalWithVector); |
| 2122 DEFINE_CODE_STUB(LoadGlobalIC, TurboFanCodeStub); | 2073 DEFINE_TURBOFAN_CODE_STUB(LoadGlobalIC, TurboFanCodeStub); |
| 2123 }; | 2074 }; |
| 2124 | 2075 |
| 2125 class KeyedLoadICTFStub : public LoadICStub { | 2076 class KeyedLoadICTFStub : public LoadICStub { |
| 2126 public: | 2077 public: |
| 2127 explicit KeyedLoadICTFStub(Isolate* isolate) : LoadICStub(isolate) {} | 2078 explicit KeyedLoadICTFStub(Isolate* isolate) : LoadICStub(isolate) {} |
| 2128 | 2079 |
| 2129 void GenerateAssembly(CodeStubAssembler* assembler) const override; | |
| 2130 | |
| 2131 Code::Kind GetCodeKind() const override { return Code::KEYED_LOAD_IC; } | 2080 Code::Kind GetCodeKind() const override { return Code::KEYED_LOAD_IC; } |
| 2132 | 2081 |
| 2133 DEFINE_CODE_STUB(KeyedLoadICTF, LoadICStub); | 2082 DEFINE_TURBOFAN_CODE_STUB(KeyedLoadICTF, LoadICStub); |
| 2134 }; | 2083 }; |
| 2135 | 2084 |
| 2136 class StoreICStub : public TurboFanCodeStub { | 2085 class StoreICStub : public TurboFanCodeStub { |
| 2137 public: | 2086 public: |
| 2138 StoreICStub(Isolate* isolate, const StoreICState& state) | 2087 StoreICStub(Isolate* isolate, const StoreICState& state) |
| 2139 : TurboFanCodeStub(isolate) { | 2088 : TurboFanCodeStub(isolate) { |
| 2140 minor_key_ = state.GetExtraICState(); | 2089 minor_key_ = state.GetExtraICState(); |
| 2141 } | 2090 } |
| 2142 | 2091 |
| 2143 void GenerateAssembly(CodeStubAssembler* assembler) const override; | |
| 2144 | |
| 2145 Code::Kind GetCodeKind() const override { return Code::STORE_IC; } | 2092 Code::Kind GetCodeKind() const override { return Code::STORE_IC; } |
| 2146 ExtraICState GetExtraICState() const final { | 2093 ExtraICState GetExtraICState() const final { |
| 2147 return static_cast<ExtraICState>(minor_key_); | 2094 return static_cast<ExtraICState>(minor_key_); |
| 2148 } | 2095 } |
| 2149 | 2096 |
| 2150 DEFINE_CALL_INTERFACE_DESCRIPTOR(StoreWithVector); | 2097 DEFINE_CALL_INTERFACE_DESCRIPTOR(StoreWithVector); |
| 2151 DEFINE_CODE_STUB(StoreIC, TurboFanCodeStub); | 2098 DEFINE_TURBOFAN_CODE_STUB(StoreIC, TurboFanCodeStub); |
| 2152 }; | 2099 }; |
| 2153 | 2100 |
| 2154 class KeyedStoreICStub : public PlatformCodeStub { | 2101 class KeyedStoreICStub : public PlatformCodeStub { |
| 2155 public: | 2102 public: |
| 2156 KeyedStoreICStub(Isolate* isolate, const StoreICState& state) | 2103 KeyedStoreICStub(Isolate* isolate, const StoreICState& state) |
| 2157 : PlatformCodeStub(isolate) { | 2104 : PlatformCodeStub(isolate) { |
| 2158 minor_key_ = state.GetExtraICState(); | 2105 minor_key_ = state.GetExtraICState(); |
| 2159 } | 2106 } |
| 2160 | 2107 |
| 2161 void GenerateForTrampoline(MacroAssembler* masm); | 2108 void GenerateForTrampoline(MacroAssembler* masm); |
| 2162 | 2109 |
| 2163 Code::Kind GetCodeKind() const final { return Code::KEYED_STORE_IC; } | 2110 Code::Kind GetCodeKind() const final { return Code::KEYED_STORE_IC; } |
| 2164 | 2111 |
| 2165 ExtraICState GetExtraICState() const final { | 2112 ExtraICState GetExtraICState() const final { |
| 2166 return static_cast<ExtraICState>(minor_key_); | 2113 return static_cast<ExtraICState>(minor_key_); |
| 2167 } | 2114 } |
| 2168 | 2115 |
| 2169 DEFINE_CALL_INTERFACE_DESCRIPTOR(StoreWithVector); | 2116 DEFINE_CALL_INTERFACE_DESCRIPTOR(StoreWithVector); |
| 2170 DEFINE_PLATFORM_CODE_STUB(KeyedStoreIC, PlatformCodeStub); | 2117 DEFINE_PLATFORM_CODE_STUB(KeyedStoreIC, PlatformCodeStub); |
| 2171 | 2118 |
| 2172 protected: | 2119 protected: |
| 2173 void GenerateImpl(MacroAssembler* masm, bool in_frame); | 2120 void GenerateImpl(MacroAssembler* masm, bool in_frame); |
| 2174 }; | 2121 }; |
| 2175 | 2122 |
| 2176 class KeyedStoreICTFStub : public StoreICStub { | 2123 class KeyedStoreICTFStub : public StoreICStub { |
| 2177 public: | 2124 public: |
| 2178 KeyedStoreICTFStub(Isolate* isolate, const StoreICState& state) | 2125 KeyedStoreICTFStub(Isolate* isolate, const StoreICState& state) |
| 2179 : StoreICStub(isolate, state) {} | 2126 : StoreICStub(isolate, state) {} |
| 2180 | 2127 |
| 2181 void GenerateAssembly(CodeStubAssembler* assembler) const override; | |
| 2182 | |
| 2183 Code::Kind GetCodeKind() const override { return Code::KEYED_STORE_IC; } | 2128 Code::Kind GetCodeKind() const override { return Code::KEYED_STORE_IC; } |
| 2184 | 2129 |
| 2185 DEFINE_CODE_STUB(KeyedStoreICTF, StoreICStub); | 2130 DEFINE_TURBOFAN_CODE_STUB(KeyedStoreICTF, StoreICStub); |
| 2186 }; | 2131 }; |
| 2187 | 2132 |
| 2188 class DoubleToIStub : public PlatformCodeStub { | 2133 class DoubleToIStub : public PlatformCodeStub { |
| 2189 public: | 2134 public: |
| 2190 DoubleToIStub(Isolate* isolate, Register source, Register destination, | 2135 DoubleToIStub(Isolate* isolate, Register source, Register destination, |
| 2191 int offset, bool is_truncating, bool skip_fastpath = false) | 2136 int offset, bool is_truncating, bool skip_fastpath = false) |
| 2192 : PlatformCodeStub(isolate) { | 2137 : PlatformCodeStub(isolate) { |
| 2193 minor_key_ = SourceRegisterBits::encode(source.code()) | | 2138 minor_key_ = SourceRegisterBits::encode(source.code()) | |
| 2194 DestinationRegisterBits::encode(destination.code()) | | 2139 DestinationRegisterBits::encode(destination.code()) | |
| 2195 OffsetBits::encode(offset) | | 2140 OffsetBits::encode(offset) | |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2380 DEFINE_CALL_INTERFACE_DESCRIPTOR(TransitionElementsKind); | 2325 DEFINE_CALL_INTERFACE_DESCRIPTOR(TransitionElementsKind); |
| 2381 DEFINE_HYDROGEN_CODE_STUB(TransitionElementsKind, HydrogenCodeStub); | 2326 DEFINE_HYDROGEN_CODE_STUB(TransitionElementsKind, HydrogenCodeStub); |
| 2382 }; | 2327 }; |
| 2383 | 2328 |
| 2384 class AllocateHeapNumberStub : public TurboFanCodeStub { | 2329 class AllocateHeapNumberStub : public TurboFanCodeStub { |
| 2385 public: | 2330 public: |
| 2386 explicit AllocateHeapNumberStub(Isolate* isolate) | 2331 explicit AllocateHeapNumberStub(Isolate* isolate) |
| 2387 : TurboFanCodeStub(isolate) {} | 2332 : TurboFanCodeStub(isolate) {} |
| 2388 | 2333 |
| 2389 void InitializeDescriptor(CodeStubDescriptor* descriptor) override; | 2334 void InitializeDescriptor(CodeStubDescriptor* descriptor) override; |
| 2390 void GenerateAssembly(CodeStubAssembler* assembler) const override; | |
| 2391 | 2335 |
| 2392 DEFINE_CALL_INTERFACE_DESCRIPTOR(AllocateHeapNumber); | 2336 DEFINE_CALL_INTERFACE_DESCRIPTOR(AllocateHeapNumber); |
| 2393 DEFINE_CODE_STUB(AllocateHeapNumber, TurboFanCodeStub); | 2337 DEFINE_TURBOFAN_CODE_STUB(AllocateHeapNumber, TurboFanCodeStub); |
| 2394 }; | 2338 }; |
| 2395 | 2339 |
| 2396 #define SIMD128_ALLOC_STUB(TYPE, Type, type, lane_count, lane_type) \ | 2340 #define SIMD128_ALLOC_STUB(TYPE, Type, type, lane_count, lane_type) \ |
| 2397 class Allocate##Type##Stub : public TurboFanCodeStub { \ | 2341 class Allocate##Type##Stub : public TurboFanCodeStub { \ |
| 2398 public: \ | 2342 public: \ |
| 2399 explicit Allocate##Type##Stub(Isolate* isolate) \ | 2343 explicit Allocate##Type##Stub(Isolate* isolate) \ |
| 2400 : TurboFanCodeStub(isolate) {} \ | 2344 : TurboFanCodeStub(isolate) {} \ |
| 2401 \ | 2345 \ |
| 2402 void InitializeDescriptor(CodeStubDescriptor* descriptor) override; \ | 2346 void InitializeDescriptor(CodeStubDescriptor* descriptor) override; \ |
| 2403 void GenerateAssembly(CodeStubAssembler* assembler) const override; \ | 2347 void GenerateAssembly(compiler::CodeAssemblerState* state) const override; \ |
| 2404 \ | 2348 \ |
| 2405 DEFINE_CALL_INTERFACE_DESCRIPTOR(Allocate##Type); \ | 2349 DEFINE_CALL_INTERFACE_DESCRIPTOR(Allocate##Type); \ |
| 2406 DEFINE_CODE_STUB(Allocate##Type, TurboFanCodeStub); \ | 2350 DEFINE_CODE_STUB(Allocate##Type, TurboFanCodeStub); \ |
| 2407 }; | 2351 }; |
| 2408 SIMD128_TYPES(SIMD128_ALLOC_STUB) | 2352 SIMD128_TYPES(SIMD128_ALLOC_STUB) |
| 2409 #undef SIMD128_ALLOC_STUB | 2353 #undef SIMD128_ALLOC_STUB |
| 2410 | 2354 |
| 2411 class CommonArrayConstructorStub : public TurboFanCodeStub { | 2355 class CommonArrayConstructorStub : public TurboFanCodeStub { |
| 2412 protected: | 2356 protected: |
| 2413 CommonArrayConstructorStub(Isolate* isolate, ElementsKind kind, | 2357 CommonArrayConstructorStub(Isolate* isolate, ElementsKind kind, |
| 2414 AllocationSiteOverrideMode override_mode) | 2358 AllocationSiteOverrideMode override_mode) |
| 2415 : TurboFanCodeStub(isolate) { | 2359 : TurboFanCodeStub(isolate) { |
| 2416 // It only makes sense to override local allocation site behavior | 2360 // It only makes sense to override local allocation site behavior |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2695 }; | 2639 }; |
| 2696 | 2640 |
| 2697 class SubStringStub : public TurboFanCodeStub { | 2641 class SubStringStub : public TurboFanCodeStub { |
| 2698 public: | 2642 public: |
| 2699 explicit SubStringStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} | 2643 explicit SubStringStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} |
| 2700 | 2644 |
| 2701 static compiler::Node* Generate(CodeStubAssembler* assembler, | 2645 static compiler::Node* Generate(CodeStubAssembler* assembler, |
| 2702 compiler::Node* string, compiler::Node* from, | 2646 compiler::Node* string, compiler::Node* from, |
| 2703 compiler::Node* to, compiler::Node* context); | 2647 compiler::Node* to, compiler::Node* context); |
| 2704 | 2648 |
| 2705 void GenerateAssembly(CodeStubAssembler* assembler) const override { | |
| 2706 assembler->Return(Generate(assembler, | |
| 2707 assembler->Parameter(Descriptor::kString), | |
| 2708 assembler->Parameter(Descriptor::kFrom), | |
| 2709 assembler->Parameter(Descriptor::kTo), | |
| 2710 assembler->Parameter(Descriptor::kContext))); | |
| 2711 } | |
| 2712 | |
| 2713 DEFINE_CALL_INTERFACE_DESCRIPTOR(SubString); | 2649 DEFINE_CALL_INTERFACE_DESCRIPTOR(SubString); |
| 2714 DEFINE_CODE_STUB(SubString, TurboFanCodeStub); | 2650 DEFINE_TURBOFAN_CODE_STUB(SubString, TurboFanCodeStub); |
| 2715 }; | 2651 }; |
| 2716 | 2652 |
| 2717 | 2653 |
| 2718 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR | 2654 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR |
| 2719 #undef DEFINE_PLATFORM_CODE_STUB | 2655 #undef DEFINE_PLATFORM_CODE_STUB |
| 2720 #undef DEFINE_HANDLER_CODE_STUB | 2656 #undef DEFINE_HANDLER_CODE_STUB |
| 2721 #undef DEFINE_HYDROGEN_CODE_STUB | 2657 #undef DEFINE_HYDROGEN_CODE_STUB |
| 2722 #undef DEFINE_CODE_STUB | 2658 #undef DEFINE_CODE_STUB |
| 2723 #undef DEFINE_CODE_STUB_BASE | 2659 #undef DEFINE_CODE_STUB_BASE |
| 2724 | 2660 |
| 2725 } // namespace internal | 2661 } // namespace internal |
| 2726 } // namespace v8 | 2662 } // namespace v8 |
| 2727 | 2663 |
| 2728 #endif // V8_CODE_STUBS_H_ | 2664 #endif // V8_CODE_STUBS_H_ |
| OLD | NEW |