Chromium Code Reviews| 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 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 378 void Generate(MacroAssembler* masm) override; \ | 378 void Generate(MacroAssembler* masm) override; \ |
| 379 DEFINE_CODE_STUB(NAME, SUPER) | 379 DEFINE_CODE_STUB(NAME, SUPER) |
| 380 | 380 |
| 381 | 381 |
| 382 #define DEFINE_HYDROGEN_CODE_STUB(NAME, SUPER) \ | 382 #define DEFINE_HYDROGEN_CODE_STUB(NAME, SUPER) \ |
| 383 public: \ | 383 public: \ |
| 384 void InitializeDescriptor(CodeStubDescriptor* descriptor) override; \ | 384 void InitializeDescriptor(CodeStubDescriptor* descriptor) override; \ |
| 385 Handle<Code> GenerateCode() override; \ | 385 Handle<Code> GenerateCode() override; \ |
| 386 DEFINE_CODE_STUB(NAME, SUPER) | 386 DEFINE_CODE_STUB(NAME, SUPER) |
| 387 | 387 |
| 388 #define DEFINE_TURBOFAN_CODE_STUB(NAME, SUPER) \ | 388 #define DEFINE_TURBOFAN_CODE_STUB(NAME, SUPER) \ |
| 389 public: \ | 389 public: \ |
| 390 void GenerateAssembly(CodeStubAssembler* assembler) const override; \ | 390 void GenerateAssembly(compiler::CodeAssemblerState* state) const override; \ |
| 391 DEFINE_CODE_STUB(NAME, SUPER) | 391 DEFINE_CODE_STUB(NAME, SUPER) |
| 392 | 392 |
| 393 #define DEFINE_TURBOFAN_BINARY_OP_CODE_STUB(NAME, SUPER) \ | 393 #define DEFINE_TURBOFAN_BINARY_OP_CODE_STUB_WITH_FEEDBACK(NAME, SUPER) \ |
|
Jakob Kummerow
2016/11/15 09:51:50
This was dead code.
| |
| 394 public: \ | 394 public: \ |
| 395 static compiler::Node* Generate(CodeStubAssembler* assembler, \ | 395 static compiler::Node* Generate( \ |
| 396 compiler::Node* left, compiler::Node* right, \ | 396 CodeStubAssembler* assembler, compiler::Node* left, \ |
| 397 compiler::Node* context); \ | 397 compiler::Node* right, compiler::Node* slot_id, \ |
| 398 void GenerateAssembly(CodeStubAssembler* assembler) const override { \ | 398 compiler::Node* type_feedback_vector, compiler::Node* context); \ |
| 399 assembler->Return(Generate(assembler, assembler->Parameter(0), \ | 399 void GenerateAssembly(compiler::CodeAssemblerState* state) const override; \ |
| 400 assembler->Parameter(1), \ | |
| 401 assembler->Parameter(2))); \ | |
| 402 } \ | |
| 403 DEFINE_CODE_STUB(NAME, SUPER) | 400 DEFINE_CODE_STUB(NAME, SUPER) |
| 404 | 401 |
| 405 #define DEFINE_TURBOFAN_BINARY_OP_CODE_STUB_WITH_FEEDBACK(NAME, SUPER) \ | 402 #define DEFINE_TURBOFAN_UNARY_OP_CODE_STUB_WITH_FEEDBACK(NAME, SUPER) \ |
| 406 public: \ | 403 public: \ |
| 407 static compiler::Node* Generate( \ | 404 static compiler::Node* Generate( \ |
| 408 CodeStubAssembler* assembler, compiler::Node* left, \ | 405 CodeStubAssembler* assembler, compiler::Node* value, \ |
| 409 compiler::Node* right, compiler::Node* slot_id, \ | 406 compiler::Node* context, compiler::Node* type_feedback_vector, \ |
| 410 compiler::Node* type_feedback_vector, compiler::Node* context); \ | 407 compiler::Node* slot_id); \ |
| 411 void GenerateAssembly(CodeStubAssembler* assembler) const override { \ | 408 void GenerateAssembly(compiler::CodeAssemblerState* state) const override; \ |
|
Jakob Kummerow
2016/11/15 09:51:50
Moved this implementation to the .cc file.
| |
| 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) \ | |
|
Jakob Kummerow
2016/11/15 09:51:50
This was dead code.
| |
| 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 { \ | |
|
Jakob Kummerow
2016/11/15 09:51:50
Moved this implementation to the .cc file.
| |
| 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) | 409 DEFINE_CODE_STUB(NAME, SUPER) |
| 442 | 410 |
| 443 #define DEFINE_HANDLER_CODE_STUB(NAME, SUPER) \ | 411 #define DEFINE_HANDLER_CODE_STUB(NAME, SUPER) \ |
| 444 public: \ | 412 public: \ |
| 445 Handle<Code> GenerateCode() override; \ | 413 Handle<Code> GenerateCode() override; \ |
| 446 DEFINE_CODE_STUB(NAME, SUPER) | 414 DEFINE_CODE_STUB(NAME, SUPER) |
| 447 | 415 |
| 448 #define DEFINE_CALL_INTERFACE_DESCRIPTOR(NAME) \ | 416 #define DEFINE_CALL_INTERFACE_DESCRIPTOR(NAME) \ |
| 449 public: \ | 417 public: \ |
| 450 typedef NAME##Descriptor Descriptor; \ | 418 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. | 598 // Retrieve the code for the stub. Generate the code if needed. |
| 631 Handle<Code> GenerateCode() override; | 599 Handle<Code> GenerateCode() override; |
| 632 | 600 |
| 633 int GetStackParameterCount() const override { | 601 int GetStackParameterCount() const override { |
| 634 return GetCallInterfaceDescriptor().GetStackParameterCount(); | 602 return GetCallInterfaceDescriptor().GetStackParameterCount(); |
| 635 } | 603 } |
| 636 | 604 |
| 637 protected: | 605 protected: |
| 638 explicit TurboFanCodeStub(Isolate* isolate) : CodeStub(isolate) {} | 606 explicit TurboFanCodeStub(Isolate* isolate) : CodeStub(isolate) {} |
| 639 | 607 |
| 640 virtual void GenerateAssembly(CodeStubAssembler* assembler) const = 0; | 608 virtual void GenerateAssembly(compiler::CodeAssemblerState* state) const = 0; |
| 641 | 609 |
| 642 private: | 610 private: |
| 643 DEFINE_CODE_STUB_BASE(TurboFanCodeStub, CodeStub); | 611 DEFINE_CODE_STUB_BASE(TurboFanCodeStub, CodeStub); |
| 644 }; | 612 }; |
| 645 | 613 |
| 646 | 614 |
| 647 // Helper interface to prepare to/restore after making runtime calls. | 615 // Helper interface to prepare to/restore after making runtime calls. |
| 648 class RuntimeCallHelper { | 616 class RuntimeCallHelper { |
| 649 public: | 617 public: |
| 650 virtual ~RuntimeCallHelper() {} | 618 virtual ~RuntimeCallHelper() {} |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 786 explicit DecStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} | 754 explicit DecStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} |
| 787 | 755 |
| 788 DEFINE_CALL_INTERFACE_DESCRIPTOR(CountOp); | 756 DEFINE_CALL_INTERFACE_DESCRIPTOR(CountOp); |
| 789 DEFINE_TURBOFAN_UNARY_OP_CODE_STUB_WITH_FEEDBACK(Dec, TurboFanCodeStub); | 757 DEFINE_TURBOFAN_UNARY_OP_CODE_STUB_WITH_FEEDBACK(Dec, TurboFanCodeStub); |
| 790 }; | 758 }; |
| 791 | 759 |
| 792 class StoreInterceptorStub : public TurboFanCodeStub { | 760 class StoreInterceptorStub : public TurboFanCodeStub { |
| 793 public: | 761 public: |
| 794 explicit StoreInterceptorStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} | 762 explicit StoreInterceptorStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} |
| 795 | 763 |
| 796 void GenerateAssembly(CodeStubAssembler* assember) const override; | 764 void GenerateAssembly(compiler::CodeAssemblerState* state) const override; |
|
Igor Sheludko
2016/11/15 13:06:35
While you are here, what if we remove this and ...
Jakob Kummerow
2016/11/15 13:40:31
Done.
| |
| 797 | 765 |
| 798 Code::Kind GetCodeKind() const override { return Code::HANDLER; } | 766 Code::Kind GetCodeKind() const override { return Code::HANDLER; } |
| 799 ExtraICState GetExtraICState() const override { return Code::STORE_IC; } | 767 ExtraICState GetExtraICState() const override { return Code::STORE_IC; } |
| 800 | 768 |
| 801 DEFINE_CALL_INTERFACE_DESCRIPTOR(StoreWithVector); | 769 DEFINE_CALL_INTERFACE_DESCRIPTOR(StoreWithVector); |
| 802 DEFINE_CODE_STUB(StoreInterceptor, TurboFanCodeStub); | 770 DEFINE_CODE_STUB(StoreInterceptor, TurboFanCodeStub); |
|
Igor Sheludko
2016/11/15 13:06:35
... use here DEFINE_TURBOFAN_CODE_STUB instead? Sa
Jakob Kummerow
2016/11/15 13:40:31
Brilliant.
| |
| 803 }; | 771 }; |
| 804 | 772 |
| 805 class LoadIndexedInterceptorStub : public TurboFanCodeStub { | 773 class LoadIndexedInterceptorStub : public TurboFanCodeStub { |
| 806 public: | 774 public: |
| 807 explicit LoadIndexedInterceptorStub(Isolate* isolate) | 775 explicit LoadIndexedInterceptorStub(Isolate* isolate) |
| 808 : TurboFanCodeStub(isolate) {} | 776 : TurboFanCodeStub(isolate) {} |
| 809 | 777 |
| 810 Code::Kind GetCodeKind() const override { return Code::HANDLER; } | 778 Code::Kind GetCodeKind() const override { return Code::HANDLER; } |
| 811 ExtraICState GetExtraICState() const override { return Code::KEYED_LOAD_IC; } | 779 ExtraICState GetExtraICState() const override { return Code::KEYED_LOAD_IC; } |
| 812 | 780 |
| (...skipping 1154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1967 : HydrogenCodeStub(isolate) {} | 1935 : HydrogenCodeStub(isolate) {} |
| 1968 | 1936 |
| 1969 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); | 1937 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); |
| 1970 DEFINE_HYDROGEN_CODE_STUB(LoadDictionaryElement, HydrogenCodeStub); | 1938 DEFINE_HYDROGEN_CODE_STUB(LoadDictionaryElement, HydrogenCodeStub); |
| 1971 }; | 1939 }; |
| 1972 | 1940 |
| 1973 class LoadICTrampolineStub : public TurboFanCodeStub { | 1941 class LoadICTrampolineStub : public TurboFanCodeStub { |
| 1974 public: | 1942 public: |
| 1975 explicit LoadICTrampolineStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} | 1943 explicit LoadICTrampolineStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} |
| 1976 | 1944 |
| 1977 void GenerateAssembly(CodeStubAssembler* assembler) const override; | 1945 void GenerateAssembly(compiler::CodeAssemblerState* state) const override; |
| 1978 | 1946 |
| 1979 Code::Kind GetCodeKind() const override { return Code::LOAD_IC; } | 1947 Code::Kind GetCodeKind() const override { return Code::LOAD_IC; } |
| 1980 | 1948 |
| 1981 DEFINE_CALL_INTERFACE_DESCRIPTOR(Load); | 1949 DEFINE_CALL_INTERFACE_DESCRIPTOR(Load); |
| 1982 DEFINE_CODE_STUB(LoadICTrampoline, TurboFanCodeStub); | 1950 DEFINE_CODE_STUB(LoadICTrampoline, TurboFanCodeStub); |
| 1983 }; | 1951 }; |
| 1984 | 1952 |
| 1985 class LoadGlobalICTrampolineStub : public TurboFanCodeStub { | 1953 class LoadGlobalICTrampolineStub : public TurboFanCodeStub { |
| 1986 public: | 1954 public: |
| 1987 explicit LoadGlobalICTrampolineStub(Isolate* isolate, | 1955 explicit LoadGlobalICTrampolineStub(Isolate* isolate, |
| 1988 const LoadGlobalICState& state) | 1956 const LoadGlobalICState& state) |
| 1989 : TurboFanCodeStub(isolate) { | 1957 : TurboFanCodeStub(isolate) { |
| 1990 minor_key_ = state.GetExtraICState(); | 1958 minor_key_ = state.GetExtraICState(); |
| 1991 } | 1959 } |
| 1992 | 1960 |
| 1993 void GenerateAssembly(CodeStubAssembler* assembler) const override; | 1961 void GenerateAssembly(compiler::CodeAssemblerState* state) const override; |
| 1994 | 1962 |
| 1995 Code::Kind GetCodeKind() const override { return Code::LOAD_GLOBAL_IC; } | 1963 Code::Kind GetCodeKind() const override { return Code::LOAD_GLOBAL_IC; } |
| 1996 | 1964 |
| 1997 ExtraICState GetExtraICState() const final { | 1965 ExtraICState GetExtraICState() const final { |
| 1998 return static_cast<ExtraICState>(minor_key_); | 1966 return static_cast<ExtraICState>(minor_key_); |
| 1999 } | 1967 } |
| 2000 | 1968 |
| 2001 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadGlobal); | 1969 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadGlobal); |
| 2002 DEFINE_CODE_STUB(LoadGlobalICTrampoline, TurboFanCodeStub); | 1970 DEFINE_CODE_STUB(LoadGlobalICTrampoline, TurboFanCodeStub); |
| 2003 }; | 1971 }; |
| 2004 | 1972 |
| 2005 class KeyedLoadICTrampolineTFStub : public LoadICTrampolineStub { | 1973 class KeyedLoadICTrampolineTFStub : public LoadICTrampolineStub { |
| 2006 public: | 1974 public: |
| 2007 explicit KeyedLoadICTrampolineTFStub(Isolate* isolate) | 1975 explicit KeyedLoadICTrampolineTFStub(Isolate* isolate) |
| 2008 : LoadICTrampolineStub(isolate) {} | 1976 : LoadICTrampolineStub(isolate) {} |
| 2009 | 1977 |
| 2010 void GenerateAssembly(CodeStubAssembler* assembler) const override; | 1978 void GenerateAssembly(compiler::CodeAssemblerState* state) const override; |
| 2011 | 1979 |
| 2012 Code::Kind GetCodeKind() const override { return Code::KEYED_LOAD_IC; } | 1980 Code::Kind GetCodeKind() const override { return Code::KEYED_LOAD_IC; } |
| 2013 | 1981 |
| 2014 DEFINE_CODE_STUB(KeyedLoadICTrampolineTF, LoadICTrampolineStub); | 1982 DEFINE_CODE_STUB(KeyedLoadICTrampolineTF, LoadICTrampolineStub); |
| 2015 }; | 1983 }; |
| 2016 | 1984 |
| 2017 class StoreICTrampolineStub : public TurboFanCodeStub { | 1985 class StoreICTrampolineStub : public TurboFanCodeStub { |
| 2018 public: | 1986 public: |
| 2019 StoreICTrampolineStub(Isolate* isolate, const StoreICState& state) | 1987 StoreICTrampolineStub(Isolate* isolate, const StoreICState& state) |
| 2020 : TurboFanCodeStub(isolate) { | 1988 : TurboFanCodeStub(isolate) { |
| 2021 minor_key_ = state.GetExtraICState(); | 1989 minor_key_ = state.GetExtraICState(); |
| 2022 } | 1990 } |
| 2023 | 1991 |
| 2024 void GenerateAssembly(CodeStubAssembler* assembler) const override; | 1992 void GenerateAssembly(compiler::CodeAssemblerState* state) const override; |
| 2025 | 1993 |
| 2026 Code::Kind GetCodeKind() const override { return Code::STORE_IC; } | 1994 Code::Kind GetCodeKind() const override { return Code::STORE_IC; } |
| 2027 | 1995 |
| 2028 ExtraICState GetExtraICState() const final { | 1996 ExtraICState GetExtraICState() const final { |
| 2029 return static_cast<ExtraICState>(minor_key_); | 1997 return static_cast<ExtraICState>(minor_key_); |
| 2030 } | 1998 } |
| 2031 | 1999 |
| 2032 protected: | 2000 protected: |
| 2033 StoreICState state() const { return StoreICState(GetExtraICState()); } | 2001 StoreICState state() const { return StoreICState(GetExtraICState()); } |
| 2034 | 2002 |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 2055 private: | 2023 private: |
| 2056 DEFINE_CALL_INTERFACE_DESCRIPTOR(Store); | 2024 DEFINE_CALL_INTERFACE_DESCRIPTOR(Store); |
| 2057 DEFINE_PLATFORM_CODE_STUB(KeyedStoreICTrampoline, PlatformCodeStub); | 2025 DEFINE_PLATFORM_CODE_STUB(KeyedStoreICTrampoline, PlatformCodeStub); |
| 2058 }; | 2026 }; |
| 2059 | 2027 |
| 2060 class KeyedStoreICTrampolineTFStub : public StoreICTrampolineStub { | 2028 class KeyedStoreICTrampolineTFStub : public StoreICTrampolineStub { |
| 2061 public: | 2029 public: |
| 2062 KeyedStoreICTrampolineTFStub(Isolate* isolate, const StoreICState& state) | 2030 KeyedStoreICTrampolineTFStub(Isolate* isolate, const StoreICState& state) |
| 2063 : StoreICTrampolineStub(isolate, state) {} | 2031 : StoreICTrampolineStub(isolate, state) {} |
| 2064 | 2032 |
| 2065 void GenerateAssembly(CodeStubAssembler* assembler) const override; | 2033 void GenerateAssembly(compiler::CodeAssemblerState* state) const override; |
| 2066 | 2034 |
| 2067 Code::Kind GetCodeKind() const override { return Code::KEYED_STORE_IC; } | 2035 Code::Kind GetCodeKind() const override { return Code::KEYED_STORE_IC; } |
| 2068 | 2036 |
| 2069 DEFINE_CODE_STUB(KeyedStoreICTrampolineTF, StoreICTrampolineStub); | 2037 DEFINE_CODE_STUB(KeyedStoreICTrampolineTF, StoreICTrampolineStub); |
| 2070 }; | 2038 }; |
| 2071 | 2039 |
| 2072 class CallICTrampolineStub : public PlatformCodeStub { | 2040 class CallICTrampolineStub : public PlatformCodeStub { |
| 2073 public: | 2041 public: |
| 2074 CallICTrampolineStub(Isolate* isolate, const CallICState& state) | 2042 CallICTrampolineStub(Isolate* isolate, const CallICState& state) |
| 2075 : PlatformCodeStub(isolate) { | 2043 : PlatformCodeStub(isolate) { |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 2088 } | 2056 } |
| 2089 | 2057 |
| 2090 DEFINE_CALL_INTERFACE_DESCRIPTOR(CallFunctionWithFeedback); | 2058 DEFINE_CALL_INTERFACE_DESCRIPTOR(CallFunctionWithFeedback); |
| 2091 DEFINE_PLATFORM_CODE_STUB(CallICTrampoline, PlatformCodeStub); | 2059 DEFINE_PLATFORM_CODE_STUB(CallICTrampoline, PlatformCodeStub); |
| 2092 }; | 2060 }; |
| 2093 | 2061 |
| 2094 class LoadICStub : public TurboFanCodeStub { | 2062 class LoadICStub : public TurboFanCodeStub { |
| 2095 public: | 2063 public: |
| 2096 explicit LoadICStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} | 2064 explicit LoadICStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} |
| 2097 | 2065 |
| 2098 void GenerateAssembly(CodeStubAssembler* assembler) const override; | 2066 void GenerateAssembly(compiler::CodeAssemblerState* state) const override; |
| 2099 | 2067 |
| 2100 Code::Kind GetCodeKind() const override { return Code::LOAD_IC; } | 2068 Code::Kind GetCodeKind() const override { return Code::LOAD_IC; } |
| 2101 | 2069 |
| 2102 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); | 2070 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); |
| 2103 DEFINE_CODE_STUB(LoadIC, TurboFanCodeStub); | 2071 DEFINE_CODE_STUB(LoadIC, TurboFanCodeStub); |
| 2104 }; | 2072 }; |
| 2105 | 2073 |
| 2106 class LoadGlobalICStub : public TurboFanCodeStub { | 2074 class LoadGlobalICStub : public TurboFanCodeStub { |
| 2107 public: | 2075 public: |
| 2108 explicit LoadGlobalICStub(Isolate* isolate, const LoadGlobalICState& state) | 2076 explicit LoadGlobalICStub(Isolate* isolate, const LoadGlobalICState& state) |
| 2109 : TurboFanCodeStub(isolate) { | 2077 : TurboFanCodeStub(isolate) { |
| 2110 minor_key_ = state.GetExtraICState(); | 2078 minor_key_ = state.GetExtraICState(); |
| 2111 } | 2079 } |
| 2112 | 2080 |
| 2113 void GenerateAssembly(CodeStubAssembler* assembler) const override; | 2081 void GenerateAssembly(compiler::CodeAssemblerState* state) const override; |
| 2114 | 2082 |
| 2115 Code::Kind GetCodeKind() const override { return Code::LOAD_GLOBAL_IC; } | 2083 Code::Kind GetCodeKind() const override { return Code::LOAD_GLOBAL_IC; } |
| 2116 | 2084 |
| 2117 ExtraICState GetExtraICState() const final { | 2085 ExtraICState GetExtraICState() const final { |
| 2118 return static_cast<ExtraICState>(minor_key_); | 2086 return static_cast<ExtraICState>(minor_key_); |
| 2119 } | 2087 } |
| 2120 | 2088 |
| 2121 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadGlobalWithVector); | 2089 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadGlobalWithVector); |
| 2122 DEFINE_CODE_STUB(LoadGlobalIC, TurboFanCodeStub); | 2090 DEFINE_CODE_STUB(LoadGlobalIC, TurboFanCodeStub); |
| 2123 }; | 2091 }; |
| 2124 | 2092 |
| 2125 class KeyedLoadICTFStub : public LoadICStub { | 2093 class KeyedLoadICTFStub : public LoadICStub { |
| 2126 public: | 2094 public: |
| 2127 explicit KeyedLoadICTFStub(Isolate* isolate) : LoadICStub(isolate) {} | 2095 explicit KeyedLoadICTFStub(Isolate* isolate) : LoadICStub(isolate) {} |
| 2128 | 2096 |
| 2129 void GenerateAssembly(CodeStubAssembler* assembler) const override; | 2097 void GenerateAssembly(compiler::CodeAssemblerState* state) const override; |
| 2130 | 2098 |
| 2131 Code::Kind GetCodeKind() const override { return Code::KEYED_LOAD_IC; } | 2099 Code::Kind GetCodeKind() const override { return Code::KEYED_LOAD_IC; } |
| 2132 | 2100 |
| 2133 DEFINE_CODE_STUB(KeyedLoadICTF, LoadICStub); | 2101 DEFINE_CODE_STUB(KeyedLoadICTF, LoadICStub); |
| 2134 }; | 2102 }; |
| 2135 | 2103 |
| 2136 class StoreICStub : public TurboFanCodeStub { | 2104 class StoreICStub : public TurboFanCodeStub { |
| 2137 public: | 2105 public: |
| 2138 StoreICStub(Isolate* isolate, const StoreICState& state) | 2106 StoreICStub(Isolate* isolate, const StoreICState& state) |
| 2139 : TurboFanCodeStub(isolate) { | 2107 : TurboFanCodeStub(isolate) { |
| 2140 minor_key_ = state.GetExtraICState(); | 2108 minor_key_ = state.GetExtraICState(); |
| 2141 } | 2109 } |
| 2142 | 2110 |
| 2143 void GenerateAssembly(CodeStubAssembler* assembler) const override; | 2111 void GenerateAssembly(compiler::CodeAssemblerState* state) const override; |
| 2144 | 2112 |
| 2145 Code::Kind GetCodeKind() const override { return Code::STORE_IC; } | 2113 Code::Kind GetCodeKind() const override { return Code::STORE_IC; } |
| 2146 ExtraICState GetExtraICState() const final { | 2114 ExtraICState GetExtraICState() const final { |
| 2147 return static_cast<ExtraICState>(minor_key_); | 2115 return static_cast<ExtraICState>(minor_key_); |
| 2148 } | 2116 } |
| 2149 | 2117 |
| 2150 DEFINE_CALL_INTERFACE_DESCRIPTOR(StoreWithVector); | 2118 DEFINE_CALL_INTERFACE_DESCRIPTOR(StoreWithVector); |
| 2151 DEFINE_CODE_STUB(StoreIC, TurboFanCodeStub); | 2119 DEFINE_CODE_STUB(StoreIC, TurboFanCodeStub); |
| 2152 }; | 2120 }; |
| 2153 | 2121 |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 2171 | 2139 |
| 2172 protected: | 2140 protected: |
| 2173 void GenerateImpl(MacroAssembler* masm, bool in_frame); | 2141 void GenerateImpl(MacroAssembler* masm, bool in_frame); |
| 2174 }; | 2142 }; |
| 2175 | 2143 |
| 2176 class KeyedStoreICTFStub : public StoreICStub { | 2144 class KeyedStoreICTFStub : public StoreICStub { |
| 2177 public: | 2145 public: |
| 2178 KeyedStoreICTFStub(Isolate* isolate, const StoreICState& state) | 2146 KeyedStoreICTFStub(Isolate* isolate, const StoreICState& state) |
| 2179 : StoreICStub(isolate, state) {} | 2147 : StoreICStub(isolate, state) {} |
| 2180 | 2148 |
| 2181 void GenerateAssembly(CodeStubAssembler* assembler) const override; | 2149 void GenerateAssembly(compiler::CodeAssemblerState* state) const override; |
| 2182 | 2150 |
| 2183 Code::Kind GetCodeKind() const override { return Code::KEYED_STORE_IC; } | 2151 Code::Kind GetCodeKind() const override { return Code::KEYED_STORE_IC; } |
| 2184 | 2152 |
| 2185 DEFINE_CODE_STUB(KeyedStoreICTF, StoreICStub); | 2153 DEFINE_CODE_STUB(KeyedStoreICTF, StoreICStub); |
| 2186 }; | 2154 }; |
| 2187 | 2155 |
| 2188 class DoubleToIStub : public PlatformCodeStub { | 2156 class DoubleToIStub : public PlatformCodeStub { |
| 2189 public: | 2157 public: |
| 2190 DoubleToIStub(Isolate* isolate, Register source, Register destination, | 2158 DoubleToIStub(Isolate* isolate, Register source, Register destination, |
| 2191 int offset, bool is_truncating, bool skip_fastpath = false) | 2159 int offset, bool is_truncating, bool skip_fastpath = false) |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2380 DEFINE_CALL_INTERFACE_DESCRIPTOR(TransitionElementsKind); | 2348 DEFINE_CALL_INTERFACE_DESCRIPTOR(TransitionElementsKind); |
| 2381 DEFINE_HYDROGEN_CODE_STUB(TransitionElementsKind, HydrogenCodeStub); | 2349 DEFINE_HYDROGEN_CODE_STUB(TransitionElementsKind, HydrogenCodeStub); |
| 2382 }; | 2350 }; |
| 2383 | 2351 |
| 2384 class AllocateHeapNumberStub : public TurboFanCodeStub { | 2352 class AllocateHeapNumberStub : public TurboFanCodeStub { |
| 2385 public: | 2353 public: |
| 2386 explicit AllocateHeapNumberStub(Isolate* isolate) | 2354 explicit AllocateHeapNumberStub(Isolate* isolate) |
| 2387 : TurboFanCodeStub(isolate) {} | 2355 : TurboFanCodeStub(isolate) {} |
| 2388 | 2356 |
| 2389 void InitializeDescriptor(CodeStubDescriptor* descriptor) override; | 2357 void InitializeDescriptor(CodeStubDescriptor* descriptor) override; |
| 2390 void GenerateAssembly(CodeStubAssembler* assembler) const override; | 2358 void GenerateAssembly(compiler::CodeAssemblerState* state) const override; |
| 2391 | 2359 |
| 2392 DEFINE_CALL_INTERFACE_DESCRIPTOR(AllocateHeapNumber); | 2360 DEFINE_CALL_INTERFACE_DESCRIPTOR(AllocateHeapNumber); |
| 2393 DEFINE_CODE_STUB(AllocateHeapNumber, TurboFanCodeStub); | 2361 DEFINE_CODE_STUB(AllocateHeapNumber, TurboFanCodeStub); |
| 2394 }; | 2362 }; |
| 2395 | 2363 |
| 2396 #define SIMD128_ALLOC_STUB(TYPE, Type, type, lane_count, lane_type) \ | 2364 #define SIMD128_ALLOC_STUB(TYPE, Type, type, lane_count, lane_type) \ |
| 2397 class Allocate##Type##Stub : public TurboFanCodeStub { \ | 2365 class Allocate##Type##Stub : public TurboFanCodeStub { \ |
| 2398 public: \ | 2366 public: \ |
| 2399 explicit Allocate##Type##Stub(Isolate* isolate) \ | 2367 explicit Allocate##Type##Stub(Isolate* isolate) \ |
| 2400 : TurboFanCodeStub(isolate) {} \ | 2368 : TurboFanCodeStub(isolate) {} \ |
| 2401 \ | 2369 \ |
| 2402 void InitializeDescriptor(CodeStubDescriptor* descriptor) override; \ | 2370 void InitializeDescriptor(CodeStubDescriptor* descriptor) override; \ |
| 2403 void GenerateAssembly(CodeStubAssembler* assembler) const override; \ | 2371 void GenerateAssembly(compiler::CodeAssemblerState* state) const override; \ |
| 2404 \ | 2372 \ |
| 2405 DEFINE_CALL_INTERFACE_DESCRIPTOR(Allocate##Type); \ | 2373 DEFINE_CALL_INTERFACE_DESCRIPTOR(Allocate##Type); \ |
| 2406 DEFINE_CODE_STUB(Allocate##Type, TurboFanCodeStub); \ | 2374 DEFINE_CODE_STUB(Allocate##Type, TurboFanCodeStub); \ |
| 2407 }; | 2375 }; |
| 2408 SIMD128_TYPES(SIMD128_ALLOC_STUB) | 2376 SIMD128_TYPES(SIMD128_ALLOC_STUB) |
| 2409 #undef SIMD128_ALLOC_STUB | 2377 #undef SIMD128_ALLOC_STUB |
| 2410 | 2378 |
| 2411 class CommonArrayConstructorStub : public TurboFanCodeStub { | 2379 class CommonArrayConstructorStub : public TurboFanCodeStub { |
| 2412 protected: | 2380 protected: |
| 2413 CommonArrayConstructorStub(Isolate* isolate, ElementsKind kind, | 2381 CommonArrayConstructorStub(Isolate* isolate, ElementsKind kind, |
| 2414 AllocationSiteOverrideMode override_mode) | 2382 AllocationSiteOverrideMode override_mode) |
| 2415 : TurboFanCodeStub(isolate) { | 2383 : TurboFanCodeStub(isolate) { |
| 2416 // It only makes sense to override local allocation site behavior | 2384 // It only makes sense to override local allocation site behavior |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2695 }; | 2663 }; |
| 2696 | 2664 |
| 2697 class SubStringStub : public TurboFanCodeStub { | 2665 class SubStringStub : public TurboFanCodeStub { |
| 2698 public: | 2666 public: |
| 2699 explicit SubStringStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} | 2667 explicit SubStringStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} |
| 2700 | 2668 |
| 2701 static compiler::Node* Generate(CodeStubAssembler* assembler, | 2669 static compiler::Node* Generate(CodeStubAssembler* assembler, |
| 2702 compiler::Node* string, compiler::Node* from, | 2670 compiler::Node* string, compiler::Node* from, |
| 2703 compiler::Node* to, compiler::Node* context); | 2671 compiler::Node* to, compiler::Node* context); |
| 2704 | 2672 |
| 2705 void GenerateAssembly(CodeStubAssembler* assembler) const override { | 2673 void GenerateAssembly(compiler::CodeAssemblerState* state) 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 | 2674 |
| 2713 DEFINE_CALL_INTERFACE_DESCRIPTOR(SubString); | 2675 DEFINE_CALL_INTERFACE_DESCRIPTOR(SubString); |
| 2714 DEFINE_CODE_STUB(SubString, TurboFanCodeStub); | 2676 DEFINE_CODE_STUB(SubString, TurboFanCodeStub); |
| 2715 }; | 2677 }; |
| 2716 | 2678 |
| 2717 | 2679 |
| 2718 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR | 2680 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR |
| 2719 #undef DEFINE_PLATFORM_CODE_STUB | 2681 #undef DEFINE_PLATFORM_CODE_STUB |
| 2720 #undef DEFINE_HANDLER_CODE_STUB | 2682 #undef DEFINE_HANDLER_CODE_STUB |
| 2721 #undef DEFINE_HYDROGEN_CODE_STUB | 2683 #undef DEFINE_HYDROGEN_CODE_STUB |
| 2722 #undef DEFINE_CODE_STUB | 2684 #undef DEFINE_CODE_STUB |
| 2723 #undef DEFINE_CODE_STUB_BASE | 2685 #undef DEFINE_CODE_STUB_BASE |
| 2724 | 2686 |
| 2725 } // namespace internal | 2687 } // namespace internal |
| 2726 } // namespace v8 | 2688 } // namespace v8 |
| 2727 | 2689 |
| 2728 #endif // V8_CODE_STUBS_H_ | 2690 #endif // V8_CODE_STUBS_H_ |
| OLD | NEW |