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/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 207 // GC. This means that we must be statically sure that no GC can occur while | 207 // GC. This means that we must be statically sure that no GC can occur while |
| 208 // they are running. If that is the case they should override this to return | 208 // they are running. If that is the case they should override this to return |
| 209 // true, which will cause an assertion if we try to call something that can | 209 // true, which will cause an assertion if we try to call something that can |
| 210 // GC or if we try to put a stack frame on top of the junk, which would not | 210 // GC or if we try to put a stack frame on top of the junk, which would not |
| 211 // result in a traversable stack. | 211 // result in a traversable stack. |
| 212 virtual bool SometimesSetsUpAFrame() { return true; } | 212 virtual bool SometimesSetsUpAFrame() { return true; } |
| 213 | 213 |
| 214 // Lookup the code in the (possibly custom) cache. | 214 // Lookup the code in the (possibly custom) cache. |
| 215 bool FindCodeInCache(Code** code_out); | 215 bool FindCodeInCache(Code** code_out); |
| 216 | 216 |
| 217 virtual CallInterfaceDescriptor GetCallInterfaceDescriptor() = 0; | 217 virtual CallInterfaceDescriptor GetCallInterfaceDescriptor() const = 0; |
|
mvstanton
2015/07/01 08:33:24
Why do you have to take const away?
danno
2015/07/01 08:43:16
I'm not taking it away... I'm adding it ;-)
| |
| 218 | 218 |
| 219 virtual int GetStackParameterCount() const { return 0; } | 219 virtual int GetStackParameterCount() const { return 0; } |
| 220 | 220 |
| 221 virtual void InitializeDescriptor(CodeStubDescriptor* descriptor) {} | 221 virtual void InitializeDescriptor(CodeStubDescriptor* descriptor) {} |
| 222 | 222 |
| 223 static void InitializeDescriptor(Isolate* isolate, uint32_t key, | 223 static void InitializeDescriptor(Isolate* isolate, uint32_t key, |
| 224 CodeStubDescriptor* desc); | 224 CodeStubDescriptor* desc); |
| 225 | 225 |
| 226 static MaybeHandle<Code> GetCode(Isolate* isolate, uint32_t key); | 226 static MaybeHandle<Code> GetCode(Isolate* isolate, uint32_t key); |
| 227 | 227 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 315 // currently compiling some kind of code stub. Remove this when the pipeline and | 315 // currently compiling some kind of code stub. Remove this when the pipeline and |
| 316 // testing machinery is restructured in such a way that we don't have to come up | 316 // testing machinery is restructured in such a way that we don't have to come up |
| 317 // with a CompilationInfo out of thin air, although we only need a few parts of | 317 // with a CompilationInfo out of thin air, although we only need a few parts of |
| 318 // it. | 318 // it. |
| 319 struct FakeStubForTesting : public CodeStub { | 319 struct FakeStubForTesting : public CodeStub { |
| 320 explicit FakeStubForTesting(Isolate* isolate) : CodeStub(isolate) {} | 320 explicit FakeStubForTesting(Isolate* isolate) : CodeStub(isolate) {} |
| 321 | 321 |
| 322 // Only used by pipeline.cc's GetDebugName in DEBUG mode. | 322 // Only used by pipeline.cc's GetDebugName in DEBUG mode. |
| 323 Major MajorKey() const override { return CodeStub::NoCache; } | 323 Major MajorKey() const override { return CodeStub::NoCache; } |
| 324 | 324 |
| 325 CallInterfaceDescriptor GetCallInterfaceDescriptor() override { | 325 CallInterfaceDescriptor GetCallInterfaceDescriptor() const override { |
| 326 UNREACHABLE(); | 326 UNREACHABLE(); |
| 327 return CallInterfaceDescriptor(); | 327 return CallInterfaceDescriptor(); |
| 328 } | 328 } |
| 329 | 329 |
| 330 Handle<Code> GenerateCode() override { | 330 Handle<Code> GenerateCode() override { |
| 331 UNREACHABLE(); | 331 UNREACHABLE(); |
| 332 return Handle<Code>(); | 332 return Handle<Code>(); |
| 333 } | 333 } |
| 334 }; | 334 }; |
| 335 | 335 |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 358 public: \ | 358 public: \ |
| 359 void InitializeDescriptor(CodeStubDescriptor* descriptor) override; \ | 359 void InitializeDescriptor(CodeStubDescriptor* descriptor) override; \ |
| 360 Handle<Code> GenerateCode() override; \ | 360 Handle<Code> GenerateCode() override; \ |
| 361 DEFINE_CODE_STUB(NAME, SUPER) | 361 DEFINE_CODE_STUB(NAME, SUPER) |
| 362 | 362 |
| 363 #define DEFINE_HANDLER_CODE_STUB(NAME, SUPER) \ | 363 #define DEFINE_HANDLER_CODE_STUB(NAME, SUPER) \ |
| 364 public: \ | 364 public: \ |
| 365 Handle<Code> GenerateCode() override; \ | 365 Handle<Code> GenerateCode() override; \ |
| 366 DEFINE_CODE_STUB(NAME, SUPER) | 366 DEFINE_CODE_STUB(NAME, SUPER) |
| 367 | 367 |
| 368 #define DEFINE_CALL_INTERFACE_DESCRIPTOR(NAME) \ | 368 #define DEFINE_CALL_INTERFACE_DESCRIPTOR(NAME) \ |
| 369 public: \ | 369 public: \ |
| 370 CallInterfaceDescriptor GetCallInterfaceDescriptor() override { \ | 370 CallInterfaceDescriptor GetCallInterfaceDescriptor() const override { \ |
| 371 return NAME##Descriptor(isolate()); \ | 371 return NAME##Descriptor(isolate()); \ |
| 372 } | 372 } |
| 373 | 373 |
| 374 // There are some code stubs we just can't describe right now with a | 374 // There are some code stubs we just can't describe right now with a |
| 375 // CallInterfaceDescriptor. Isolate behavior for those cases with this macro. | 375 // CallInterfaceDescriptor. Isolate behavior for those cases with this macro. |
| 376 // An attempt to retrieve a descriptor will fail. | 376 // An attempt to retrieve a descriptor will fail. |
| 377 #define DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR() \ | 377 #define DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR() \ |
| 378 public: \ | 378 public: \ |
| 379 CallInterfaceDescriptor GetCallInterfaceDescriptor() override { \ | 379 CallInterfaceDescriptor GetCallInterfaceDescriptor() const override { \ |
| 380 UNREACHABLE(); \ | 380 UNREACHABLE(); \ |
| 381 return CallInterfaceDescriptor(); \ | 381 return CallInterfaceDescriptor(); \ |
| 382 } | 382 } |
| 383 | 383 |
| 384 | 384 |
| 385 class PlatformCodeStub : public CodeStub { | 385 class PlatformCodeStub : public CodeStub { |
| 386 public: | 386 public: |
| 387 // Retrieve the code for the stub. Generate the code if needed. | 387 // Retrieve the code for the stub. Generate the code if needed. |
| 388 Handle<Code> GenerateCode() override; | 388 Handle<Code> GenerateCode() override; |
| 389 | 389 |
| 390 protected: | 390 protected: |
| 391 explicit PlatformCodeStub(Isolate* isolate) : CodeStub(isolate) {} | 391 explicit PlatformCodeStub(Isolate* isolate) : CodeStub(isolate) {} |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 420 miss_handler_ = handler; | 420 miss_handler_ = handler; |
| 421 has_miss_handler_ = true; | 421 has_miss_handler_ = true; |
| 422 // Our miss handler infrastructure doesn't currently support | 422 // Our miss handler infrastructure doesn't currently support |
| 423 // variable stack parameter counts. | 423 // variable stack parameter counts. |
| 424 DCHECK(!stack_parameter_count_.is_valid()); | 424 DCHECK(!stack_parameter_count_.is_valid()); |
| 425 } | 425 } |
| 426 | 426 |
| 427 void set_call_descriptor(CallInterfaceDescriptor d) { call_descriptor_ = d; } | 427 void set_call_descriptor(CallInterfaceDescriptor d) { call_descriptor_ = d; } |
| 428 CallInterfaceDescriptor call_descriptor() const { return call_descriptor_; } | 428 CallInterfaceDescriptor call_descriptor() const { return call_descriptor_; } |
| 429 | 429 |
| 430 int GetEnvironmentParameterCount() const { | 430 int GetRegisterParameterCount() const { |
| 431 return call_descriptor().GetEnvironmentParameterCount(); | 431 return call_descriptor().GetRegisterParameterCount(); |
| 432 } | 432 } |
| 433 | 433 |
| 434 Type* GetEnvironmentParameterType(int index) const { | 434 Register GetRegisterParameter(int index) const { |
| 435 return call_descriptor().GetEnvironmentParameterType(index); | 435 return call_descriptor().GetRegisterParameter(index); |
| 436 } | |
| 437 | |
| 438 Type* GetParameterType(int index) const { | |
| 439 return call_descriptor().GetParameterType(index); | |
| 436 } | 440 } |
| 437 | 441 |
| 438 ExternalReference miss_handler() const { | 442 ExternalReference miss_handler() const { |
| 439 DCHECK(has_miss_handler_); | 443 DCHECK(has_miss_handler_); |
| 440 return miss_handler_; | 444 return miss_handler_; |
| 441 } | 445 } |
| 442 | 446 |
| 443 bool has_miss_handler() const { | 447 bool has_miss_handler() const { |
| 444 return has_miss_handler_; | 448 return has_miss_handler_; |
| 445 } | 449 } |
| 446 | 450 |
| 447 bool IsEnvironmentParameterCountRegister(int index) const { | |
| 448 return call_descriptor().GetEnvironmentParameterRegister(index).is( | |
| 449 stack_parameter_count_); | |
| 450 } | |
| 451 | |
| 452 int GetHandlerParameterCount() const { | 451 int GetHandlerParameterCount() const { |
| 453 int params = call_descriptor().GetEnvironmentParameterCount(); | 452 int params = GetRegisterParameterCount(); |
| 454 if (handler_arguments_mode_ == PASS_ARGUMENTS) { | 453 if (handler_arguments_mode_ == PASS_ARGUMENTS) { |
| 455 params += 1; | 454 params += 1; |
| 456 } | 455 } |
| 457 return params; | 456 return params; |
| 458 } | 457 } |
| 459 | 458 |
| 460 int hint_stack_parameter_count() const { return hint_stack_parameter_count_; } | 459 int hint_stack_parameter_count() const { return hint_stack_parameter_count_; } |
| 461 Register stack_parameter_count() const { return stack_parameter_count_; } | 460 Register stack_parameter_count() const { return stack_parameter_count_; } |
| 462 StubFunctionMode function_mode() const { return function_mode_; } | 461 StubFunctionMode function_mode() const { return function_mode_; } |
| 463 Address deoptimization_handler() const { return deoptimization_handler_; } | 462 Address deoptimization_handler() const { return deoptimization_handler_; } |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 524 | 523 |
| 525 DEFINE_CODE_STUB_BASE(HydrogenCodeStub, CodeStub); | 524 DEFINE_CODE_STUB_BASE(HydrogenCodeStub, CodeStub); |
| 526 }; | 525 }; |
| 527 | 526 |
| 528 | 527 |
| 529 class TurboFanCodeStub : public CodeStub { | 528 class TurboFanCodeStub : public CodeStub { |
| 530 public: | 529 public: |
| 531 // Retrieve the code for the stub. Generate the code if needed. | 530 // Retrieve the code for the stub. Generate the code if needed. |
| 532 Handle<Code> GenerateCode() override; | 531 Handle<Code> GenerateCode() override; |
| 533 | 532 |
| 533 virtual int GetStackParameterCount() const override { | |
| 534 return GetCallInterfaceDescriptor().GetStackParameterCount(); | |
| 535 } | |
| 536 | |
| 534 Code::StubType GetStubType() const override { return Code::FAST; } | 537 Code::StubType GetStubType() const override { return Code::FAST; } |
| 535 | 538 |
| 536 protected: | 539 protected: |
| 537 explicit TurboFanCodeStub(Isolate* isolate) : CodeStub(isolate) {} | 540 explicit TurboFanCodeStub(Isolate* isolate) : CodeStub(isolate) {} |
| 538 | 541 |
| 539 private: | 542 private: |
| 540 DEFINE_CODE_STUB_BASE(TurboFanCodeStub, CodeStub); | 543 DEFINE_CODE_STUB_BASE(TurboFanCodeStub, CodeStub); |
| 541 }; | 544 }; |
| 542 | 545 |
| 543 | 546 |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 845 kReturnTrueFalseObject = 1 << 2 | 848 kReturnTrueFalseObject = 1 << 2 |
| 846 }; | 849 }; |
| 847 | 850 |
| 848 InstanceofStub(Isolate* isolate, Flags flags) : PlatformCodeStub(isolate) { | 851 InstanceofStub(Isolate* isolate, Flags flags) : PlatformCodeStub(isolate) { |
| 849 minor_key_ = FlagBits::encode(flags); | 852 minor_key_ = FlagBits::encode(flags); |
| 850 } | 853 } |
| 851 | 854 |
| 852 static Register left() { return InstanceofDescriptor::left(); } | 855 static Register left() { return InstanceofDescriptor::left(); } |
| 853 static Register right() { return InstanceofDescriptor::right(); } | 856 static Register right() { return InstanceofDescriptor::right(); } |
| 854 | 857 |
| 855 CallInterfaceDescriptor GetCallInterfaceDescriptor() override { | 858 CallInterfaceDescriptor GetCallInterfaceDescriptor() const override { |
| 856 if (HasArgsInRegisters()) { | 859 if (HasArgsInRegisters()) { |
| 857 return InstanceofDescriptor(isolate()); | 860 return InstanceofDescriptor(isolate()); |
| 858 } | 861 } |
| 859 return ContextOnlyDescriptor(isolate()); | 862 return ContextOnlyDescriptor(isolate()); |
| 860 } | 863 } |
| 861 | 864 |
| 862 private: | 865 private: |
| 863 Flags flags() const { return FlagBits::decode(minor_key_); } | 866 Flags flags() const { return FlagBits::decode(minor_key_); } |
| 864 | 867 |
| 865 bool HasArgsInRegisters() const { return (flags() & kArgsInRegisters) != 0; } | 868 bool HasArgsInRegisters() const { return (flags() & kArgsInRegisters) != 0; } |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 926 | 929 |
| 927 class MathPowStub: public PlatformCodeStub { | 930 class MathPowStub: public PlatformCodeStub { |
| 928 public: | 931 public: |
| 929 enum ExponentType { INTEGER, DOUBLE, TAGGED, ON_STACK }; | 932 enum ExponentType { INTEGER, DOUBLE, TAGGED, ON_STACK }; |
| 930 | 933 |
| 931 MathPowStub(Isolate* isolate, ExponentType exponent_type) | 934 MathPowStub(Isolate* isolate, ExponentType exponent_type) |
| 932 : PlatformCodeStub(isolate) { | 935 : PlatformCodeStub(isolate) { |
| 933 minor_key_ = ExponentTypeBits::encode(exponent_type); | 936 minor_key_ = ExponentTypeBits::encode(exponent_type); |
| 934 } | 937 } |
| 935 | 938 |
| 936 CallInterfaceDescriptor GetCallInterfaceDescriptor() override { | 939 CallInterfaceDescriptor GetCallInterfaceDescriptor() const override { |
| 937 if (exponent_type() == TAGGED) { | 940 if (exponent_type() == TAGGED) { |
| 938 return MathPowTaggedDescriptor(isolate()); | 941 return MathPowTaggedDescriptor(isolate()); |
| 939 } else if (exponent_type() == INTEGER) { | 942 } else if (exponent_type() == INTEGER) { |
| 940 return MathPowIntegerDescriptor(isolate()); | 943 return MathPowIntegerDescriptor(isolate()); |
| 941 } | 944 } |
| 942 // A CallInterfaceDescriptor doesn't specify double registers (yet). | 945 // A CallInterfaceDescriptor doesn't specify double registers (yet). |
| 943 return ContextOnlyDescriptor(isolate()); | 946 return ContextOnlyDescriptor(isolate()); |
| 944 } | 947 } |
| 945 | 948 |
| 946 private: | 949 private: |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1014 class FunctionPrototypeStub : public PlatformCodeStub { | 1017 class FunctionPrototypeStub : public PlatformCodeStub { |
| 1015 public: | 1018 public: |
| 1016 explicit FunctionPrototypeStub(Isolate* isolate) | 1019 explicit FunctionPrototypeStub(Isolate* isolate) |
| 1017 : PlatformCodeStub(isolate) {} | 1020 : PlatformCodeStub(isolate) {} |
| 1018 | 1021 |
| 1019 Code::Kind GetCodeKind() const override { return Code::HANDLER; } | 1022 Code::Kind GetCodeKind() const override { return Code::HANDLER; } |
| 1020 | 1023 |
| 1021 // TODO(mvstanton): only the receiver register is accessed. When this is | 1024 // TODO(mvstanton): only the receiver register is accessed. When this is |
| 1022 // translated to a hydrogen code stub, a new CallInterfaceDescriptor | 1025 // translated to a hydrogen code stub, a new CallInterfaceDescriptor |
| 1023 // should be created that just uses that register for more efficient code. | 1026 // should be created that just uses that register for more efficient code. |
| 1024 CallInterfaceDescriptor GetCallInterfaceDescriptor() override { | 1027 CallInterfaceDescriptor GetCallInterfaceDescriptor() const override { |
| 1025 return LoadWithVectorDescriptor(isolate()); | 1028 return LoadWithVectorDescriptor(isolate()); |
| 1026 } | 1029 } |
| 1027 | 1030 |
| 1028 DEFINE_PLATFORM_CODE_STUB(FunctionPrototype, PlatformCodeStub); | 1031 DEFINE_PLATFORM_CODE_STUB(FunctionPrototype, PlatformCodeStub); |
| 1029 }; | 1032 }; |
| 1030 | 1033 |
| 1031 | 1034 |
| 1032 // TODO(mvstanton): Translate to hydrogen code stub. | 1035 // TODO(mvstanton): Translate to hydrogen code stub. |
| 1033 class LoadIndexedInterceptorStub : public PlatformCodeStub { | 1036 class LoadIndexedInterceptorStub : public PlatformCodeStub { |
| 1034 public: | 1037 public: |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 1057 | 1060 |
| 1058 | 1061 |
| 1059 class HandlerStub : public HydrogenCodeStub { | 1062 class HandlerStub : public HydrogenCodeStub { |
| 1060 public: | 1063 public: |
| 1061 Code::Kind GetCodeKind() const override { return Code::HANDLER; } | 1064 Code::Kind GetCodeKind() const override { return Code::HANDLER; } |
| 1062 ExtraICState GetExtraICState() const override { return kind(); } | 1065 ExtraICState GetExtraICState() const override { return kind(); } |
| 1063 InlineCacheState GetICState() const override { return MONOMORPHIC; } | 1066 InlineCacheState GetICState() const override { return MONOMORPHIC; } |
| 1064 | 1067 |
| 1065 void InitializeDescriptor(CodeStubDescriptor* descriptor) override; | 1068 void InitializeDescriptor(CodeStubDescriptor* descriptor) override; |
| 1066 | 1069 |
| 1067 CallInterfaceDescriptor GetCallInterfaceDescriptor() override; | 1070 CallInterfaceDescriptor GetCallInterfaceDescriptor() const override; |
| 1068 | 1071 |
| 1069 protected: | 1072 protected: |
| 1070 explicit HandlerStub(Isolate* isolate) : HydrogenCodeStub(isolate) {} | 1073 explicit HandlerStub(Isolate* isolate) : HydrogenCodeStub(isolate) {} |
| 1071 | 1074 |
| 1072 virtual Code::Kind kind() const = 0; | 1075 virtual Code::Kind kind() const = 0; |
| 1073 | 1076 |
| 1074 DEFINE_CODE_STUB_BASE(HandlerStub, HydrogenCodeStub); | 1077 DEFINE_CODE_STUB_BASE(HandlerStub, HydrogenCodeStub); |
| 1075 }; | 1078 }; |
| 1076 | 1079 |
| 1077 | 1080 |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1251 Representation representation() { | 1254 Representation representation() { |
| 1252 DCHECK(store_mode() != StoreMapOnly); | 1255 DCHECK(store_mode() != StoreMapOnly); |
| 1253 uint8_t repr = RepresentationBits::decode(sub_minor_key()); | 1256 uint8_t repr = RepresentationBits::decode(sub_minor_key()); |
| 1254 return PropertyDetails::DecodeRepresentation(repr); | 1257 return PropertyDetails::DecodeRepresentation(repr); |
| 1255 } | 1258 } |
| 1256 | 1259 |
| 1257 StoreMode store_mode() const { | 1260 StoreMode store_mode() const { |
| 1258 return StoreModeBits::decode(sub_minor_key()); | 1261 return StoreModeBits::decode(sub_minor_key()); |
| 1259 } | 1262 } |
| 1260 | 1263 |
| 1261 CallInterfaceDescriptor GetCallInterfaceDescriptor() override; | 1264 CallInterfaceDescriptor GetCallInterfaceDescriptor() const override; |
| 1262 | 1265 |
| 1263 protected: | 1266 protected: |
| 1264 Code::Kind kind() const override { return Code::STORE_IC; } | 1267 Code::Kind kind() const override { return Code::STORE_IC; } |
| 1265 Code::StubType GetStubType() const override { return Code::FAST; } | 1268 Code::StubType GetStubType() const override { return Code::FAST; } |
| 1266 | 1269 |
| 1267 private: | 1270 private: |
| 1268 class StoreFieldByIndexBits : public BitField<int, 0, 13> {}; | 1271 class StoreFieldByIndexBits : public BitField<int, 0, 13> {}; |
| 1269 class RepresentationBits : public BitField<uint8_t, 13, 4> {}; | 1272 class RepresentationBits : public BitField<uint8_t, 13, 4> {}; |
| 1270 class StoreModeBits : public BitField<StoreMode, 17, 2> {}; | 1273 class StoreModeBits : public BitField<StoreMode, 17, 2> {}; |
| 1271 | 1274 |
| (...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1782 READ_ELEMENT, | 1785 READ_ELEMENT, |
| 1783 NEW_SLOPPY_FAST, | 1786 NEW_SLOPPY_FAST, |
| 1784 NEW_SLOPPY_SLOW, | 1787 NEW_SLOPPY_SLOW, |
| 1785 NEW_STRICT | 1788 NEW_STRICT |
| 1786 }; | 1789 }; |
| 1787 | 1790 |
| 1788 ArgumentsAccessStub(Isolate* isolate, Type type) : PlatformCodeStub(isolate) { | 1791 ArgumentsAccessStub(Isolate* isolate, Type type) : PlatformCodeStub(isolate) { |
| 1789 minor_key_ = TypeBits::encode(type); | 1792 minor_key_ = TypeBits::encode(type); |
| 1790 } | 1793 } |
| 1791 | 1794 |
| 1792 CallInterfaceDescriptor GetCallInterfaceDescriptor() override { | 1795 CallInterfaceDescriptor GetCallInterfaceDescriptor() const override { |
| 1793 if (type() == READ_ELEMENT) { | 1796 if (type() == READ_ELEMENT) { |
| 1794 return ArgumentsAccessReadDescriptor(isolate()); | 1797 return ArgumentsAccessReadDescriptor(isolate()); |
| 1795 } | 1798 } |
| 1796 return ContextOnlyDescriptor(isolate()); | 1799 return ContextOnlyDescriptor(isolate()); |
| 1797 } | 1800 } |
| 1798 | 1801 |
| 1799 private: | 1802 private: |
| 1800 Type type() const { return TypeBits::decode(minor_key_); } | 1803 Type type() const { return TypeBits::decode(minor_key_); } |
| 1801 | 1804 |
| 1802 void GenerateReadElement(MacroAssembler* masm); | 1805 void GenerateReadElement(MacroAssembler* masm); |
| 1803 void GenerateNewStrict(MacroAssembler* masm); | 1806 void GenerateNewStrict(MacroAssembler* masm); |
| 1804 void GenerateNewSloppyFast(MacroAssembler* masm); | 1807 void GenerateNewSloppyFast(MacroAssembler* masm); |
| 1805 void GenerateNewSloppySlow(MacroAssembler* masm); | 1808 void GenerateNewSloppySlow(MacroAssembler* masm); |
| 1806 | 1809 |
| 1807 void PrintName(std::ostream& os) const override; // NOLINT | 1810 void PrintName(std::ostream& os) const override; // NOLINT |
| 1808 | 1811 |
| 1809 class TypeBits : public BitField<Type, 0, 2> {}; | 1812 class TypeBits : public BitField<Type, 0, 2> {}; |
| 1810 | 1813 |
| 1811 DEFINE_PLATFORM_CODE_STUB(ArgumentsAccess, PlatformCodeStub); | 1814 DEFINE_PLATFORM_CODE_STUB(ArgumentsAccess, PlatformCodeStub); |
| 1812 }; | 1815 }; |
| 1813 | 1816 |
| 1814 | 1817 |
| 1815 class RestParamAccessStub: public PlatformCodeStub { | 1818 class RestParamAccessStub: public PlatformCodeStub { |
| 1816 public: | 1819 public: |
| 1817 explicit RestParamAccessStub(Isolate* isolate) : PlatformCodeStub(isolate) { } | 1820 explicit RestParamAccessStub(Isolate* isolate) : PlatformCodeStub(isolate) { } |
| 1818 | 1821 |
| 1819 CallInterfaceDescriptor GetCallInterfaceDescriptor() override { | 1822 CallInterfaceDescriptor GetCallInterfaceDescriptor() const override { |
| 1820 return ContextOnlyDescriptor(isolate()); | 1823 return ContextOnlyDescriptor(isolate()); |
| 1821 } | 1824 } |
| 1822 | 1825 |
| 1823 private: | 1826 private: |
| 1824 void GenerateNew(MacroAssembler* masm); | 1827 void GenerateNew(MacroAssembler* masm); |
| 1825 | 1828 |
| 1826 void PrintName(std::ostream& os) const override; // NOLINT | 1829 void PrintName(std::ostream& os) const override; // NOLINT |
| 1827 | 1830 |
| 1828 DEFINE_PLATFORM_CODE_STUB(RestParamAccess, PlatformCodeStub); | 1831 DEFINE_PLATFORM_CODE_STUB(RestParamAccess, PlatformCodeStub); |
| 1829 }; | 1832 }; |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2101 | 2104 |
| 2102 DISALLOW_COPY_AND_ASSIGN(StringCharAtGenerator); | 2105 DISALLOW_COPY_AND_ASSIGN(StringCharAtGenerator); |
| 2103 }; | 2106 }; |
| 2104 | 2107 |
| 2105 | 2108 |
| 2106 class LoadDictionaryElementStub : public HydrogenCodeStub { | 2109 class LoadDictionaryElementStub : public HydrogenCodeStub { |
| 2107 public: | 2110 public: |
| 2108 explicit LoadDictionaryElementStub(Isolate* isolate) | 2111 explicit LoadDictionaryElementStub(Isolate* isolate) |
| 2109 : HydrogenCodeStub(isolate) {} | 2112 : HydrogenCodeStub(isolate) {} |
| 2110 | 2113 |
| 2111 CallInterfaceDescriptor GetCallInterfaceDescriptor() override { | 2114 CallInterfaceDescriptor GetCallInterfaceDescriptor() const override { |
| 2112 return LoadWithVectorDescriptor(isolate()); | 2115 return LoadWithVectorDescriptor(isolate()); |
| 2113 } | 2116 } |
| 2114 | 2117 |
| 2115 DEFINE_HYDROGEN_CODE_STUB(LoadDictionaryElement, HydrogenCodeStub); | 2118 DEFINE_HYDROGEN_CODE_STUB(LoadDictionaryElement, HydrogenCodeStub); |
| 2116 }; | 2119 }; |
| 2117 | 2120 |
| 2118 | 2121 |
| 2119 class KeyedLoadGenericStub : public HydrogenCodeStub { | 2122 class KeyedLoadGenericStub : public HydrogenCodeStub { |
| 2120 public: | 2123 public: |
| 2121 explicit KeyedLoadGenericStub(Isolate* isolate) : HydrogenCodeStub(isolate) {} | 2124 explicit KeyedLoadGenericStub(Isolate* isolate) : HydrogenCodeStub(isolate) {} |
| (...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2961 #undef DEFINE_PLATFORM_CODE_STUB | 2964 #undef DEFINE_PLATFORM_CODE_STUB |
| 2962 #undef DEFINE_HANDLER_CODE_STUB | 2965 #undef DEFINE_HANDLER_CODE_STUB |
| 2963 #undef DEFINE_HYDROGEN_CODE_STUB | 2966 #undef DEFINE_HYDROGEN_CODE_STUB |
| 2964 #undef DEFINE_CODE_STUB | 2967 #undef DEFINE_CODE_STUB |
| 2965 #undef DEFINE_CODE_STUB_BASE | 2968 #undef DEFINE_CODE_STUB_BASE |
| 2966 | 2969 |
| 2967 extern Representation RepresentationFromType(Type* type); | 2970 extern Representation RepresentationFromType(Type* type); |
| 2968 } } // namespace v8::internal | 2971 } } // namespace v8::internal |
| 2969 | 2972 |
| 2970 #endif // V8_CODE_STUBS_H_ | 2973 #endif // V8_CODE_STUBS_H_ |
| OLD | NEW |