| 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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 // TODO(svenpanne) This class is only used to construct a more or less sensible | 298 // TODO(svenpanne) This class is only used to construct a more or less sensible |
| 299 // CompilationInfo for testing purposes, basically pretending that we are | 299 // CompilationInfo for testing purposes, basically pretending that we are |
| 300 // currently compiling some kind of code stub. Remove this when the pipeline and | 300 // currently compiling some kind of code stub. Remove this when the pipeline and |
| 301 // testing machinery is restructured in such a way that we don't have to come up | 301 // testing machinery is restructured in such a way that we don't have to come up |
| 302 // with a CompilationInfo out of thin air, although we only need a few parts of | 302 // with a CompilationInfo out of thin air, although we only need a few parts of |
| 303 // it. | 303 // it. |
| 304 struct FakeStubForTesting : public CodeStub { | 304 struct FakeStubForTesting : public CodeStub { |
| 305 explicit FakeStubForTesting(Isolate* isolate) : CodeStub(isolate) {} | 305 explicit FakeStubForTesting(Isolate* isolate) : CodeStub(isolate) {} |
| 306 | 306 |
| 307 // Only used by pipeline.cc's GetDebugName in DEBUG mode. | 307 // Only used by pipeline.cc's GetDebugName in DEBUG mode. |
| 308 Major MajorKey() const OVERRIDE { return CodeStub::NoCache; } | 308 Major MajorKey() const override { return CodeStub::NoCache; } |
| 309 | 309 |
| 310 CallInterfaceDescriptor GetCallInterfaceDescriptor() OVERRIDE { | 310 CallInterfaceDescriptor GetCallInterfaceDescriptor() override { |
| 311 UNREACHABLE(); | 311 UNREACHABLE(); |
| 312 return CallInterfaceDescriptor(); | 312 return CallInterfaceDescriptor(); |
| 313 } | 313 } |
| 314 | 314 |
| 315 Handle<Code> GenerateCode() OVERRIDE { | 315 Handle<Code> GenerateCode() override { |
| 316 UNREACHABLE(); | 316 UNREACHABLE(); |
| 317 return Handle<Code>(); | 317 return Handle<Code>(); |
| 318 } | 318 } |
| 319 }; | 319 }; |
| 320 | 320 |
| 321 | 321 |
| 322 #define DEFINE_CODE_STUB_BASE(NAME, SUPER) \ | 322 #define DEFINE_CODE_STUB_BASE(NAME, SUPER) \ |
| 323 public: \ | 323 public: \ |
| 324 NAME(uint32_t key, Isolate* isolate) : SUPER(key, isolate) {} \ | 324 NAME(uint32_t key, Isolate* isolate) : SUPER(key, isolate) {} \ |
| 325 \ | 325 \ |
| 326 private: \ | 326 private: \ |
| 327 DISALLOW_COPY_AND_ASSIGN(NAME) | 327 DISALLOW_COPY_AND_ASSIGN(NAME) |
| 328 | 328 |
| 329 | 329 |
| 330 #define DEFINE_CODE_STUB(NAME, SUPER) \ | 330 #define DEFINE_CODE_STUB(NAME, SUPER) \ |
| 331 protected: \ | 331 protected: \ |
| 332 inline Major MajorKey() const OVERRIDE { return NAME; }; \ | 332 inline Major MajorKey() const override { return NAME; }; \ |
| 333 DEFINE_CODE_STUB_BASE(NAME##Stub, SUPER) | 333 DEFINE_CODE_STUB_BASE(NAME##Stub, SUPER) |
| 334 | 334 |
| 335 | 335 |
| 336 #define DEFINE_PLATFORM_CODE_STUB(NAME, SUPER) \ | 336 #define DEFINE_PLATFORM_CODE_STUB(NAME, SUPER) \ |
| 337 private: \ | 337 private: \ |
| 338 void Generate(MacroAssembler* masm) OVERRIDE; \ | 338 void Generate(MacroAssembler* masm) override; \ |
| 339 DEFINE_CODE_STUB(NAME, SUPER) | 339 DEFINE_CODE_STUB(NAME, SUPER) |
| 340 | 340 |
| 341 | 341 |
| 342 #define DEFINE_HYDROGEN_CODE_STUB(NAME, SUPER) \ | 342 #define DEFINE_HYDROGEN_CODE_STUB(NAME, SUPER) \ |
| 343 public: \ | 343 public: \ |
| 344 void InitializeDescriptor(CodeStubDescriptor* descriptor) OVERRIDE; \ | 344 void InitializeDescriptor(CodeStubDescriptor* descriptor) override; \ |
| 345 Handle<Code> GenerateCode() OVERRIDE; \ | 345 Handle<Code> GenerateCode() override; \ |
| 346 DEFINE_CODE_STUB(NAME, SUPER) | 346 DEFINE_CODE_STUB(NAME, SUPER) |
| 347 | 347 |
| 348 #define DEFINE_HANDLER_CODE_STUB(NAME, SUPER) \ | 348 #define DEFINE_HANDLER_CODE_STUB(NAME, SUPER) \ |
| 349 public: \ | 349 public: \ |
| 350 Handle<Code> GenerateCode() OVERRIDE; \ | 350 Handle<Code> GenerateCode() override; \ |
| 351 DEFINE_CODE_STUB(NAME, SUPER) | 351 DEFINE_CODE_STUB(NAME, SUPER) |
| 352 | 352 |
| 353 #define DEFINE_CALL_INTERFACE_DESCRIPTOR(NAME) \ | 353 #define DEFINE_CALL_INTERFACE_DESCRIPTOR(NAME) \ |
| 354 public: \ | 354 public: \ |
| 355 CallInterfaceDescriptor GetCallInterfaceDescriptor() OVERRIDE { \ | 355 CallInterfaceDescriptor GetCallInterfaceDescriptor() override { \ |
| 356 return NAME##Descriptor(isolate()); \ | 356 return NAME##Descriptor(isolate()); \ |
| 357 } | 357 } |
| 358 | 358 |
| 359 // There are some code stubs we just can't describe right now with a | 359 // There are some code stubs we just can't describe right now with a |
| 360 // CallInterfaceDescriptor. Isolate behavior for those cases with this macro. | 360 // CallInterfaceDescriptor. Isolate behavior for those cases with this macro. |
| 361 // An attempt to retrieve a descriptor will fail. | 361 // An attempt to retrieve a descriptor will fail. |
| 362 #define DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR() \ | 362 #define DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR() \ |
| 363 public: \ | 363 public: \ |
| 364 CallInterfaceDescriptor GetCallInterfaceDescriptor() OVERRIDE { \ | 364 CallInterfaceDescriptor GetCallInterfaceDescriptor() override { \ |
| 365 UNREACHABLE(); \ | 365 UNREACHABLE(); \ |
| 366 return CallInterfaceDescriptor(); \ | 366 return CallInterfaceDescriptor(); \ |
| 367 } | 367 } |
| 368 | 368 |
| 369 | 369 |
| 370 class PlatformCodeStub : public CodeStub { | 370 class PlatformCodeStub : public CodeStub { |
| 371 public: | 371 public: |
| 372 // Retrieve the code for the stub. Generate the code if needed. | 372 // Retrieve the code for the stub. Generate the code if needed. |
| 373 Handle<Code> GenerateCode() OVERRIDE; | 373 Handle<Code> GenerateCode() override; |
| 374 | 374 |
| 375 Code::Kind GetCodeKind() const OVERRIDE { return Code::STUB; } | 375 Code::Kind GetCodeKind() const override { return Code::STUB; } |
| 376 | 376 |
| 377 protected: | 377 protected: |
| 378 explicit PlatformCodeStub(Isolate* isolate) : CodeStub(isolate) {} | 378 explicit PlatformCodeStub(Isolate* isolate) : CodeStub(isolate) {} |
| 379 | 379 |
| 380 // Generates the assembler code for the stub. | 380 // Generates the assembler code for the stub. |
| 381 virtual void Generate(MacroAssembler* masm) = 0; | 381 virtual void Generate(MacroAssembler* masm) = 0; |
| 382 | 382 |
| 383 DEFINE_CODE_STUB_BASE(PlatformCodeStub, CodeStub); | 383 DEFINE_CODE_STUB_BASE(PlatformCodeStub, CodeStub); |
| 384 }; | 384 }; |
| 385 | 385 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 }; | 465 }; |
| 466 | 466 |
| 467 | 467 |
| 468 class HydrogenCodeStub : public CodeStub { | 468 class HydrogenCodeStub : public CodeStub { |
| 469 public: | 469 public: |
| 470 enum InitializationState { | 470 enum InitializationState { |
| 471 UNINITIALIZED, | 471 UNINITIALIZED, |
| 472 INITIALIZED | 472 INITIALIZED |
| 473 }; | 473 }; |
| 474 | 474 |
| 475 Code::Kind GetCodeKind() const OVERRIDE { return Code::STUB; } | 475 Code::Kind GetCodeKind() const override { return Code::STUB; } |
| 476 | 476 |
| 477 template<class SubClass> | 477 template<class SubClass> |
| 478 static Handle<Code> GetUninitialized(Isolate* isolate) { | 478 static Handle<Code> GetUninitialized(Isolate* isolate) { |
| 479 SubClass::GenerateAheadOfTime(isolate); | 479 SubClass::GenerateAheadOfTime(isolate); |
| 480 return SubClass().GetCode(isolate); | 480 return SubClass().GetCode(isolate); |
| 481 } | 481 } |
| 482 | 482 |
| 483 // Retrieve the code for the stub. Generate the code if needed. | 483 // Retrieve the code for the stub. Generate the code if needed. |
| 484 Handle<Code> GenerateCode() OVERRIDE = 0; | 484 Handle<Code> GenerateCode() override = 0; |
| 485 | 485 |
| 486 bool IsUninitialized() const { return IsMissBits::decode(minor_key_); } | 486 bool IsUninitialized() const { return IsMissBits::decode(minor_key_); } |
| 487 | 487 |
| 488 Handle<Code> GenerateLightweightMissCode(ExternalReference miss); | 488 Handle<Code> GenerateLightweightMissCode(ExternalReference miss); |
| 489 | 489 |
| 490 template<class StateType> | 490 template<class StateType> |
| 491 void TraceTransition(StateType from, StateType to); | 491 void TraceTransition(StateType from, StateType to); |
| 492 | 492 |
| 493 protected: | 493 protected: |
| 494 explicit HydrogenCodeStub(Isolate* isolate, | 494 explicit HydrogenCodeStub(Isolate* isolate, |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 574 class NopRuntimeCallHelper : public RuntimeCallHelper { | 574 class NopRuntimeCallHelper : public RuntimeCallHelper { |
| 575 public: | 575 public: |
| 576 NopRuntimeCallHelper() {} | 576 NopRuntimeCallHelper() {} |
| 577 | 577 |
| 578 virtual void BeforeCall(MacroAssembler* masm) const {} | 578 virtual void BeforeCall(MacroAssembler* masm) const {} |
| 579 | 579 |
| 580 virtual void AfterCall(MacroAssembler* masm) const {} | 580 virtual void AfterCall(MacroAssembler* masm) const {} |
| 581 }; | 581 }; |
| 582 | 582 |
| 583 | 583 |
| 584 class NumberToStringStub FINAL : public HydrogenCodeStub { | 584 class NumberToStringStub final : public HydrogenCodeStub { |
| 585 public: | 585 public: |
| 586 explicit NumberToStringStub(Isolate* isolate) : HydrogenCodeStub(isolate) {} | 586 explicit NumberToStringStub(Isolate* isolate) : HydrogenCodeStub(isolate) {} |
| 587 | 587 |
| 588 // Parameters accessed via CodeStubGraphBuilder::GetParameter() | 588 // Parameters accessed via CodeStubGraphBuilder::GetParameter() |
| 589 static const int kNumber = 0; | 589 static const int kNumber = 0; |
| 590 | 590 |
| 591 DEFINE_CALL_INTERFACE_DESCRIPTOR(NumberToString); | 591 DEFINE_CALL_INTERFACE_DESCRIPTOR(NumberToString); |
| 592 DEFINE_HYDROGEN_CODE_STUB(NumberToString, HydrogenCodeStub); | 592 DEFINE_HYDROGEN_CODE_STUB(NumberToString, HydrogenCodeStub); |
| 593 }; | 593 }; |
| 594 | 594 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 614 private: | 614 private: |
| 615 STATIC_ASSERT(LANGUAGE_END == 3); | 615 STATIC_ASSERT(LANGUAGE_END == 3); |
| 616 class LanguageModeBits : public BitField<LanguageMode, 0, 2> {}; | 616 class LanguageModeBits : public BitField<LanguageMode, 0, 2> {}; |
| 617 class FunctionKindBits : public BitField<FunctionKind, 2, 8> {}; | 617 class FunctionKindBits : public BitField<FunctionKind, 2, 8> {}; |
| 618 | 618 |
| 619 DEFINE_CALL_INTERFACE_DESCRIPTOR(FastNewClosure); | 619 DEFINE_CALL_INTERFACE_DESCRIPTOR(FastNewClosure); |
| 620 DEFINE_HYDROGEN_CODE_STUB(FastNewClosure, HydrogenCodeStub); | 620 DEFINE_HYDROGEN_CODE_STUB(FastNewClosure, HydrogenCodeStub); |
| 621 }; | 621 }; |
| 622 | 622 |
| 623 | 623 |
| 624 class FastNewContextStub FINAL : public HydrogenCodeStub { | 624 class FastNewContextStub final : public HydrogenCodeStub { |
| 625 public: | 625 public: |
| 626 static const int kMaximumSlots = 64; | 626 static const int kMaximumSlots = 64; |
| 627 | 627 |
| 628 FastNewContextStub(Isolate* isolate, int slots) : HydrogenCodeStub(isolate) { | 628 FastNewContextStub(Isolate* isolate, int slots) : HydrogenCodeStub(isolate) { |
| 629 DCHECK(slots > 0 && slots <= kMaximumSlots); | 629 DCHECK(slots > 0 && slots <= kMaximumSlots); |
| 630 set_sub_minor_key(SlotsBits::encode(slots)); | 630 set_sub_minor_key(SlotsBits::encode(slots)); |
| 631 } | 631 } |
| 632 | 632 |
| 633 int slots() const { return SlotsBits::decode(sub_minor_key()); } | 633 int slots() const { return SlotsBits::decode(sub_minor_key()); } |
| 634 | 634 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 717 kReturnTrueFalseObject = 1 << 2 | 717 kReturnTrueFalseObject = 1 << 2 |
| 718 }; | 718 }; |
| 719 | 719 |
| 720 InstanceofStub(Isolate* isolate, Flags flags) : PlatformCodeStub(isolate) { | 720 InstanceofStub(Isolate* isolate, Flags flags) : PlatformCodeStub(isolate) { |
| 721 minor_key_ = FlagBits::encode(flags); | 721 minor_key_ = FlagBits::encode(flags); |
| 722 } | 722 } |
| 723 | 723 |
| 724 static Register left() { return InstanceofDescriptor::left(); } | 724 static Register left() { return InstanceofDescriptor::left(); } |
| 725 static Register right() { return InstanceofDescriptor::right(); } | 725 static Register right() { return InstanceofDescriptor::right(); } |
| 726 | 726 |
| 727 CallInterfaceDescriptor GetCallInterfaceDescriptor() OVERRIDE { | 727 CallInterfaceDescriptor GetCallInterfaceDescriptor() override { |
| 728 if (HasArgsInRegisters()) { | 728 if (HasArgsInRegisters()) { |
| 729 return InstanceofDescriptor(isolate()); | 729 return InstanceofDescriptor(isolate()); |
| 730 } | 730 } |
| 731 return ContextOnlyDescriptor(isolate()); | 731 return ContextOnlyDescriptor(isolate()); |
| 732 } | 732 } |
| 733 | 733 |
| 734 private: | 734 private: |
| 735 Flags flags() const { return FlagBits::decode(minor_key_); } | 735 Flags flags() const { return FlagBits::decode(minor_key_); } |
| 736 | 736 |
| 737 bool HasArgsInRegisters() const { return (flags() & kArgsInRegisters) != 0; } | 737 bool HasArgsInRegisters() const { return (flags() & kArgsInRegisters) != 0; } |
| 738 | 738 |
| 739 bool HasCallSiteInlineCheck() const { | 739 bool HasCallSiteInlineCheck() const { |
| 740 return (flags() & kCallSiteInlineCheck) != 0; | 740 return (flags() & kCallSiteInlineCheck) != 0; |
| 741 } | 741 } |
| 742 | 742 |
| 743 bool ReturnTrueFalseObject() const { | 743 bool ReturnTrueFalseObject() const { |
| 744 return (flags() & kReturnTrueFalseObject) != 0; | 744 return (flags() & kReturnTrueFalseObject) != 0; |
| 745 } | 745 } |
| 746 | 746 |
| 747 void PrintName(std::ostream& os) const OVERRIDE; // NOLINT | 747 void PrintName(std::ostream& os) const override; // NOLINT |
| 748 | 748 |
| 749 class FlagBits : public BitField<Flags, 0, 3> {}; | 749 class FlagBits : public BitField<Flags, 0, 3> {}; |
| 750 | 750 |
| 751 DEFINE_PLATFORM_CODE_STUB(Instanceof, PlatformCodeStub); | 751 DEFINE_PLATFORM_CODE_STUB(Instanceof, PlatformCodeStub); |
| 752 }; | 752 }; |
| 753 | 753 |
| 754 | 754 |
| 755 enum AllocationSiteOverrideMode { | 755 enum AllocationSiteOverrideMode { |
| 756 DONT_OVERRIDE, | 756 DONT_OVERRIDE, |
| 757 DISABLE_ALLOCATION_SITES, | 757 DISABLE_ALLOCATION_SITES, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 768 explicit ArrayConstructorStub(Isolate* isolate); | 768 explicit ArrayConstructorStub(Isolate* isolate); |
| 769 | 769 |
| 770 private: | 770 private: |
| 771 ArgumentCountKey argument_count() const { | 771 ArgumentCountKey argument_count() const { |
| 772 return ArgumentCountBits::decode(minor_key_); | 772 return ArgumentCountBits::decode(minor_key_); |
| 773 } | 773 } |
| 774 | 774 |
| 775 void GenerateDispatchToArrayStub(MacroAssembler* masm, | 775 void GenerateDispatchToArrayStub(MacroAssembler* masm, |
| 776 AllocationSiteOverrideMode mode); | 776 AllocationSiteOverrideMode mode); |
| 777 | 777 |
| 778 void PrintName(std::ostream& os) const OVERRIDE; // NOLINT | 778 void PrintName(std::ostream& os) const override; // NOLINT |
| 779 | 779 |
| 780 class ArgumentCountBits : public BitField<ArgumentCountKey, 0, 2> {}; | 780 class ArgumentCountBits : public BitField<ArgumentCountKey, 0, 2> {}; |
| 781 | 781 |
| 782 DEFINE_CALL_INTERFACE_DESCRIPTOR(ArrayConstructor); | 782 DEFINE_CALL_INTERFACE_DESCRIPTOR(ArrayConstructor); |
| 783 DEFINE_PLATFORM_CODE_STUB(ArrayConstructor, PlatformCodeStub); | 783 DEFINE_PLATFORM_CODE_STUB(ArrayConstructor, PlatformCodeStub); |
| 784 }; | 784 }; |
| 785 | 785 |
| 786 | 786 |
| 787 class InternalArrayConstructorStub: public PlatformCodeStub { | 787 class InternalArrayConstructorStub: public PlatformCodeStub { |
| 788 public: | 788 public: |
| 789 explicit InternalArrayConstructorStub(Isolate* isolate); | 789 explicit InternalArrayConstructorStub(Isolate* isolate); |
| 790 | 790 |
| 791 private: | 791 private: |
| 792 void GenerateCase(MacroAssembler* masm, ElementsKind kind); | 792 void GenerateCase(MacroAssembler* masm, ElementsKind kind); |
| 793 | 793 |
| 794 DEFINE_CALL_INTERFACE_DESCRIPTOR(InternalArrayConstructor); | 794 DEFINE_CALL_INTERFACE_DESCRIPTOR(InternalArrayConstructor); |
| 795 DEFINE_PLATFORM_CODE_STUB(InternalArrayConstructor, PlatformCodeStub); | 795 DEFINE_PLATFORM_CODE_STUB(InternalArrayConstructor, PlatformCodeStub); |
| 796 }; | 796 }; |
| 797 | 797 |
| 798 | 798 |
| 799 class MathPowStub: public PlatformCodeStub { | 799 class MathPowStub: public PlatformCodeStub { |
| 800 public: | 800 public: |
| 801 enum ExponentType { INTEGER, DOUBLE, TAGGED, ON_STACK }; | 801 enum ExponentType { INTEGER, DOUBLE, TAGGED, ON_STACK }; |
| 802 | 802 |
| 803 MathPowStub(Isolate* isolate, ExponentType exponent_type) | 803 MathPowStub(Isolate* isolate, ExponentType exponent_type) |
| 804 : PlatformCodeStub(isolate) { | 804 : PlatformCodeStub(isolate) { |
| 805 minor_key_ = ExponentTypeBits::encode(exponent_type); | 805 minor_key_ = ExponentTypeBits::encode(exponent_type); |
| 806 } | 806 } |
| 807 | 807 |
| 808 CallInterfaceDescriptor GetCallInterfaceDescriptor() OVERRIDE { | 808 CallInterfaceDescriptor GetCallInterfaceDescriptor() override { |
| 809 if (exponent_type() == TAGGED) { | 809 if (exponent_type() == TAGGED) { |
| 810 return MathPowTaggedDescriptor(isolate()); | 810 return MathPowTaggedDescriptor(isolate()); |
| 811 } else if (exponent_type() == INTEGER) { | 811 } else if (exponent_type() == INTEGER) { |
| 812 return MathPowIntegerDescriptor(isolate()); | 812 return MathPowIntegerDescriptor(isolate()); |
| 813 } | 813 } |
| 814 // A CallInterfaceDescriptor doesn't specify double registers (yet). | 814 // A CallInterfaceDescriptor doesn't specify double registers (yet). |
| 815 return ContextOnlyDescriptor(isolate()); | 815 return ContextOnlyDescriptor(isolate()); |
| 816 } | 816 } |
| 817 | 817 |
| 818 private: | 818 private: |
| (...skipping 12 matching lines...) Expand all Loading... |
| 831 CallICStub(Isolate* isolate, const CallICState& state) | 831 CallICStub(Isolate* isolate, const CallICState& state) |
| 832 : PlatformCodeStub(isolate) { | 832 : PlatformCodeStub(isolate) { |
| 833 minor_key_ = state.GetExtraICState(); | 833 minor_key_ = state.GetExtraICState(); |
| 834 } | 834 } |
| 835 | 835 |
| 836 static int ExtractArgcFromMinorKey(int minor_key) { | 836 static int ExtractArgcFromMinorKey(int minor_key) { |
| 837 CallICState state(static_cast<ExtraICState>(minor_key)); | 837 CallICState state(static_cast<ExtraICState>(minor_key)); |
| 838 return state.arg_count(); | 838 return state.arg_count(); |
| 839 } | 839 } |
| 840 | 840 |
| 841 Code::Kind GetCodeKind() const OVERRIDE { return Code::CALL_IC; } | 841 Code::Kind GetCodeKind() const override { return Code::CALL_IC; } |
| 842 | 842 |
| 843 InlineCacheState GetICState() const OVERRIDE { return DEFAULT; } | 843 InlineCacheState GetICState() const override { return DEFAULT; } |
| 844 | 844 |
| 845 ExtraICState GetExtraICState() const FINAL { | 845 ExtraICState GetExtraICState() const final { |
| 846 return static_cast<ExtraICState>(minor_key_); | 846 return static_cast<ExtraICState>(minor_key_); |
| 847 } | 847 } |
| 848 | 848 |
| 849 protected: | 849 protected: |
| 850 bool CallAsMethod() const { | 850 bool CallAsMethod() const { |
| 851 return state().call_type() == CallICState::METHOD; | 851 return state().call_type() == CallICState::METHOD; |
| 852 } | 852 } |
| 853 | 853 |
| 854 int arg_count() const { return state().arg_count(); } | 854 int arg_count() const { return state().arg_count(); } |
| 855 | 855 |
| 856 CallICState state() const { | 856 CallICState state() const { |
| 857 return CallICState(static_cast<ExtraICState>(minor_key_)); | 857 return CallICState(static_cast<ExtraICState>(minor_key_)); |
| 858 } | 858 } |
| 859 | 859 |
| 860 // Code generation helpers. | 860 // Code generation helpers. |
| 861 void GenerateMiss(MacroAssembler* masm); | 861 void GenerateMiss(MacroAssembler* masm); |
| 862 | 862 |
| 863 private: | 863 private: |
| 864 void PrintState(std::ostream& os) const OVERRIDE; // NOLINT | 864 void PrintState(std::ostream& os) const override; // NOLINT |
| 865 | 865 |
| 866 DEFINE_CALL_INTERFACE_DESCRIPTOR(CallFunctionWithFeedbackAndVector); | 866 DEFINE_CALL_INTERFACE_DESCRIPTOR(CallFunctionWithFeedbackAndVector); |
| 867 DEFINE_PLATFORM_CODE_STUB(CallIC, PlatformCodeStub); | 867 DEFINE_PLATFORM_CODE_STUB(CallIC, PlatformCodeStub); |
| 868 }; | 868 }; |
| 869 | 869 |
| 870 | 870 |
| 871 class CallIC_ArrayStub: public CallICStub { | 871 class CallIC_ArrayStub: public CallICStub { |
| 872 public: | 872 public: |
| 873 CallIC_ArrayStub(Isolate* isolate, const CallICState& state_in) | 873 CallIC_ArrayStub(Isolate* isolate, const CallICState& state_in) |
| 874 : CallICStub(isolate, state_in) {} | 874 : CallICStub(isolate, state_in) {} |
| 875 | 875 |
| 876 InlineCacheState GetICState() const FINAL { return MONOMORPHIC; } | 876 InlineCacheState GetICState() const final { return MONOMORPHIC; } |
| 877 | 877 |
| 878 private: | 878 private: |
| 879 void PrintState(std::ostream& os) const OVERRIDE; // NOLINT | 879 void PrintState(std::ostream& os) const override; // NOLINT |
| 880 | 880 |
| 881 DEFINE_PLATFORM_CODE_STUB(CallIC_Array, CallICStub); | 881 DEFINE_PLATFORM_CODE_STUB(CallIC_Array, CallICStub); |
| 882 }; | 882 }; |
| 883 | 883 |
| 884 | 884 |
| 885 // TODO(verwaest): Translate to hydrogen code stub. | 885 // TODO(verwaest): Translate to hydrogen code stub. |
| 886 class FunctionPrototypeStub : public PlatformCodeStub { | 886 class FunctionPrototypeStub : public PlatformCodeStub { |
| 887 public: | 887 public: |
| 888 explicit FunctionPrototypeStub(Isolate* isolate) | 888 explicit FunctionPrototypeStub(Isolate* isolate) |
| 889 : PlatformCodeStub(isolate) {} | 889 : PlatformCodeStub(isolate) {} |
| 890 | 890 |
| 891 Code::Kind GetCodeKind() const OVERRIDE { return Code::HANDLER; } | 891 Code::Kind GetCodeKind() const override { return Code::HANDLER; } |
| 892 | 892 |
| 893 // TODO(mvstanton): only the receiver register is accessed. When this is | 893 // TODO(mvstanton): only the receiver register is accessed. When this is |
| 894 // translated to a hydrogen code stub, a new CallInterfaceDescriptor | 894 // translated to a hydrogen code stub, a new CallInterfaceDescriptor |
| 895 // should be created that just uses that register for more efficient code. | 895 // should be created that just uses that register for more efficient code. |
| 896 CallInterfaceDescriptor GetCallInterfaceDescriptor() OVERRIDE { | 896 CallInterfaceDescriptor GetCallInterfaceDescriptor() override { |
| 897 if (FLAG_vector_ics) { | 897 if (FLAG_vector_ics) { |
| 898 return VectorLoadICDescriptor(isolate()); | 898 return VectorLoadICDescriptor(isolate()); |
| 899 } | 899 } |
| 900 return LoadDescriptor(isolate()); | 900 return LoadDescriptor(isolate()); |
| 901 } | 901 } |
| 902 | 902 |
| 903 DEFINE_PLATFORM_CODE_STUB(FunctionPrototype, PlatformCodeStub); | 903 DEFINE_PLATFORM_CODE_STUB(FunctionPrototype, PlatformCodeStub); |
| 904 }; | 904 }; |
| 905 | 905 |
| 906 | 906 |
| 907 // TODO(mvstanton): Translate to hydrogen code stub. | 907 // TODO(mvstanton): Translate to hydrogen code stub. |
| 908 class LoadIndexedInterceptorStub : public PlatformCodeStub { | 908 class LoadIndexedInterceptorStub : public PlatformCodeStub { |
| 909 public: | 909 public: |
| 910 explicit LoadIndexedInterceptorStub(Isolate* isolate) | 910 explicit LoadIndexedInterceptorStub(Isolate* isolate) |
| 911 : PlatformCodeStub(isolate) {} | 911 : PlatformCodeStub(isolate) {} |
| 912 | 912 |
| 913 Code::Kind GetCodeKind() const OVERRIDE { return Code::HANDLER; } | 913 Code::Kind GetCodeKind() const override { return Code::HANDLER; } |
| 914 Code::StubType GetStubType() const OVERRIDE { return Code::FAST; } | 914 Code::StubType GetStubType() const override { return Code::FAST; } |
| 915 | 915 |
| 916 DEFINE_CALL_INTERFACE_DESCRIPTOR(Load); | 916 DEFINE_CALL_INTERFACE_DESCRIPTOR(Load); |
| 917 DEFINE_PLATFORM_CODE_STUB(LoadIndexedInterceptor, PlatformCodeStub); | 917 DEFINE_PLATFORM_CODE_STUB(LoadIndexedInterceptor, PlatformCodeStub); |
| 918 }; | 918 }; |
| 919 | 919 |
| 920 | 920 |
| 921 class LoadIndexedStringStub : public PlatformCodeStub { | 921 class LoadIndexedStringStub : public PlatformCodeStub { |
| 922 public: | 922 public: |
| 923 explicit LoadIndexedStringStub(Isolate* isolate) | 923 explicit LoadIndexedStringStub(Isolate* isolate) |
| 924 : PlatformCodeStub(isolate) {} | 924 : PlatformCodeStub(isolate) {} |
| 925 | 925 |
| 926 Code::Kind GetCodeKind() const OVERRIDE { return Code::HANDLER; } | 926 Code::Kind GetCodeKind() const override { return Code::HANDLER; } |
| 927 Code::StubType GetStubType() const OVERRIDE { return Code::FAST; } | 927 Code::StubType GetStubType() const override { return Code::FAST; } |
| 928 | 928 |
| 929 DEFINE_CALL_INTERFACE_DESCRIPTOR(Load); | 929 DEFINE_CALL_INTERFACE_DESCRIPTOR(Load); |
| 930 DEFINE_PLATFORM_CODE_STUB(LoadIndexedString, PlatformCodeStub); | 930 DEFINE_PLATFORM_CODE_STUB(LoadIndexedString, PlatformCodeStub); |
| 931 }; | 931 }; |
| 932 | 932 |
| 933 | 933 |
| 934 class HandlerStub : public HydrogenCodeStub { | 934 class HandlerStub : public HydrogenCodeStub { |
| 935 public: | 935 public: |
| 936 Code::Kind GetCodeKind() const OVERRIDE { return Code::HANDLER; } | 936 Code::Kind GetCodeKind() const override { return Code::HANDLER; } |
| 937 ExtraICState GetExtraICState() const OVERRIDE { return kind(); } | 937 ExtraICState GetExtraICState() const override { return kind(); } |
| 938 InlineCacheState GetICState() const OVERRIDE { return MONOMORPHIC; } | 938 InlineCacheState GetICState() const override { return MONOMORPHIC; } |
| 939 | 939 |
| 940 void InitializeDescriptor(CodeStubDescriptor* descriptor) OVERRIDE; | 940 void InitializeDescriptor(CodeStubDescriptor* descriptor) override; |
| 941 | 941 |
| 942 CallInterfaceDescriptor GetCallInterfaceDescriptor() OVERRIDE; | 942 CallInterfaceDescriptor GetCallInterfaceDescriptor() override; |
| 943 | 943 |
| 944 protected: | 944 protected: |
| 945 explicit HandlerStub(Isolate* isolate) : HydrogenCodeStub(isolate) {} | 945 explicit HandlerStub(Isolate* isolate) : HydrogenCodeStub(isolate) {} |
| 946 | 946 |
| 947 virtual Code::Kind kind() const = 0; | 947 virtual Code::Kind kind() const = 0; |
| 948 | 948 |
| 949 DEFINE_CODE_STUB_BASE(HandlerStub, HydrogenCodeStub); | 949 DEFINE_CODE_STUB_BASE(HandlerStub, HydrogenCodeStub); |
| 950 }; | 950 }; |
| 951 | 951 |
| 952 | 952 |
| 953 class LoadFieldStub: public HandlerStub { | 953 class LoadFieldStub: public HandlerStub { |
| 954 public: | 954 public: |
| 955 LoadFieldStub(Isolate* isolate, FieldIndex index) : HandlerStub(isolate) { | 955 LoadFieldStub(Isolate* isolate, FieldIndex index) : HandlerStub(isolate) { |
| 956 int property_index_key = index.GetFieldAccessStubKey(); | 956 int property_index_key = index.GetFieldAccessStubKey(); |
| 957 set_sub_minor_key(LoadFieldByIndexBits::encode(property_index_key)); | 957 set_sub_minor_key(LoadFieldByIndexBits::encode(property_index_key)); |
| 958 } | 958 } |
| 959 | 959 |
| 960 FieldIndex index() const { | 960 FieldIndex index() const { |
| 961 int property_index_key = LoadFieldByIndexBits::decode(sub_minor_key()); | 961 int property_index_key = LoadFieldByIndexBits::decode(sub_minor_key()); |
| 962 return FieldIndex::FromFieldAccessStubKey(property_index_key); | 962 return FieldIndex::FromFieldAccessStubKey(property_index_key); |
| 963 } | 963 } |
| 964 | 964 |
| 965 protected: | 965 protected: |
| 966 Code::Kind kind() const OVERRIDE { return Code::LOAD_IC; } | 966 Code::Kind kind() const override { return Code::LOAD_IC; } |
| 967 Code::StubType GetStubType() const OVERRIDE { return Code::FAST; } | 967 Code::StubType GetStubType() const override { return Code::FAST; } |
| 968 | 968 |
| 969 private: | 969 private: |
| 970 class LoadFieldByIndexBits : public BitField<int, 0, 13> {}; | 970 class LoadFieldByIndexBits : public BitField<int, 0, 13> {}; |
| 971 | 971 |
| 972 DEFINE_HANDLER_CODE_STUB(LoadField, HandlerStub); | 972 DEFINE_HANDLER_CODE_STUB(LoadField, HandlerStub); |
| 973 }; | 973 }; |
| 974 | 974 |
| 975 | 975 |
| 976 class KeyedLoadSloppyArgumentsStub : public HandlerStub { | 976 class KeyedLoadSloppyArgumentsStub : public HandlerStub { |
| 977 public: | 977 public: |
| 978 explicit KeyedLoadSloppyArgumentsStub(Isolate* isolate) | 978 explicit KeyedLoadSloppyArgumentsStub(Isolate* isolate) |
| 979 : HandlerStub(isolate) {} | 979 : HandlerStub(isolate) {} |
| 980 | 980 |
| 981 protected: | 981 protected: |
| 982 Code::Kind kind() const OVERRIDE { return Code::KEYED_LOAD_IC; } | 982 Code::Kind kind() const override { return Code::KEYED_LOAD_IC; } |
| 983 Code::StubType GetStubType() const OVERRIDE { return Code::FAST; } | 983 Code::StubType GetStubType() const override { return Code::FAST; } |
| 984 | 984 |
| 985 private: | 985 private: |
| 986 DEFINE_HANDLER_CODE_STUB(KeyedLoadSloppyArguments, HandlerStub); | 986 DEFINE_HANDLER_CODE_STUB(KeyedLoadSloppyArguments, HandlerStub); |
| 987 }; | 987 }; |
| 988 | 988 |
| 989 | 989 |
| 990 class LoadConstantStub : public HandlerStub { | 990 class LoadConstantStub : public HandlerStub { |
| 991 public: | 991 public: |
| 992 LoadConstantStub(Isolate* isolate, int constant_index) | 992 LoadConstantStub(Isolate* isolate, int constant_index) |
| 993 : HandlerStub(isolate) { | 993 : HandlerStub(isolate) { |
| 994 set_sub_minor_key(ConstantIndexBits::encode(constant_index)); | 994 set_sub_minor_key(ConstantIndexBits::encode(constant_index)); |
| 995 } | 995 } |
| 996 | 996 |
| 997 int constant_index() const { | 997 int constant_index() const { |
| 998 return ConstantIndexBits::decode(sub_minor_key()); | 998 return ConstantIndexBits::decode(sub_minor_key()); |
| 999 } | 999 } |
| 1000 | 1000 |
| 1001 protected: | 1001 protected: |
| 1002 Code::Kind kind() const OVERRIDE { return Code::LOAD_IC; } | 1002 Code::Kind kind() const override { return Code::LOAD_IC; } |
| 1003 Code::StubType GetStubType() const OVERRIDE { return Code::FAST; } | 1003 Code::StubType GetStubType() const override { return Code::FAST; } |
| 1004 | 1004 |
| 1005 private: | 1005 private: |
| 1006 class ConstantIndexBits : public BitField<int, 0, kSubMinorKeyBits> {}; | 1006 class ConstantIndexBits : public BitField<int, 0, kSubMinorKeyBits> {}; |
| 1007 | 1007 |
| 1008 DEFINE_HANDLER_CODE_STUB(LoadConstant, HandlerStub); | 1008 DEFINE_HANDLER_CODE_STUB(LoadConstant, HandlerStub); |
| 1009 }; | 1009 }; |
| 1010 | 1010 |
| 1011 | 1011 |
| 1012 class StringLengthStub: public HandlerStub { | 1012 class StringLengthStub: public HandlerStub { |
| 1013 public: | 1013 public: |
| 1014 explicit StringLengthStub(Isolate* isolate) : HandlerStub(isolate) {} | 1014 explicit StringLengthStub(Isolate* isolate) : HandlerStub(isolate) {} |
| 1015 | 1015 |
| 1016 protected: | 1016 protected: |
| 1017 Code::Kind kind() const OVERRIDE { return Code::LOAD_IC; } | 1017 Code::Kind kind() const override { return Code::LOAD_IC; } |
| 1018 Code::StubType GetStubType() const OVERRIDE { return Code::FAST; } | 1018 Code::StubType GetStubType() const override { return Code::FAST; } |
| 1019 | 1019 |
| 1020 DEFINE_HANDLER_CODE_STUB(StringLength, HandlerStub); | 1020 DEFINE_HANDLER_CODE_STUB(StringLength, HandlerStub); |
| 1021 }; | 1021 }; |
| 1022 | 1022 |
| 1023 | 1023 |
| 1024 class StoreFieldStub : public HandlerStub { | 1024 class StoreFieldStub : public HandlerStub { |
| 1025 public: | 1025 public: |
| 1026 StoreFieldStub(Isolate* isolate, FieldIndex index, | 1026 StoreFieldStub(Isolate* isolate, FieldIndex index, |
| 1027 Representation representation) | 1027 Representation representation) |
| 1028 : HandlerStub(isolate) { | 1028 : HandlerStub(isolate) { |
| 1029 int property_index_key = index.GetFieldAccessStubKey(); | 1029 int property_index_key = index.GetFieldAccessStubKey(); |
| 1030 uint8_t repr = PropertyDetails::EncodeRepresentation(representation); | 1030 uint8_t repr = PropertyDetails::EncodeRepresentation(representation); |
| 1031 set_sub_minor_key(StoreFieldByIndexBits::encode(property_index_key) | | 1031 set_sub_minor_key(StoreFieldByIndexBits::encode(property_index_key) | |
| 1032 RepresentationBits::encode(repr)); | 1032 RepresentationBits::encode(repr)); |
| 1033 } | 1033 } |
| 1034 | 1034 |
| 1035 FieldIndex index() const { | 1035 FieldIndex index() const { |
| 1036 int property_index_key = StoreFieldByIndexBits::decode(sub_minor_key()); | 1036 int property_index_key = StoreFieldByIndexBits::decode(sub_minor_key()); |
| 1037 return FieldIndex::FromFieldAccessStubKey(property_index_key); | 1037 return FieldIndex::FromFieldAccessStubKey(property_index_key); |
| 1038 } | 1038 } |
| 1039 | 1039 |
| 1040 Representation representation() { | 1040 Representation representation() { |
| 1041 uint8_t repr = RepresentationBits::decode(sub_minor_key()); | 1041 uint8_t repr = RepresentationBits::decode(sub_minor_key()); |
| 1042 return PropertyDetails::DecodeRepresentation(repr); | 1042 return PropertyDetails::DecodeRepresentation(repr); |
| 1043 } | 1043 } |
| 1044 | 1044 |
| 1045 protected: | 1045 protected: |
| 1046 Code::Kind kind() const OVERRIDE { return Code::STORE_IC; } | 1046 Code::Kind kind() const override { return Code::STORE_IC; } |
| 1047 Code::StubType GetStubType() const OVERRIDE { return Code::FAST; } | 1047 Code::StubType GetStubType() const override { return Code::FAST; } |
| 1048 | 1048 |
| 1049 private: | 1049 private: |
| 1050 class StoreFieldByIndexBits : public BitField<int, 0, 13> {}; | 1050 class StoreFieldByIndexBits : public BitField<int, 0, 13> {}; |
| 1051 class RepresentationBits : public BitField<uint8_t, 13, 4> {}; | 1051 class RepresentationBits : public BitField<uint8_t, 13, 4> {}; |
| 1052 | 1052 |
| 1053 DEFINE_HANDLER_CODE_STUB(StoreField, HandlerStub); | 1053 DEFINE_HANDLER_CODE_STUB(StoreField, HandlerStub); |
| 1054 }; | 1054 }; |
| 1055 | 1055 |
| 1056 | 1056 |
| 1057 class StoreTransitionStub : public HandlerStub { | 1057 class StoreTransitionStub : public HandlerStub { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 1086 Representation representation() { | 1086 Representation representation() { |
| 1087 DCHECK(store_mode() != StoreMapOnly); | 1087 DCHECK(store_mode() != StoreMapOnly); |
| 1088 uint8_t repr = RepresentationBits::decode(sub_minor_key()); | 1088 uint8_t repr = RepresentationBits::decode(sub_minor_key()); |
| 1089 return PropertyDetails::DecodeRepresentation(repr); | 1089 return PropertyDetails::DecodeRepresentation(repr); |
| 1090 } | 1090 } |
| 1091 | 1091 |
| 1092 StoreMode store_mode() const { | 1092 StoreMode store_mode() const { |
| 1093 return StoreModeBits::decode(sub_minor_key()); | 1093 return StoreModeBits::decode(sub_minor_key()); |
| 1094 } | 1094 } |
| 1095 | 1095 |
| 1096 CallInterfaceDescriptor GetCallInterfaceDescriptor() OVERRIDE; | 1096 CallInterfaceDescriptor GetCallInterfaceDescriptor() override; |
| 1097 | 1097 |
| 1098 protected: | 1098 protected: |
| 1099 Code::Kind kind() const OVERRIDE { return Code::STORE_IC; } | 1099 Code::Kind kind() const override { return Code::STORE_IC; } |
| 1100 Code::StubType GetStubType() const OVERRIDE { return Code::FAST; } | 1100 Code::StubType GetStubType() const override { return Code::FAST; } |
| 1101 | 1101 |
| 1102 private: | 1102 private: |
| 1103 class StoreFieldByIndexBits : public BitField<int, 0, 13> {}; | 1103 class StoreFieldByIndexBits : public BitField<int, 0, 13> {}; |
| 1104 class RepresentationBits : public BitField<uint8_t, 13, 4> {}; | 1104 class RepresentationBits : public BitField<uint8_t, 13, 4> {}; |
| 1105 class StoreModeBits : public BitField<StoreMode, 17, 2> {}; | 1105 class StoreModeBits : public BitField<StoreMode, 17, 2> {}; |
| 1106 | 1106 |
| 1107 DEFINE_HANDLER_CODE_STUB(StoreTransition, HandlerStub); | 1107 DEFINE_HANDLER_CODE_STUB(StoreTransition, HandlerStub); |
| 1108 }; | 1108 }; |
| 1109 | 1109 |
| 1110 | 1110 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 1130 isolate()->factory()->NewWeakCell(cell)); | 1130 isolate()->factory()->NewWeakCell(cell)); |
| 1131 return CodeStub::GetCodeCopy(pattern); | 1131 return CodeStub::GetCodeCopy(pattern); |
| 1132 } else { | 1132 } else { |
| 1133 Code::FindAndReplacePattern pattern; | 1133 Code::FindAndReplacePattern pattern; |
| 1134 pattern.Add(Handle<Map>(property_cell_placeholder(isolate())->map()), | 1134 pattern.Add(Handle<Map>(property_cell_placeholder(isolate())->map()), |
| 1135 isolate()->factory()->NewWeakCell(cell)); | 1135 isolate()->factory()->NewWeakCell(cell)); |
| 1136 return CodeStub::GetCodeCopy(pattern); | 1136 return CodeStub::GetCodeCopy(pattern); |
| 1137 } | 1137 } |
| 1138 } | 1138 } |
| 1139 | 1139 |
| 1140 Code::Kind kind() const OVERRIDE { return Code::STORE_IC; } | 1140 Code::Kind kind() const override { return Code::STORE_IC; } |
| 1141 | 1141 |
| 1142 bool is_constant() const { return IsConstantBits::decode(sub_minor_key()); } | 1142 bool is_constant() const { return IsConstantBits::decode(sub_minor_key()); } |
| 1143 | 1143 |
| 1144 bool check_global() const { return CheckGlobalBits::decode(sub_minor_key()); } | 1144 bool check_global() const { return CheckGlobalBits::decode(sub_minor_key()); } |
| 1145 | 1145 |
| 1146 void set_is_constant(bool value) { | 1146 void set_is_constant(bool value) { |
| 1147 set_sub_minor_key(IsConstantBits::update(sub_minor_key(), value)); | 1147 set_sub_minor_key(IsConstantBits::update(sub_minor_key(), value)); |
| 1148 } | 1148 } |
| 1149 | 1149 |
| 1150 Representation representation() { | 1150 Representation representation() { |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1254 set_sub_minor_key(state.GetExtraICState()); | 1254 set_sub_minor_key(state.GetExtraICState()); |
| 1255 } | 1255 } |
| 1256 | 1256 |
| 1257 BinaryOpICStub(Isolate* isolate, const BinaryOpICState& state) | 1257 BinaryOpICStub(Isolate* isolate, const BinaryOpICState& state) |
| 1258 : HydrogenCodeStub(isolate) { | 1258 : HydrogenCodeStub(isolate) { |
| 1259 set_sub_minor_key(state.GetExtraICState()); | 1259 set_sub_minor_key(state.GetExtraICState()); |
| 1260 } | 1260 } |
| 1261 | 1261 |
| 1262 static void GenerateAheadOfTime(Isolate* isolate); | 1262 static void GenerateAheadOfTime(Isolate* isolate); |
| 1263 | 1263 |
| 1264 Code::Kind GetCodeKind() const OVERRIDE { return Code::BINARY_OP_IC; } | 1264 Code::Kind GetCodeKind() const override { return Code::BINARY_OP_IC; } |
| 1265 | 1265 |
| 1266 InlineCacheState GetICState() const FINAL { return state().GetICState(); } | 1266 InlineCacheState GetICState() const final { return state().GetICState(); } |
| 1267 | 1267 |
| 1268 ExtraICState GetExtraICState() const FINAL { | 1268 ExtraICState GetExtraICState() const final { |
| 1269 return static_cast<ExtraICState>(sub_minor_key()); | 1269 return static_cast<ExtraICState>(sub_minor_key()); |
| 1270 } | 1270 } |
| 1271 | 1271 |
| 1272 BinaryOpICState state() const { | 1272 BinaryOpICState state() const { |
| 1273 return BinaryOpICState(isolate(), GetExtraICState()); | 1273 return BinaryOpICState(isolate(), GetExtraICState()); |
| 1274 } | 1274 } |
| 1275 | 1275 |
| 1276 void PrintState(std::ostream& os) const FINAL; // NOLINT | 1276 void PrintState(std::ostream& os) const final; // NOLINT |
| 1277 | 1277 |
| 1278 // Parameters accessed via CodeStubGraphBuilder::GetParameter() | 1278 // Parameters accessed via CodeStubGraphBuilder::GetParameter() |
| 1279 static const int kLeft = 0; | 1279 static const int kLeft = 0; |
| 1280 static const int kRight = 1; | 1280 static const int kRight = 1; |
| 1281 | 1281 |
| 1282 private: | 1282 private: |
| 1283 static void GenerateAheadOfTime(Isolate* isolate, | 1283 static void GenerateAheadOfTime(Isolate* isolate, |
| 1284 const BinaryOpICState& state); | 1284 const BinaryOpICState& state); |
| 1285 | 1285 |
| 1286 DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOp); | 1286 DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOp); |
| 1287 DEFINE_HYDROGEN_CODE_STUB(BinaryOpIC, HydrogenCodeStub); | 1287 DEFINE_HYDROGEN_CODE_STUB(BinaryOpIC, HydrogenCodeStub); |
| 1288 }; | 1288 }; |
| 1289 | 1289 |
| 1290 | 1290 |
| 1291 // TODO(bmeurer): Merge this into the BinaryOpICStub once we have proper tail | 1291 // TODO(bmeurer): Merge this into the BinaryOpICStub once we have proper tail |
| 1292 // call support for stubs in Hydrogen. | 1292 // call support for stubs in Hydrogen. |
| 1293 class BinaryOpICWithAllocationSiteStub FINAL : public PlatformCodeStub { | 1293 class BinaryOpICWithAllocationSiteStub final : public PlatformCodeStub { |
| 1294 public: | 1294 public: |
| 1295 BinaryOpICWithAllocationSiteStub(Isolate* isolate, | 1295 BinaryOpICWithAllocationSiteStub(Isolate* isolate, |
| 1296 const BinaryOpICState& state) | 1296 const BinaryOpICState& state) |
| 1297 : PlatformCodeStub(isolate) { | 1297 : PlatformCodeStub(isolate) { |
| 1298 minor_key_ = state.GetExtraICState(); | 1298 minor_key_ = state.GetExtraICState(); |
| 1299 } | 1299 } |
| 1300 | 1300 |
| 1301 static void GenerateAheadOfTime(Isolate* isolate); | 1301 static void GenerateAheadOfTime(Isolate* isolate); |
| 1302 | 1302 |
| 1303 Handle<Code> GetCodeCopyFromTemplate(Handle<AllocationSite> allocation_site) { | 1303 Handle<Code> GetCodeCopyFromTemplate(Handle<AllocationSite> allocation_site) { |
| 1304 Code::FindAndReplacePattern pattern; | 1304 Code::FindAndReplacePattern pattern; |
| 1305 pattern.Add(isolate()->factory()->undefined_map(), allocation_site); | 1305 pattern.Add(isolate()->factory()->undefined_map(), allocation_site); |
| 1306 return CodeStub::GetCodeCopy(pattern); | 1306 return CodeStub::GetCodeCopy(pattern); |
| 1307 } | 1307 } |
| 1308 | 1308 |
| 1309 Code::Kind GetCodeKind() const OVERRIDE { return Code::BINARY_OP_IC; } | 1309 Code::Kind GetCodeKind() const override { return Code::BINARY_OP_IC; } |
| 1310 | 1310 |
| 1311 InlineCacheState GetICState() const OVERRIDE { return state().GetICState(); } | 1311 InlineCacheState GetICState() const override { return state().GetICState(); } |
| 1312 | 1312 |
| 1313 ExtraICState GetExtraICState() const OVERRIDE { | 1313 ExtraICState GetExtraICState() const override { |
| 1314 return static_cast<ExtraICState>(minor_key_); | 1314 return static_cast<ExtraICState>(minor_key_); |
| 1315 } | 1315 } |
| 1316 | 1316 |
| 1317 void PrintState(std::ostream& os) const OVERRIDE; // NOLINT | 1317 void PrintState(std::ostream& os) const override; // NOLINT |
| 1318 | 1318 |
| 1319 private: | 1319 private: |
| 1320 BinaryOpICState state() const { | 1320 BinaryOpICState state() const { |
| 1321 return BinaryOpICState(isolate(), static_cast<ExtraICState>(minor_key_)); | 1321 return BinaryOpICState(isolate(), static_cast<ExtraICState>(minor_key_)); |
| 1322 } | 1322 } |
| 1323 | 1323 |
| 1324 static void GenerateAheadOfTime(Isolate* isolate, | 1324 static void GenerateAheadOfTime(Isolate* isolate, |
| 1325 const BinaryOpICState& state); | 1325 const BinaryOpICState& state); |
| 1326 | 1326 |
| 1327 DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOpWithAllocationSite); | 1327 DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOpWithAllocationSite); |
| 1328 DEFINE_PLATFORM_CODE_STUB(BinaryOpICWithAllocationSite, PlatformCodeStub); | 1328 DEFINE_PLATFORM_CODE_STUB(BinaryOpICWithAllocationSite, PlatformCodeStub); |
| 1329 }; | 1329 }; |
| 1330 | 1330 |
| 1331 | 1331 |
| 1332 class BinaryOpWithAllocationSiteStub FINAL : public BinaryOpICStub { | 1332 class BinaryOpWithAllocationSiteStub final : public BinaryOpICStub { |
| 1333 public: | 1333 public: |
| 1334 BinaryOpWithAllocationSiteStub(Isolate* isolate, Token::Value op) | 1334 BinaryOpWithAllocationSiteStub(Isolate* isolate, Token::Value op) |
| 1335 : BinaryOpICStub(isolate, op) {} | 1335 : BinaryOpICStub(isolate, op) {} |
| 1336 | 1336 |
| 1337 BinaryOpWithAllocationSiteStub(Isolate* isolate, const BinaryOpICState& state) | 1337 BinaryOpWithAllocationSiteStub(Isolate* isolate, const BinaryOpICState& state) |
| 1338 : BinaryOpICStub(isolate, state) {} | 1338 : BinaryOpICStub(isolate, state) {} |
| 1339 | 1339 |
| 1340 Code::Kind GetCodeKind() const FINAL { return Code::STUB; } | 1340 Code::Kind GetCodeKind() const final { return Code::STUB; } |
| 1341 | 1341 |
| 1342 // Parameters accessed via CodeStubGraphBuilder::GetParameter() | 1342 // Parameters accessed via CodeStubGraphBuilder::GetParameter() |
| 1343 static const int kAllocationSite = 0; | 1343 static const int kAllocationSite = 0; |
| 1344 static const int kLeft = 1; | 1344 static const int kLeft = 1; |
| 1345 static const int kRight = 2; | 1345 static const int kRight = 2; |
| 1346 | 1346 |
| 1347 DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOpWithAllocationSite); | 1347 DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOpWithAllocationSite); |
| 1348 DEFINE_HYDROGEN_CODE_STUB(BinaryOpWithAllocationSite, BinaryOpICStub); | 1348 DEFINE_HYDROGEN_CODE_STUB(BinaryOpWithAllocationSite, BinaryOpICStub); |
| 1349 }; | 1349 }; |
| 1350 | 1350 |
| 1351 | 1351 |
| 1352 enum StringAddFlags { | 1352 enum StringAddFlags { |
| 1353 // Omit both parameter checks. | 1353 // Omit both parameter checks. |
| 1354 STRING_ADD_CHECK_NONE = 0, | 1354 STRING_ADD_CHECK_NONE = 0, |
| 1355 // Check left parameter. | 1355 // Check left parameter. |
| 1356 STRING_ADD_CHECK_LEFT = 1 << 0, | 1356 STRING_ADD_CHECK_LEFT = 1 << 0, |
| 1357 // Check right parameter. | 1357 // Check right parameter. |
| 1358 STRING_ADD_CHECK_RIGHT = 1 << 1, | 1358 STRING_ADD_CHECK_RIGHT = 1 << 1, |
| 1359 // Check both parameters. | 1359 // Check both parameters. |
| 1360 STRING_ADD_CHECK_BOTH = STRING_ADD_CHECK_LEFT | STRING_ADD_CHECK_RIGHT | 1360 STRING_ADD_CHECK_BOTH = STRING_ADD_CHECK_LEFT | STRING_ADD_CHECK_RIGHT |
| 1361 }; | 1361 }; |
| 1362 | 1362 |
| 1363 | 1363 |
| 1364 class StringAddStub FINAL : public HydrogenCodeStub { | 1364 class StringAddStub final : public HydrogenCodeStub { |
| 1365 public: | 1365 public: |
| 1366 StringAddStub(Isolate* isolate, StringAddFlags flags, | 1366 StringAddStub(Isolate* isolate, StringAddFlags flags, |
| 1367 PretenureFlag pretenure_flag) | 1367 PretenureFlag pretenure_flag) |
| 1368 : HydrogenCodeStub(isolate) { | 1368 : HydrogenCodeStub(isolate) { |
| 1369 set_sub_minor_key(StringAddFlagsBits::encode(flags) | | 1369 set_sub_minor_key(StringAddFlagsBits::encode(flags) | |
| 1370 PretenureFlagBits::encode(pretenure_flag)); | 1370 PretenureFlagBits::encode(pretenure_flag)); |
| 1371 } | 1371 } |
| 1372 | 1372 |
| 1373 StringAddFlags flags() const { | 1373 StringAddFlags flags() const { |
| 1374 return StringAddFlagsBits::decode(sub_minor_key()); | 1374 return StringAddFlagsBits::decode(sub_minor_key()); |
| 1375 } | 1375 } |
| 1376 | 1376 |
| 1377 PretenureFlag pretenure_flag() const { | 1377 PretenureFlag pretenure_flag() const { |
| 1378 return PretenureFlagBits::decode(sub_minor_key()); | 1378 return PretenureFlagBits::decode(sub_minor_key()); |
| 1379 } | 1379 } |
| 1380 | 1380 |
| 1381 // Parameters accessed via CodeStubGraphBuilder::GetParameter() | 1381 // Parameters accessed via CodeStubGraphBuilder::GetParameter() |
| 1382 static const int kLeft = 0; | 1382 static const int kLeft = 0; |
| 1383 static const int kRight = 1; | 1383 static const int kRight = 1; |
| 1384 | 1384 |
| 1385 private: | 1385 private: |
| 1386 class StringAddFlagsBits: public BitField<StringAddFlags, 0, 2> {}; | 1386 class StringAddFlagsBits: public BitField<StringAddFlags, 0, 2> {}; |
| 1387 class PretenureFlagBits: public BitField<PretenureFlag, 2, 1> {}; | 1387 class PretenureFlagBits: public BitField<PretenureFlag, 2, 1> {}; |
| 1388 | 1388 |
| 1389 void PrintBaseName(std::ostream& os) const OVERRIDE; // NOLINT | 1389 void PrintBaseName(std::ostream& os) const override; // NOLINT |
| 1390 | 1390 |
| 1391 DEFINE_CALL_INTERFACE_DESCRIPTOR(StringAdd); | 1391 DEFINE_CALL_INTERFACE_DESCRIPTOR(StringAdd); |
| 1392 DEFINE_HYDROGEN_CODE_STUB(StringAdd, HydrogenCodeStub); | 1392 DEFINE_HYDROGEN_CODE_STUB(StringAdd, HydrogenCodeStub); |
| 1393 }; | 1393 }; |
| 1394 | 1394 |
| 1395 | 1395 |
| 1396 class CompareICStub : public PlatformCodeStub { | 1396 class CompareICStub : public PlatformCodeStub { |
| 1397 public: | 1397 public: |
| 1398 CompareICStub(Isolate* isolate, Token::Value op, CompareICState::State left, | 1398 CompareICStub(Isolate* isolate, Token::Value op, CompareICState::State left, |
| 1399 CompareICState::State right, CompareICState::State state) | 1399 CompareICState::State right, CompareICState::State state) |
| 1400 : PlatformCodeStub(isolate) { | 1400 : PlatformCodeStub(isolate) { |
| 1401 DCHECK(Token::IsCompareOp(op)); | 1401 DCHECK(Token::IsCompareOp(op)); |
| 1402 minor_key_ = OpBits::encode(op - Token::EQ) | LeftStateBits::encode(left) | | 1402 minor_key_ = OpBits::encode(op - Token::EQ) | LeftStateBits::encode(left) | |
| 1403 RightStateBits::encode(right) | StateBits::encode(state); | 1403 RightStateBits::encode(right) | StateBits::encode(state); |
| 1404 } | 1404 } |
| 1405 | 1405 |
| 1406 void set_known_map(Handle<Map> map) { known_map_ = map; } | 1406 void set_known_map(Handle<Map> map) { known_map_ = map; } |
| 1407 | 1407 |
| 1408 InlineCacheState GetICState() const OVERRIDE; | 1408 InlineCacheState GetICState() const override; |
| 1409 | 1409 |
| 1410 Token::Value op() const { | 1410 Token::Value op() const { |
| 1411 return static_cast<Token::Value>(Token::EQ + OpBits::decode(minor_key_)); | 1411 return static_cast<Token::Value>(Token::EQ + OpBits::decode(minor_key_)); |
| 1412 } | 1412 } |
| 1413 | 1413 |
| 1414 CompareICState::State left() const { | 1414 CompareICState::State left() const { |
| 1415 return LeftStateBits::decode(minor_key_); | 1415 return LeftStateBits::decode(minor_key_); |
| 1416 } | 1416 } |
| 1417 CompareICState::State right() const { | 1417 CompareICState::State right() const { |
| 1418 return RightStateBits::decode(minor_key_); | 1418 return RightStateBits::decode(minor_key_); |
| 1419 } | 1419 } |
| 1420 CompareICState::State state() const { return StateBits::decode(minor_key_); } | 1420 CompareICState::State state() const { return StateBits::decode(minor_key_); } |
| 1421 | 1421 |
| 1422 private: | 1422 private: |
| 1423 Code::Kind GetCodeKind() const OVERRIDE { return Code::COMPARE_IC; } | 1423 Code::Kind GetCodeKind() const override { return Code::COMPARE_IC; } |
| 1424 | 1424 |
| 1425 void GenerateSmis(MacroAssembler* masm); | 1425 void GenerateSmis(MacroAssembler* masm); |
| 1426 void GenerateNumbers(MacroAssembler* masm); | 1426 void GenerateNumbers(MacroAssembler* masm); |
| 1427 void GenerateInternalizedStrings(MacroAssembler* masm); | 1427 void GenerateInternalizedStrings(MacroAssembler* masm); |
| 1428 void GenerateStrings(MacroAssembler* masm); | 1428 void GenerateStrings(MacroAssembler* masm); |
| 1429 void GenerateUniqueNames(MacroAssembler* masm); | 1429 void GenerateUniqueNames(MacroAssembler* masm); |
| 1430 void GenerateObjects(MacroAssembler* masm); | 1430 void GenerateObjects(MacroAssembler* masm); |
| 1431 void GenerateMiss(MacroAssembler* masm); | 1431 void GenerateMiss(MacroAssembler* masm); |
| 1432 void GenerateKnownObjects(MacroAssembler* masm); | 1432 void GenerateKnownObjects(MacroAssembler* masm); |
| 1433 void GenerateGeneric(MacroAssembler* masm); | 1433 void GenerateGeneric(MacroAssembler* masm); |
| 1434 | 1434 |
| 1435 bool strict() const { return op() == Token::EQ_STRICT; } | 1435 bool strict() const { return op() == Token::EQ_STRICT; } |
| 1436 Condition GetCondition() const; | 1436 Condition GetCondition() const; |
| 1437 | 1437 |
| 1438 void AddToSpecialCache(Handle<Code> new_object) OVERRIDE; | 1438 void AddToSpecialCache(Handle<Code> new_object) override; |
| 1439 bool FindCodeInSpecialCache(Code** code_out) OVERRIDE; | 1439 bool FindCodeInSpecialCache(Code** code_out) override; |
| 1440 bool UseSpecialCache() OVERRIDE { | 1440 bool UseSpecialCache() override { |
| 1441 return state() == CompareICState::KNOWN_OBJECT; | 1441 return state() == CompareICState::KNOWN_OBJECT; |
| 1442 } | 1442 } |
| 1443 | 1443 |
| 1444 class OpBits : public BitField<int, 0, 3> {}; | 1444 class OpBits : public BitField<int, 0, 3> {}; |
| 1445 class LeftStateBits : public BitField<CompareICState::State, 3, 4> {}; | 1445 class LeftStateBits : public BitField<CompareICState::State, 3, 4> {}; |
| 1446 class RightStateBits : public BitField<CompareICState::State, 7, 4> {}; | 1446 class RightStateBits : public BitField<CompareICState::State, 7, 4> {}; |
| 1447 class StateBits : public BitField<CompareICState::State, 11, 4> {}; | 1447 class StateBits : public BitField<CompareICState::State, 11, 4> {}; |
| 1448 | 1448 |
| 1449 Handle<Map> known_map_; | 1449 Handle<Map> known_map_; |
| 1450 | 1450 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 1466 InitializationState init_state = INITIALIZED) | 1466 InitializationState init_state = INITIALIZED) |
| 1467 : HydrogenCodeStub(isolate, init_state) { | 1467 : HydrogenCodeStub(isolate, init_state) { |
| 1468 set_sub_minor_key(ic_state); | 1468 set_sub_minor_key(ic_state); |
| 1469 } | 1469 } |
| 1470 | 1470 |
| 1471 static Handle<Code> GetUninitialized(Isolate* isolate, | 1471 static Handle<Code> GetUninitialized(Isolate* isolate, |
| 1472 NilValue nil) { | 1472 NilValue nil) { |
| 1473 return CompareNilICStub(isolate, nil, UNINITIALIZED).GetCode(); | 1473 return CompareNilICStub(isolate, nil, UNINITIALIZED).GetCode(); |
| 1474 } | 1474 } |
| 1475 | 1475 |
| 1476 InlineCacheState GetICState() const OVERRIDE { | 1476 InlineCacheState GetICState() const override { |
| 1477 State state = this->state(); | 1477 State state = this->state(); |
| 1478 if (state.Contains(GENERIC)) { | 1478 if (state.Contains(GENERIC)) { |
| 1479 return MEGAMORPHIC; | 1479 return MEGAMORPHIC; |
| 1480 } else if (state.Contains(MONOMORPHIC_MAP)) { | 1480 } else if (state.Contains(MONOMORPHIC_MAP)) { |
| 1481 return MONOMORPHIC; | 1481 return MONOMORPHIC; |
| 1482 } else { | 1482 } else { |
| 1483 return PREMONOMORPHIC; | 1483 return PREMONOMORPHIC; |
| 1484 } | 1484 } |
| 1485 } | 1485 } |
| 1486 | 1486 |
| 1487 Code::Kind GetCodeKind() const OVERRIDE { return Code::COMPARE_NIL_IC; } | 1487 Code::Kind GetCodeKind() const override { return Code::COMPARE_NIL_IC; } |
| 1488 | 1488 |
| 1489 ExtraICState GetExtraICState() const OVERRIDE { return sub_minor_key(); } | 1489 ExtraICState GetExtraICState() const override { return sub_minor_key(); } |
| 1490 | 1490 |
| 1491 void UpdateStatus(Handle<Object> object); | 1491 void UpdateStatus(Handle<Object> object); |
| 1492 | 1492 |
| 1493 bool IsMonomorphic() const { return state().Contains(MONOMORPHIC_MAP); } | 1493 bool IsMonomorphic() const { return state().Contains(MONOMORPHIC_MAP); } |
| 1494 | 1494 |
| 1495 NilValue nil_value() const { return NilValueBits::decode(sub_minor_key()); } | 1495 NilValue nil_value() const { return NilValueBits::decode(sub_minor_key()); } |
| 1496 | 1496 |
| 1497 void ClearState() { | 1497 void ClearState() { |
| 1498 set_sub_minor_key(TypesBits::update(sub_minor_key(), 0)); | 1498 set_sub_minor_key(TypesBits::update(sub_minor_key(), 0)); |
| 1499 } | 1499 } |
| 1500 | 1500 |
| 1501 void PrintState(std::ostream& os) const OVERRIDE; // NOLINT | 1501 void PrintState(std::ostream& os) const override; // NOLINT |
| 1502 void PrintBaseName(std::ostream& os) const OVERRIDE; // NOLINT | 1502 void PrintBaseName(std::ostream& os) const override; // NOLINT |
| 1503 | 1503 |
| 1504 private: | 1504 private: |
| 1505 CompareNilICStub(Isolate* isolate, NilValue nil, | 1505 CompareNilICStub(Isolate* isolate, NilValue nil, |
| 1506 InitializationState init_state) | 1506 InitializationState init_state) |
| 1507 : HydrogenCodeStub(isolate, init_state) { | 1507 : HydrogenCodeStub(isolate, init_state) { |
| 1508 set_sub_minor_key(NilValueBits::encode(nil)); | 1508 set_sub_minor_key(NilValueBits::encode(nil)); |
| 1509 } | 1509 } |
| 1510 | 1510 |
| 1511 enum CompareNilType { | 1511 enum CompareNilType { |
| 1512 UNDEFINED, | 1512 UNDEFINED, |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1560 // their code generation. On machines that always have gp registers (x64) we | 1560 // their code generation. On machines that always have gp registers (x64) we |
| 1561 // can generate both variants ahead of time. | 1561 // can generate both variants ahead of time. |
| 1562 static void GenerateAheadOfTime(Isolate* isolate); | 1562 static void GenerateAheadOfTime(Isolate* isolate); |
| 1563 | 1563 |
| 1564 private: | 1564 private: |
| 1565 bool save_doubles() const { return SaveDoublesBits::decode(minor_key_); } | 1565 bool save_doubles() const { return SaveDoublesBits::decode(minor_key_); } |
| 1566 #if _WIN64 || V8_TARGET_ARCH_PPC | 1566 #if _WIN64 || V8_TARGET_ARCH_PPC |
| 1567 int result_size() const { return ResultSizeBits::decode(minor_key_); } | 1567 int result_size() const { return ResultSizeBits::decode(minor_key_); } |
| 1568 #endif // _WIN64 | 1568 #endif // _WIN64 |
| 1569 | 1569 |
| 1570 bool NeedsImmovableCode() OVERRIDE; | 1570 bool NeedsImmovableCode() override; |
| 1571 | 1571 |
| 1572 class SaveDoublesBits : public BitField<bool, 0, 1> {}; | 1572 class SaveDoublesBits : public BitField<bool, 0, 1> {}; |
| 1573 class ResultSizeBits : public BitField<int, 1, 3> {}; | 1573 class ResultSizeBits : public BitField<int, 1, 3> {}; |
| 1574 | 1574 |
| 1575 DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR(); | 1575 DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR(); |
| 1576 DEFINE_PLATFORM_CODE_STUB(CEntry, PlatformCodeStub); | 1576 DEFINE_PLATFORM_CODE_STUB(CEntry, PlatformCodeStub); |
| 1577 }; | 1577 }; |
| 1578 | 1578 |
| 1579 | 1579 |
| 1580 class JSEntryStub : public PlatformCodeStub { | 1580 class JSEntryStub : public PlatformCodeStub { |
| 1581 public: | 1581 public: |
| 1582 JSEntryStub(Isolate* isolate, StackFrame::Type type) | 1582 JSEntryStub(Isolate* isolate, StackFrame::Type type) |
| 1583 : PlatformCodeStub(isolate) { | 1583 : PlatformCodeStub(isolate) { |
| 1584 DCHECK(type == StackFrame::ENTRY || type == StackFrame::ENTRY_CONSTRUCT); | 1584 DCHECK(type == StackFrame::ENTRY || type == StackFrame::ENTRY_CONSTRUCT); |
| 1585 minor_key_ = StackFrameTypeBits::encode(type); | 1585 minor_key_ = StackFrameTypeBits::encode(type); |
| 1586 } | 1586 } |
| 1587 | 1587 |
| 1588 private: | 1588 private: |
| 1589 void FinishCode(Handle<Code> code) OVERRIDE; | 1589 void FinishCode(Handle<Code> code) override; |
| 1590 | 1590 |
| 1591 void PrintName(std::ostream& os) const OVERRIDE { // NOLINT | 1591 void PrintName(std::ostream& os) const override { // NOLINT |
| 1592 os << (type() == StackFrame::ENTRY ? "JSEntryStub" | 1592 os << (type() == StackFrame::ENTRY ? "JSEntryStub" |
| 1593 : "JSConstructEntryStub"); | 1593 : "JSConstructEntryStub"); |
| 1594 } | 1594 } |
| 1595 | 1595 |
| 1596 StackFrame::Type type() const { | 1596 StackFrame::Type type() const { |
| 1597 return StackFrameTypeBits::decode(minor_key_); | 1597 return StackFrameTypeBits::decode(minor_key_); |
| 1598 } | 1598 } |
| 1599 | 1599 |
| 1600 class StackFrameTypeBits : public BitField<StackFrame::Type, 0, 5> {}; | 1600 class StackFrameTypeBits : public BitField<StackFrame::Type, 0, 5> {}; |
| 1601 | 1601 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 1617 | 1617 |
| 1618 enum HasNewTarget { NO_NEW_TARGET, HAS_NEW_TARGET }; | 1618 enum HasNewTarget { NO_NEW_TARGET, HAS_NEW_TARGET }; |
| 1619 | 1619 |
| 1620 ArgumentsAccessStub(Isolate* isolate, Type type, | 1620 ArgumentsAccessStub(Isolate* isolate, Type type, |
| 1621 HasNewTarget has_new_target = NO_NEW_TARGET) | 1621 HasNewTarget has_new_target = NO_NEW_TARGET) |
| 1622 : PlatformCodeStub(isolate) { | 1622 : PlatformCodeStub(isolate) { |
| 1623 minor_key_ = | 1623 minor_key_ = |
| 1624 TypeBits::encode(type) | HasNewTargetBits::encode(has_new_target); | 1624 TypeBits::encode(type) | HasNewTargetBits::encode(has_new_target); |
| 1625 } | 1625 } |
| 1626 | 1626 |
| 1627 CallInterfaceDescriptor GetCallInterfaceDescriptor() OVERRIDE { | 1627 CallInterfaceDescriptor GetCallInterfaceDescriptor() override { |
| 1628 if (type() == READ_ELEMENT) { | 1628 if (type() == READ_ELEMENT) { |
| 1629 return ArgumentsAccessReadDescriptor(isolate()); | 1629 return ArgumentsAccessReadDescriptor(isolate()); |
| 1630 } | 1630 } |
| 1631 return ContextOnlyDescriptor(isolate()); | 1631 return ContextOnlyDescriptor(isolate()); |
| 1632 } | 1632 } |
| 1633 | 1633 |
| 1634 private: | 1634 private: |
| 1635 Type type() const { return TypeBits::decode(minor_key_); } | 1635 Type type() const { return TypeBits::decode(minor_key_); } |
| 1636 bool has_new_target() const { | 1636 bool has_new_target() const { |
| 1637 return HasNewTargetBits::decode(minor_key_) == HAS_NEW_TARGET; | 1637 return HasNewTargetBits::decode(minor_key_) == HAS_NEW_TARGET; |
| 1638 } | 1638 } |
| 1639 | 1639 |
| 1640 void GenerateReadElement(MacroAssembler* masm); | 1640 void GenerateReadElement(MacroAssembler* masm); |
| 1641 void GenerateNewStrict(MacroAssembler* masm); | 1641 void GenerateNewStrict(MacroAssembler* masm); |
| 1642 void GenerateNewSloppyFast(MacroAssembler* masm); | 1642 void GenerateNewSloppyFast(MacroAssembler* masm); |
| 1643 void GenerateNewSloppySlow(MacroAssembler* masm); | 1643 void GenerateNewSloppySlow(MacroAssembler* masm); |
| 1644 | 1644 |
| 1645 void PrintName(std::ostream& os) const OVERRIDE; // NOLINT | 1645 void PrintName(std::ostream& os) const override; // NOLINT |
| 1646 | 1646 |
| 1647 class TypeBits : public BitField<Type, 0, 2> {}; | 1647 class TypeBits : public BitField<Type, 0, 2> {}; |
| 1648 class HasNewTargetBits : public BitField<HasNewTarget, 2, 1> {}; | 1648 class HasNewTargetBits : public BitField<HasNewTarget, 2, 1> {}; |
| 1649 | 1649 |
| 1650 DEFINE_PLATFORM_CODE_STUB(ArgumentsAccess, PlatformCodeStub); | 1650 DEFINE_PLATFORM_CODE_STUB(ArgumentsAccess, PlatformCodeStub); |
| 1651 }; | 1651 }; |
| 1652 | 1652 |
| 1653 | 1653 |
| 1654 class RestParamAccessStub: public PlatformCodeStub { | 1654 class RestParamAccessStub: public PlatformCodeStub { |
| 1655 public: | 1655 public: |
| 1656 explicit RestParamAccessStub(Isolate* isolate) : PlatformCodeStub(isolate) { } | 1656 explicit RestParamAccessStub(Isolate* isolate) : PlatformCodeStub(isolate) { } |
| 1657 | 1657 |
| 1658 CallInterfaceDescriptor GetCallInterfaceDescriptor() OVERRIDE { | 1658 CallInterfaceDescriptor GetCallInterfaceDescriptor() override { |
| 1659 return ContextOnlyDescriptor(isolate()); | 1659 return ContextOnlyDescriptor(isolate()); |
| 1660 } | 1660 } |
| 1661 | 1661 |
| 1662 private: | 1662 private: |
| 1663 void GenerateNew(MacroAssembler* masm); | 1663 void GenerateNew(MacroAssembler* masm); |
| 1664 | 1664 |
| 1665 virtual void PrintName(std::ostream& os) const OVERRIDE; // NOLINT | 1665 virtual void PrintName(std::ostream& os) const override; // NOLINT |
| 1666 | 1666 |
| 1667 DEFINE_PLATFORM_CODE_STUB(RestParamAccess, PlatformCodeStub); | 1667 DEFINE_PLATFORM_CODE_STUB(RestParamAccess, PlatformCodeStub); |
| 1668 }; | 1668 }; |
| 1669 | 1669 |
| 1670 | 1670 |
| 1671 class RegExpExecStub: public PlatformCodeStub { | 1671 class RegExpExecStub: public PlatformCodeStub { |
| 1672 public: | 1672 public: |
| 1673 explicit RegExpExecStub(Isolate* isolate) : PlatformCodeStub(isolate) { } | 1673 explicit RegExpExecStub(Isolate* isolate) : PlatformCodeStub(isolate) { } |
| 1674 | 1674 |
| 1675 DEFINE_CALL_INTERFACE_DESCRIPTOR(ContextOnly); | 1675 DEFINE_CALL_INTERFACE_DESCRIPTOR(ContextOnly); |
| 1676 DEFINE_PLATFORM_CODE_STUB(RegExpExec, PlatformCodeStub); | 1676 DEFINE_PLATFORM_CODE_STUB(RegExpExec, PlatformCodeStub); |
| 1677 }; | 1677 }; |
| 1678 | 1678 |
| 1679 | 1679 |
| 1680 class RegExpConstructResultStub FINAL : public HydrogenCodeStub { | 1680 class RegExpConstructResultStub final : public HydrogenCodeStub { |
| 1681 public: | 1681 public: |
| 1682 explicit RegExpConstructResultStub(Isolate* isolate) | 1682 explicit RegExpConstructResultStub(Isolate* isolate) |
| 1683 : HydrogenCodeStub(isolate) { } | 1683 : HydrogenCodeStub(isolate) { } |
| 1684 | 1684 |
| 1685 // Parameters accessed via CodeStubGraphBuilder::GetParameter() | 1685 // Parameters accessed via CodeStubGraphBuilder::GetParameter() |
| 1686 static const int kLength = 0; | 1686 static const int kLength = 0; |
| 1687 static const int kIndex = 1; | 1687 static const int kIndex = 1; |
| 1688 static const int kInput = 2; | 1688 static const int kInput = 2; |
| 1689 | 1689 |
| 1690 DEFINE_CALL_INTERFACE_DESCRIPTOR(RegExpConstructResult); | 1690 DEFINE_CALL_INTERFACE_DESCRIPTOR(RegExpConstructResult); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 1707 private: | 1707 private: |
| 1708 int argc() const { return ArgcBits::decode(minor_key_); } | 1708 int argc() const { return ArgcBits::decode(minor_key_); } |
| 1709 int flags() const { return FlagBits::decode(minor_key_); } | 1709 int flags() const { return FlagBits::decode(minor_key_); } |
| 1710 | 1710 |
| 1711 bool CallAsMethod() const { | 1711 bool CallAsMethod() const { |
| 1712 return flags() == CALL_AS_METHOD || flags() == WRAP_AND_CALL; | 1712 return flags() == CALL_AS_METHOD || flags() == WRAP_AND_CALL; |
| 1713 } | 1713 } |
| 1714 | 1714 |
| 1715 bool NeedsChecks() const { return flags() != WRAP_AND_CALL; } | 1715 bool NeedsChecks() const { return flags() != WRAP_AND_CALL; } |
| 1716 | 1716 |
| 1717 void PrintName(std::ostream& os) const OVERRIDE; // NOLINT | 1717 void PrintName(std::ostream& os) const override; // NOLINT |
| 1718 | 1718 |
| 1719 // Minor key encoding in 32 bits with Bitfield <Type, shift, size>. | 1719 // Minor key encoding in 32 bits with Bitfield <Type, shift, size>. |
| 1720 class FlagBits : public BitField<CallFunctionFlags, 0, 2> {}; | 1720 class FlagBits : public BitField<CallFunctionFlags, 0, 2> {}; |
| 1721 class ArgcBits : public BitField<unsigned, 2, Code::kArgumentsBits> {}; | 1721 class ArgcBits : public BitField<unsigned, 2, Code::kArgumentsBits> {}; |
| 1722 STATIC_ASSERT(Code::kArgumentsBits + 2 <= kStubMinorKeyBits); | 1722 STATIC_ASSERT(Code::kArgumentsBits + 2 <= kStubMinorKeyBits); |
| 1723 | 1723 |
| 1724 DEFINE_CALL_INTERFACE_DESCRIPTOR(CallFunction); | 1724 DEFINE_CALL_INTERFACE_DESCRIPTOR(CallFunction); |
| 1725 DEFINE_PLATFORM_CODE_STUB(CallFunction, PlatformCodeStub); | 1725 DEFINE_PLATFORM_CODE_STUB(CallFunction, PlatformCodeStub); |
| 1726 }; | 1726 }; |
| 1727 | 1727 |
| 1728 | 1728 |
| 1729 class CallConstructStub: public PlatformCodeStub { | 1729 class CallConstructStub: public PlatformCodeStub { |
| 1730 public: | 1730 public: |
| 1731 CallConstructStub(Isolate* isolate, CallConstructorFlags flags) | 1731 CallConstructStub(Isolate* isolate, CallConstructorFlags flags) |
| 1732 : PlatformCodeStub(isolate) { | 1732 : PlatformCodeStub(isolate) { |
| 1733 minor_key_ = FlagBits::encode(flags); | 1733 minor_key_ = FlagBits::encode(flags); |
| 1734 } | 1734 } |
| 1735 | 1735 |
| 1736 void FinishCode(Handle<Code> code) OVERRIDE { | 1736 void FinishCode(Handle<Code> code) override { |
| 1737 code->set_has_function_cache(RecordCallTarget()); | 1737 code->set_has_function_cache(RecordCallTarget()); |
| 1738 } | 1738 } |
| 1739 | 1739 |
| 1740 private: | 1740 private: |
| 1741 CallConstructorFlags flags() const { return FlagBits::decode(minor_key_); } | 1741 CallConstructorFlags flags() const { return FlagBits::decode(minor_key_); } |
| 1742 | 1742 |
| 1743 bool RecordCallTarget() const { | 1743 bool RecordCallTarget() const { |
| 1744 return (flags() & RECORD_CONSTRUCTOR_TARGET) != 0; | 1744 return (flags() & RECORD_CONSTRUCTOR_TARGET) != 0; |
| 1745 } | 1745 } |
| 1746 | 1746 |
| 1747 bool IsSuperConstructorCall() const { | 1747 bool IsSuperConstructorCall() const { |
| 1748 return (flags() & SUPER_CONSTRUCTOR_CALL) != 0; | 1748 return (flags() & SUPER_CONSTRUCTOR_CALL) != 0; |
| 1749 } | 1749 } |
| 1750 | 1750 |
| 1751 void PrintName(std::ostream& os) const OVERRIDE; // NOLINT | 1751 void PrintName(std::ostream& os) const override; // NOLINT |
| 1752 | 1752 |
| 1753 class FlagBits : public BitField<CallConstructorFlags, 0, 2> {}; | 1753 class FlagBits : public BitField<CallConstructorFlags, 0, 2> {}; |
| 1754 | 1754 |
| 1755 DEFINE_CALL_INTERFACE_DESCRIPTOR(CallConstruct); | 1755 DEFINE_CALL_INTERFACE_DESCRIPTOR(CallConstruct); |
| 1756 DEFINE_PLATFORM_CODE_STUB(CallConstruct, PlatformCodeStub); | 1756 DEFINE_PLATFORM_CODE_STUB(CallConstruct, PlatformCodeStub); |
| 1757 }; | 1757 }; |
| 1758 | 1758 |
| 1759 | 1759 |
| 1760 enum StringIndexFlags { | 1760 enum StringIndexFlags { |
| 1761 // Accepts smis or heap numbers. | 1761 // Accepts smis or heap numbers. |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1940 | 1940 |
| 1941 DISALLOW_COPY_AND_ASSIGN(StringCharAtGenerator); | 1941 DISALLOW_COPY_AND_ASSIGN(StringCharAtGenerator); |
| 1942 }; | 1942 }; |
| 1943 | 1943 |
| 1944 | 1944 |
| 1945 class LoadDictionaryElementStub : public HydrogenCodeStub { | 1945 class LoadDictionaryElementStub : public HydrogenCodeStub { |
| 1946 public: | 1946 public: |
| 1947 explicit LoadDictionaryElementStub(Isolate* isolate) | 1947 explicit LoadDictionaryElementStub(Isolate* isolate) |
| 1948 : HydrogenCodeStub(isolate) {} | 1948 : HydrogenCodeStub(isolate) {} |
| 1949 | 1949 |
| 1950 CallInterfaceDescriptor GetCallInterfaceDescriptor() OVERRIDE { | 1950 CallInterfaceDescriptor GetCallInterfaceDescriptor() override { |
| 1951 if (FLAG_vector_ics) { | 1951 if (FLAG_vector_ics) { |
| 1952 return VectorLoadICDescriptor(isolate()); | 1952 return VectorLoadICDescriptor(isolate()); |
| 1953 } | 1953 } |
| 1954 return LoadDescriptor(isolate()); | 1954 return LoadDescriptor(isolate()); |
| 1955 } | 1955 } |
| 1956 | 1956 |
| 1957 DEFINE_HYDROGEN_CODE_STUB(LoadDictionaryElement, HydrogenCodeStub); | 1957 DEFINE_HYDROGEN_CODE_STUB(LoadDictionaryElement, HydrogenCodeStub); |
| 1958 }; | 1958 }; |
| 1959 | 1959 |
| 1960 | 1960 |
| 1961 class KeyedLoadGenericStub : public HydrogenCodeStub { | 1961 class KeyedLoadGenericStub : public HydrogenCodeStub { |
| 1962 public: | 1962 public: |
| 1963 explicit KeyedLoadGenericStub(Isolate* isolate) : HydrogenCodeStub(isolate) {} | 1963 explicit KeyedLoadGenericStub(Isolate* isolate) : HydrogenCodeStub(isolate) {} |
| 1964 | 1964 |
| 1965 Code::Kind GetCodeKind() const OVERRIDE { return Code::KEYED_LOAD_IC; } | 1965 Code::Kind GetCodeKind() const override { return Code::KEYED_LOAD_IC; } |
| 1966 InlineCacheState GetICState() const OVERRIDE { return GENERIC; } | 1966 InlineCacheState GetICState() const override { return GENERIC; } |
| 1967 | 1967 |
| 1968 // Since KeyedLoadGeneric stub doesn't miss (simply calls runtime), it | 1968 // Since KeyedLoadGeneric stub doesn't miss (simply calls runtime), it |
| 1969 // doesn't need to use the VectorLoadICDescriptor for the case when | 1969 // doesn't need to use the VectorLoadICDescriptor for the case when |
| 1970 // flag --vector-ics is true. | 1970 // flag --vector-ics is true. |
| 1971 DEFINE_CALL_INTERFACE_DESCRIPTOR(Load); | 1971 DEFINE_CALL_INTERFACE_DESCRIPTOR(Load); |
| 1972 | 1972 |
| 1973 DEFINE_HYDROGEN_CODE_STUB(KeyedLoadGeneric, HydrogenCodeStub); | 1973 DEFINE_HYDROGEN_CODE_STUB(KeyedLoadGeneric, HydrogenCodeStub); |
| 1974 }; | 1974 }; |
| 1975 | 1975 |
| 1976 | 1976 |
| 1977 class LoadICTrampolineStub : public PlatformCodeStub { | 1977 class LoadICTrampolineStub : public PlatformCodeStub { |
| 1978 public: | 1978 public: |
| 1979 LoadICTrampolineStub(Isolate* isolate, const LoadICState& state) | 1979 LoadICTrampolineStub(Isolate* isolate, const LoadICState& state) |
| 1980 : PlatformCodeStub(isolate) { | 1980 : PlatformCodeStub(isolate) { |
| 1981 minor_key_ = state.GetExtraICState(); | 1981 minor_key_ = state.GetExtraICState(); |
| 1982 } | 1982 } |
| 1983 | 1983 |
| 1984 Code::Kind GetCodeKind() const OVERRIDE { return Code::LOAD_IC; } | 1984 Code::Kind GetCodeKind() const override { return Code::LOAD_IC; } |
| 1985 | 1985 |
| 1986 InlineCacheState GetICState() const FINAL { return DEFAULT; } | 1986 InlineCacheState GetICState() const final { return DEFAULT; } |
| 1987 | 1987 |
| 1988 ExtraICState GetExtraICState() const FINAL { | 1988 ExtraICState GetExtraICState() const final { |
| 1989 return static_cast<ExtraICState>(minor_key_); | 1989 return static_cast<ExtraICState>(minor_key_); |
| 1990 } | 1990 } |
| 1991 | 1991 |
| 1992 private: | 1992 private: |
| 1993 LoadICState state() const { | 1993 LoadICState state() const { |
| 1994 return LoadICState(static_cast<ExtraICState>(minor_key_)); | 1994 return LoadICState(static_cast<ExtraICState>(minor_key_)); |
| 1995 } | 1995 } |
| 1996 | 1996 |
| 1997 DEFINE_CALL_INTERFACE_DESCRIPTOR(VectorLoadICTrampoline); | 1997 DEFINE_CALL_INTERFACE_DESCRIPTOR(VectorLoadICTrampoline); |
| 1998 DEFINE_PLATFORM_CODE_STUB(LoadICTrampoline, PlatformCodeStub); | 1998 DEFINE_PLATFORM_CODE_STUB(LoadICTrampoline, PlatformCodeStub); |
| 1999 }; | 1999 }; |
| 2000 | 2000 |
| 2001 | 2001 |
| 2002 class KeyedLoadICTrampolineStub : public LoadICTrampolineStub { | 2002 class KeyedLoadICTrampolineStub : public LoadICTrampolineStub { |
| 2003 public: | 2003 public: |
| 2004 explicit KeyedLoadICTrampolineStub(Isolate* isolate) | 2004 explicit KeyedLoadICTrampolineStub(Isolate* isolate) |
| 2005 : LoadICTrampolineStub(isolate, LoadICState(0)) {} | 2005 : LoadICTrampolineStub(isolate, LoadICState(0)) {} |
| 2006 | 2006 |
| 2007 Code::Kind GetCodeKind() const OVERRIDE { return Code::KEYED_LOAD_IC; } | 2007 Code::Kind GetCodeKind() const override { return Code::KEYED_LOAD_IC; } |
| 2008 | 2008 |
| 2009 DEFINE_PLATFORM_CODE_STUB(KeyedLoadICTrampoline, LoadICTrampolineStub); | 2009 DEFINE_PLATFORM_CODE_STUB(KeyedLoadICTrampoline, LoadICTrampolineStub); |
| 2010 }; | 2010 }; |
| 2011 | 2011 |
| 2012 | 2012 |
| 2013 class CallICTrampolineStub : public PlatformCodeStub { | 2013 class CallICTrampolineStub : public PlatformCodeStub { |
| 2014 public: | 2014 public: |
| 2015 CallICTrampolineStub(Isolate* isolate, const CallICState& state) | 2015 CallICTrampolineStub(Isolate* isolate, const CallICState& state) |
| 2016 : PlatformCodeStub(isolate) { | 2016 : PlatformCodeStub(isolate) { |
| 2017 minor_key_ = state.GetExtraICState(); | 2017 minor_key_ = state.GetExtraICState(); |
| 2018 } | 2018 } |
| 2019 | 2019 |
| 2020 Code::Kind GetCodeKind() const OVERRIDE { return Code::CALL_IC; } | 2020 Code::Kind GetCodeKind() const override { return Code::CALL_IC; } |
| 2021 | 2021 |
| 2022 InlineCacheState GetICState() const FINAL { return DEFAULT; } | 2022 InlineCacheState GetICState() const final { return DEFAULT; } |
| 2023 | 2023 |
| 2024 ExtraICState GetExtraICState() const FINAL { | 2024 ExtraICState GetExtraICState() const final { |
| 2025 return static_cast<ExtraICState>(minor_key_); | 2025 return static_cast<ExtraICState>(minor_key_); |
| 2026 } | 2026 } |
| 2027 | 2027 |
| 2028 protected: | 2028 protected: |
| 2029 CallICState state() const { | 2029 CallICState state() const { |
| 2030 return CallICState(static_cast<ExtraICState>(minor_key_)); | 2030 return CallICState(static_cast<ExtraICState>(minor_key_)); |
| 2031 } | 2031 } |
| 2032 | 2032 |
| 2033 DEFINE_CALL_INTERFACE_DESCRIPTOR(CallFunctionWithFeedback); | 2033 DEFINE_CALL_INTERFACE_DESCRIPTOR(CallFunctionWithFeedback); |
| 2034 DEFINE_PLATFORM_CODE_STUB(CallICTrampoline, PlatformCodeStub); | 2034 DEFINE_PLATFORM_CODE_STUB(CallICTrampoline, PlatformCodeStub); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 2045 }; | 2045 }; |
| 2046 | 2046 |
| 2047 | 2047 |
| 2048 class MegamorphicLoadStub : public HydrogenCodeStub { | 2048 class MegamorphicLoadStub : public HydrogenCodeStub { |
| 2049 public: | 2049 public: |
| 2050 MegamorphicLoadStub(Isolate* isolate, const LoadICState& state) | 2050 MegamorphicLoadStub(Isolate* isolate, const LoadICState& state) |
| 2051 : HydrogenCodeStub(isolate) { | 2051 : HydrogenCodeStub(isolate) { |
| 2052 set_sub_minor_key(state.GetExtraICState()); | 2052 set_sub_minor_key(state.GetExtraICState()); |
| 2053 } | 2053 } |
| 2054 | 2054 |
| 2055 Code::Kind GetCodeKind() const OVERRIDE { return Code::LOAD_IC; } | 2055 Code::Kind GetCodeKind() const override { return Code::LOAD_IC; } |
| 2056 | 2056 |
| 2057 InlineCacheState GetICState() const FINAL { return MEGAMORPHIC; } | 2057 InlineCacheState GetICState() const final { return MEGAMORPHIC; } |
| 2058 | 2058 |
| 2059 ExtraICState GetExtraICState() const FINAL { | 2059 ExtraICState GetExtraICState() const final { |
| 2060 return static_cast<ExtraICState>(sub_minor_key()); | 2060 return static_cast<ExtraICState>(sub_minor_key()); |
| 2061 } | 2061 } |
| 2062 | 2062 |
| 2063 CallInterfaceDescriptor GetCallInterfaceDescriptor() OVERRIDE { | 2063 CallInterfaceDescriptor GetCallInterfaceDescriptor() override { |
| 2064 if (FLAG_vector_ics) { | 2064 if (FLAG_vector_ics) { |
| 2065 return VectorLoadICDescriptor(isolate()); | 2065 return VectorLoadICDescriptor(isolate()); |
| 2066 } | 2066 } |
| 2067 return LoadDescriptor(isolate()); | 2067 return LoadDescriptor(isolate()); |
| 2068 } | 2068 } |
| 2069 | 2069 |
| 2070 DEFINE_HYDROGEN_CODE_STUB(MegamorphicLoad, HydrogenCodeStub); | 2070 DEFINE_HYDROGEN_CODE_STUB(MegamorphicLoad, HydrogenCodeStub); |
| 2071 }; | 2071 }; |
| 2072 | 2072 |
| 2073 | 2073 |
| 2074 class VectorRawLoadStub : public PlatformCodeStub { | 2074 class VectorRawLoadStub : public PlatformCodeStub { |
| 2075 public: | 2075 public: |
| 2076 explicit VectorRawLoadStub(Isolate* isolate, const LoadICState& state) | 2076 explicit VectorRawLoadStub(Isolate* isolate, const LoadICState& state) |
| 2077 : PlatformCodeStub(isolate) { | 2077 : PlatformCodeStub(isolate) { |
| 2078 minor_key_ = state.GetExtraICState(); | 2078 minor_key_ = state.GetExtraICState(); |
| 2079 } | 2079 } |
| 2080 | 2080 |
| 2081 void GenerateForTrampoline(MacroAssembler* masm); | 2081 void GenerateForTrampoline(MacroAssembler* masm); |
| 2082 | 2082 |
| 2083 virtual Code::Kind GetCodeKind() const OVERRIDE { return Code::LOAD_IC; } | 2083 virtual Code::Kind GetCodeKind() const override { return Code::LOAD_IC; } |
| 2084 | 2084 |
| 2085 virtual InlineCacheState GetICState() const FINAL OVERRIDE { return DEFAULT; } | 2085 virtual InlineCacheState GetICState() const final override { return DEFAULT; } |
| 2086 | 2086 |
| 2087 virtual ExtraICState GetExtraICState() const FINAL OVERRIDE { | 2087 virtual ExtraICState GetExtraICState() const final override { |
| 2088 return static_cast<ExtraICState>(minor_key_); | 2088 return static_cast<ExtraICState>(minor_key_); |
| 2089 } | 2089 } |
| 2090 | 2090 |
| 2091 DEFINE_CALL_INTERFACE_DESCRIPTOR(VectorLoadIC); | 2091 DEFINE_CALL_INTERFACE_DESCRIPTOR(VectorLoadIC); |
| 2092 DEFINE_PLATFORM_CODE_STUB(VectorRawLoad, PlatformCodeStub); | 2092 DEFINE_PLATFORM_CODE_STUB(VectorRawLoad, PlatformCodeStub); |
| 2093 | 2093 |
| 2094 protected: | 2094 protected: |
| 2095 void GenerateImpl(MacroAssembler* masm, bool in_frame); | 2095 void GenerateImpl(MacroAssembler* masm, bool in_frame); |
| 2096 }; | 2096 }; |
| 2097 | 2097 |
| 2098 | 2098 |
| 2099 class VectorRawKeyedLoadStub : public PlatformCodeStub { | 2099 class VectorRawKeyedLoadStub : public PlatformCodeStub { |
| 2100 public: | 2100 public: |
| 2101 explicit VectorRawKeyedLoadStub(Isolate* isolate) | 2101 explicit VectorRawKeyedLoadStub(Isolate* isolate) |
| 2102 : PlatformCodeStub(isolate) {} | 2102 : PlatformCodeStub(isolate) {} |
| 2103 | 2103 |
| 2104 void GenerateForTrampoline(MacroAssembler* masm); | 2104 void GenerateForTrampoline(MacroAssembler* masm); |
| 2105 | 2105 |
| 2106 virtual Code::Kind GetCodeKind() const OVERRIDE { | 2106 virtual Code::Kind GetCodeKind() const override { |
| 2107 return Code::KEYED_LOAD_IC; | 2107 return Code::KEYED_LOAD_IC; |
| 2108 } | 2108 } |
| 2109 | 2109 |
| 2110 virtual InlineCacheState GetICState() const FINAL OVERRIDE { return DEFAULT; } | 2110 virtual InlineCacheState GetICState() const final override { return DEFAULT; } |
| 2111 | 2111 |
| 2112 DEFINE_CALL_INTERFACE_DESCRIPTOR(VectorLoadIC); | 2112 DEFINE_CALL_INTERFACE_DESCRIPTOR(VectorLoadIC); |
| 2113 DEFINE_PLATFORM_CODE_STUB(VectorRawKeyedLoad, PlatformCodeStub); | 2113 DEFINE_PLATFORM_CODE_STUB(VectorRawKeyedLoad, PlatformCodeStub); |
| 2114 | 2114 |
| 2115 protected: | 2115 protected: |
| 2116 void GenerateImpl(MacroAssembler* masm, bool in_frame); | 2116 void GenerateImpl(MacroAssembler* masm, bool in_frame); |
| 2117 }; | 2117 }; |
| 2118 | 2118 |
| 2119 | 2119 |
| 2120 class DoubleToIStub : public PlatformCodeStub { | 2120 class DoubleToIStub : public PlatformCodeStub { |
| 2121 public: | 2121 public: |
| 2122 DoubleToIStub(Isolate* isolate, Register source, Register destination, | 2122 DoubleToIStub(Isolate* isolate, Register source, Register destination, |
| 2123 int offset, bool is_truncating, bool skip_fastpath = false) | 2123 int offset, bool is_truncating, bool skip_fastpath = false) |
| 2124 : PlatformCodeStub(isolate) { | 2124 : PlatformCodeStub(isolate) { |
| 2125 minor_key_ = SourceRegisterBits::encode(source.code()) | | 2125 minor_key_ = SourceRegisterBits::encode(source.code()) | |
| 2126 DestinationRegisterBits::encode(destination.code()) | | 2126 DestinationRegisterBits::encode(destination.code()) | |
| 2127 OffsetBits::encode(offset) | | 2127 OffsetBits::encode(offset) | |
| 2128 IsTruncatingBits::encode(is_truncating) | | 2128 IsTruncatingBits::encode(is_truncating) | |
| 2129 SkipFastPathBits::encode(skip_fastpath) | | 2129 SkipFastPathBits::encode(skip_fastpath) | |
| 2130 SSE3Bits::encode(CpuFeatures::IsSupported(SSE3) ? 1 : 0); | 2130 SSE3Bits::encode(CpuFeatures::IsSupported(SSE3) ? 1 : 0); |
| 2131 } | 2131 } |
| 2132 | 2132 |
| 2133 bool SometimesSetsUpAFrame() OVERRIDE { return false; } | 2133 bool SometimesSetsUpAFrame() override { return false; } |
| 2134 | 2134 |
| 2135 private: | 2135 private: |
| 2136 Register source() const { | 2136 Register source() const { |
| 2137 return Register::from_code(SourceRegisterBits::decode(minor_key_)); | 2137 return Register::from_code(SourceRegisterBits::decode(minor_key_)); |
| 2138 } | 2138 } |
| 2139 Register destination() const { | 2139 Register destination() const { |
| 2140 return Register::from_code(DestinationRegisterBits::decode(minor_key_)); | 2140 return Register::from_code(DestinationRegisterBits::decode(minor_key_)); |
| 2141 } | 2141 } |
| 2142 bool is_truncating() const { return IsTruncatingBits::decode(minor_key_); } | 2142 bool is_truncating() const { return IsTruncatingBits::decode(minor_key_); } |
| 2143 bool skip_fastpath() const { return SkipFastPathBits::decode(minor_key_); } | 2143 bool skip_fastpath() const { return SkipFastPathBits::decode(minor_key_); } |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2185 SlotIndexBits::is_valid(lookup_result->slot_index); | 2185 SlotIndexBits::is_valid(lookup_result->slot_index); |
| 2186 } | 2186 } |
| 2187 | 2187 |
| 2188 private: | 2188 private: |
| 2189 static const int kContextIndexBits = 13; | 2189 static const int kContextIndexBits = 13; |
| 2190 static const int kSlotIndexBits = 13; | 2190 static const int kSlotIndexBits = 13; |
| 2191 class ContextIndexBits : public BitField<int, 0, kContextIndexBits> {}; | 2191 class ContextIndexBits : public BitField<int, 0, kContextIndexBits> {}; |
| 2192 class SlotIndexBits | 2192 class SlotIndexBits |
| 2193 : public BitField<int, kContextIndexBits, kSlotIndexBits> {}; | 2193 : public BitField<int, kContextIndexBits, kSlotIndexBits> {}; |
| 2194 | 2194 |
| 2195 Code::StubType GetStubType() const OVERRIDE { return Code::FAST; } | 2195 Code::StubType GetStubType() const override { return Code::FAST; } |
| 2196 | 2196 |
| 2197 DEFINE_CODE_STUB_BASE(ScriptContextFieldStub, HandlerStub); | 2197 DEFINE_CODE_STUB_BASE(ScriptContextFieldStub, HandlerStub); |
| 2198 }; | 2198 }; |
| 2199 | 2199 |
| 2200 | 2200 |
| 2201 class LoadScriptContextFieldStub : public ScriptContextFieldStub { | 2201 class LoadScriptContextFieldStub : public ScriptContextFieldStub { |
| 2202 public: | 2202 public: |
| 2203 LoadScriptContextFieldStub( | 2203 LoadScriptContextFieldStub( |
| 2204 Isolate* isolate, const ScriptContextTable::LookupResult* lookup_result) | 2204 Isolate* isolate, const ScriptContextTable::LookupResult* lookup_result) |
| 2205 : ScriptContextFieldStub(isolate, lookup_result) {} | 2205 : ScriptContextFieldStub(isolate, lookup_result) {} |
| 2206 | 2206 |
| 2207 private: | 2207 private: |
| 2208 Code::Kind kind() const OVERRIDE { return Code::LOAD_IC; } | 2208 Code::Kind kind() const override { return Code::LOAD_IC; } |
| 2209 | 2209 |
| 2210 DEFINE_HANDLER_CODE_STUB(LoadScriptContextField, ScriptContextFieldStub); | 2210 DEFINE_HANDLER_CODE_STUB(LoadScriptContextField, ScriptContextFieldStub); |
| 2211 }; | 2211 }; |
| 2212 | 2212 |
| 2213 | 2213 |
| 2214 class StoreScriptContextFieldStub : public ScriptContextFieldStub { | 2214 class StoreScriptContextFieldStub : public ScriptContextFieldStub { |
| 2215 public: | 2215 public: |
| 2216 StoreScriptContextFieldStub( | 2216 StoreScriptContextFieldStub( |
| 2217 Isolate* isolate, const ScriptContextTable::LookupResult* lookup_result) | 2217 Isolate* isolate, const ScriptContextTable::LookupResult* lookup_result) |
| 2218 : ScriptContextFieldStub(isolate, lookup_result) {} | 2218 : ScriptContextFieldStub(isolate, lookup_result) {} |
| 2219 | 2219 |
| 2220 private: | 2220 private: |
| 2221 Code::Kind kind() const OVERRIDE { return Code::STORE_IC; } | 2221 Code::Kind kind() const override { return Code::STORE_IC; } |
| 2222 | 2222 |
| 2223 DEFINE_HANDLER_CODE_STUB(StoreScriptContextField, ScriptContextFieldStub); | 2223 DEFINE_HANDLER_CODE_STUB(StoreScriptContextField, ScriptContextFieldStub); |
| 2224 }; | 2224 }; |
| 2225 | 2225 |
| 2226 | 2226 |
| 2227 class LoadFastElementStub : public HydrogenCodeStub { | 2227 class LoadFastElementStub : public HydrogenCodeStub { |
| 2228 public: | 2228 public: |
| 2229 LoadFastElementStub(Isolate* isolate, bool is_js_array, | 2229 LoadFastElementStub(Isolate* isolate, bool is_js_array, |
| 2230 ElementsKind elements_kind) | 2230 ElementsKind elements_kind) |
| 2231 : HydrogenCodeStub(isolate) { | 2231 : HydrogenCodeStub(isolate) { |
| 2232 set_sub_minor_key(ElementsKindBits::encode(elements_kind) | | 2232 set_sub_minor_key(ElementsKindBits::encode(elements_kind) | |
| 2233 IsJSArrayBits::encode(is_js_array)); | 2233 IsJSArrayBits::encode(is_js_array)); |
| 2234 } | 2234 } |
| 2235 | 2235 |
| 2236 bool is_js_array() const { return IsJSArrayBits::decode(sub_minor_key()); } | 2236 bool is_js_array() const { return IsJSArrayBits::decode(sub_minor_key()); } |
| 2237 | 2237 |
| 2238 ElementsKind elements_kind() const { | 2238 ElementsKind elements_kind() const { |
| 2239 return ElementsKindBits::decode(sub_minor_key()); | 2239 return ElementsKindBits::decode(sub_minor_key()); |
| 2240 } | 2240 } |
| 2241 | 2241 |
| 2242 private: | 2242 private: |
| 2243 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {}; | 2243 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {}; |
| 2244 class IsJSArrayBits: public BitField<bool, 8, 1> {}; | 2244 class IsJSArrayBits: public BitField<bool, 8, 1> {}; |
| 2245 | 2245 |
| 2246 CallInterfaceDescriptor GetCallInterfaceDescriptor() OVERRIDE { | 2246 CallInterfaceDescriptor GetCallInterfaceDescriptor() override { |
| 2247 if (FLAG_vector_ics) { | 2247 if (FLAG_vector_ics) { |
| 2248 return VectorLoadICDescriptor(isolate()); | 2248 return VectorLoadICDescriptor(isolate()); |
| 2249 } | 2249 } |
| 2250 return LoadDescriptor(isolate()); | 2250 return LoadDescriptor(isolate()); |
| 2251 } | 2251 } |
| 2252 | 2252 |
| 2253 DEFINE_HYDROGEN_CODE_STUB(LoadFastElement, HydrogenCodeStub); | 2253 DEFINE_HYDROGEN_CODE_STUB(LoadFastElement, HydrogenCodeStub); |
| 2254 }; | 2254 }; |
| 2255 | 2255 |
| 2256 | 2256 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2308 private: | 2308 private: |
| 2309 class FromKindBits: public BitField<ElementsKind, 8, 8> {}; | 2309 class FromKindBits: public BitField<ElementsKind, 8, 8> {}; |
| 2310 class ToKindBits: public BitField<ElementsKind, 0, 8> {}; | 2310 class ToKindBits: public BitField<ElementsKind, 0, 8> {}; |
| 2311 class IsJSArrayBits: public BitField<bool, 16, 1> {}; | 2311 class IsJSArrayBits: public BitField<bool, 16, 1> {}; |
| 2312 | 2312 |
| 2313 DEFINE_CALL_INTERFACE_DESCRIPTOR(TransitionElementsKind); | 2313 DEFINE_CALL_INTERFACE_DESCRIPTOR(TransitionElementsKind); |
| 2314 DEFINE_HYDROGEN_CODE_STUB(TransitionElementsKind, HydrogenCodeStub); | 2314 DEFINE_HYDROGEN_CODE_STUB(TransitionElementsKind, HydrogenCodeStub); |
| 2315 }; | 2315 }; |
| 2316 | 2316 |
| 2317 | 2317 |
| 2318 class AllocateHeapNumberStub FINAL : public HydrogenCodeStub { | 2318 class AllocateHeapNumberStub final : public HydrogenCodeStub { |
| 2319 public: | 2319 public: |
| 2320 explicit AllocateHeapNumberStub(Isolate* isolate) | 2320 explicit AllocateHeapNumberStub(Isolate* isolate) |
| 2321 : HydrogenCodeStub(isolate) {} | 2321 : HydrogenCodeStub(isolate) {} |
| 2322 | 2322 |
| 2323 private: | 2323 private: |
| 2324 DEFINE_CALL_INTERFACE_DESCRIPTOR(AllocateHeapNumber); | 2324 DEFINE_CALL_INTERFACE_DESCRIPTOR(AllocateHeapNumber); |
| 2325 DEFINE_HYDROGEN_CODE_STUB(AllocateHeapNumber, HydrogenCodeStub); | 2325 DEFINE_HYDROGEN_CODE_STUB(AllocateHeapNumber, HydrogenCodeStub); |
| 2326 }; | 2326 }; |
| 2327 | 2327 |
| 2328 | 2328 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2374 class ArrayNoArgumentConstructorStub : public ArrayConstructorStubBase { | 2374 class ArrayNoArgumentConstructorStub : public ArrayConstructorStubBase { |
| 2375 public: | 2375 public: |
| 2376 ArrayNoArgumentConstructorStub( | 2376 ArrayNoArgumentConstructorStub( |
| 2377 Isolate* isolate, | 2377 Isolate* isolate, |
| 2378 ElementsKind kind, | 2378 ElementsKind kind, |
| 2379 AllocationSiteOverrideMode override_mode = DONT_OVERRIDE) | 2379 AllocationSiteOverrideMode override_mode = DONT_OVERRIDE) |
| 2380 : ArrayConstructorStubBase(isolate, kind, override_mode) { | 2380 : ArrayConstructorStubBase(isolate, kind, override_mode) { |
| 2381 } | 2381 } |
| 2382 | 2382 |
| 2383 private: | 2383 private: |
| 2384 void PrintName(std::ostream& os) const OVERRIDE { // NOLINT | 2384 void PrintName(std::ostream& os) const override { // NOLINT |
| 2385 BasePrintName(os, "ArrayNoArgumentConstructorStub"); | 2385 BasePrintName(os, "ArrayNoArgumentConstructorStub"); |
| 2386 } | 2386 } |
| 2387 | 2387 |
| 2388 DEFINE_CALL_INTERFACE_DESCRIPTOR(ArrayConstructorConstantArgCount); | 2388 DEFINE_CALL_INTERFACE_DESCRIPTOR(ArrayConstructorConstantArgCount); |
| 2389 DEFINE_HYDROGEN_CODE_STUB(ArrayNoArgumentConstructor, | 2389 DEFINE_HYDROGEN_CODE_STUB(ArrayNoArgumentConstructor, |
| 2390 ArrayConstructorStubBase); | 2390 ArrayConstructorStubBase); |
| 2391 }; | 2391 }; |
| 2392 | 2392 |
| 2393 | 2393 |
| 2394 class ArraySingleArgumentConstructorStub : public ArrayConstructorStubBase { | 2394 class ArraySingleArgumentConstructorStub : public ArrayConstructorStubBase { |
| 2395 public: | 2395 public: |
| 2396 ArraySingleArgumentConstructorStub( | 2396 ArraySingleArgumentConstructorStub( |
| 2397 Isolate* isolate, | 2397 Isolate* isolate, |
| 2398 ElementsKind kind, | 2398 ElementsKind kind, |
| 2399 AllocationSiteOverrideMode override_mode = DONT_OVERRIDE) | 2399 AllocationSiteOverrideMode override_mode = DONT_OVERRIDE) |
| 2400 : ArrayConstructorStubBase(isolate, kind, override_mode) { | 2400 : ArrayConstructorStubBase(isolate, kind, override_mode) { |
| 2401 } | 2401 } |
| 2402 | 2402 |
| 2403 private: | 2403 private: |
| 2404 void PrintName(std::ostream& os) const OVERRIDE { // NOLINT | 2404 void PrintName(std::ostream& os) const override { // NOLINT |
| 2405 BasePrintName(os, "ArraySingleArgumentConstructorStub"); | 2405 BasePrintName(os, "ArraySingleArgumentConstructorStub"); |
| 2406 } | 2406 } |
| 2407 | 2407 |
| 2408 DEFINE_CALL_INTERFACE_DESCRIPTOR(ArrayConstructor); | 2408 DEFINE_CALL_INTERFACE_DESCRIPTOR(ArrayConstructor); |
| 2409 DEFINE_HYDROGEN_CODE_STUB(ArraySingleArgumentConstructor, | 2409 DEFINE_HYDROGEN_CODE_STUB(ArraySingleArgumentConstructor, |
| 2410 ArrayConstructorStubBase); | 2410 ArrayConstructorStubBase); |
| 2411 }; | 2411 }; |
| 2412 | 2412 |
| 2413 | 2413 |
| 2414 class ArrayNArgumentsConstructorStub : public ArrayConstructorStubBase { | 2414 class ArrayNArgumentsConstructorStub : public ArrayConstructorStubBase { |
| 2415 public: | 2415 public: |
| 2416 ArrayNArgumentsConstructorStub( | 2416 ArrayNArgumentsConstructorStub( |
| 2417 Isolate* isolate, | 2417 Isolate* isolate, |
| 2418 ElementsKind kind, | 2418 ElementsKind kind, |
| 2419 AllocationSiteOverrideMode override_mode = DONT_OVERRIDE) | 2419 AllocationSiteOverrideMode override_mode = DONT_OVERRIDE) |
| 2420 : ArrayConstructorStubBase(isolate, kind, override_mode) { | 2420 : ArrayConstructorStubBase(isolate, kind, override_mode) { |
| 2421 } | 2421 } |
| 2422 | 2422 |
| 2423 private: | 2423 private: |
| 2424 void PrintName(std::ostream& os) const OVERRIDE { // NOLINT | 2424 void PrintName(std::ostream& os) const override { // NOLINT |
| 2425 BasePrintName(os, "ArrayNArgumentsConstructorStub"); | 2425 BasePrintName(os, "ArrayNArgumentsConstructorStub"); |
| 2426 } | 2426 } |
| 2427 | 2427 |
| 2428 DEFINE_CALL_INTERFACE_DESCRIPTOR(ArrayConstructor); | 2428 DEFINE_CALL_INTERFACE_DESCRIPTOR(ArrayConstructor); |
| 2429 DEFINE_HYDROGEN_CODE_STUB(ArrayNArgumentsConstructor, | 2429 DEFINE_HYDROGEN_CODE_STUB(ArrayNArgumentsConstructor, |
| 2430 ArrayConstructorStubBase); | 2430 ArrayConstructorStubBase); |
| 2431 }; | 2431 }; |
| 2432 | 2432 |
| 2433 | 2433 |
| 2434 class InternalArrayConstructorStubBase : public HydrogenCodeStub { | 2434 class InternalArrayConstructorStubBase : public HydrogenCodeStub { |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2558 ToBooleanStub(Isolate* isolate, ExtraICState state) | 2558 ToBooleanStub(Isolate* isolate, ExtraICState state) |
| 2559 : HydrogenCodeStub(isolate) { | 2559 : HydrogenCodeStub(isolate) { |
| 2560 set_sub_minor_key(TypesBits::encode(static_cast<byte>(state)) | | 2560 set_sub_minor_key(TypesBits::encode(static_cast<byte>(state)) | |
| 2561 ResultModeBits::encode(RESULT_AS_SMI)); | 2561 ResultModeBits::encode(RESULT_AS_SMI)); |
| 2562 } | 2562 } |
| 2563 | 2563 |
| 2564 bool UpdateStatus(Handle<Object> object); | 2564 bool UpdateStatus(Handle<Object> object); |
| 2565 Types types() const { return Types(TypesBits::decode(sub_minor_key())); } | 2565 Types types() const { return Types(TypesBits::decode(sub_minor_key())); } |
| 2566 ResultMode mode() const { return ResultModeBits::decode(sub_minor_key()); } | 2566 ResultMode mode() const { return ResultModeBits::decode(sub_minor_key()); } |
| 2567 | 2567 |
| 2568 Code::Kind GetCodeKind() const OVERRIDE { return Code::TO_BOOLEAN_IC; } | 2568 Code::Kind GetCodeKind() const override { return Code::TO_BOOLEAN_IC; } |
| 2569 void PrintState(std::ostream& os) const OVERRIDE; // NOLINT | 2569 void PrintState(std::ostream& os) const override; // NOLINT |
| 2570 | 2570 |
| 2571 bool SometimesSetsUpAFrame() OVERRIDE { return false; } | 2571 bool SometimesSetsUpAFrame() override { return false; } |
| 2572 | 2572 |
| 2573 static Handle<Code> GetUninitialized(Isolate* isolate) { | 2573 static Handle<Code> GetUninitialized(Isolate* isolate) { |
| 2574 return ToBooleanStub(isolate, UNINITIALIZED).GetCode(); | 2574 return ToBooleanStub(isolate, UNINITIALIZED).GetCode(); |
| 2575 } | 2575 } |
| 2576 | 2576 |
| 2577 ExtraICState GetExtraICState() const OVERRIDE { return types().ToIntegral(); } | 2577 ExtraICState GetExtraICState() const override { return types().ToIntegral(); } |
| 2578 | 2578 |
| 2579 InlineCacheState GetICState() const OVERRIDE { | 2579 InlineCacheState GetICState() const override { |
| 2580 if (types().IsEmpty()) { | 2580 if (types().IsEmpty()) { |
| 2581 return ::v8::internal::UNINITIALIZED; | 2581 return ::v8::internal::UNINITIALIZED; |
| 2582 } else { | 2582 } else { |
| 2583 return MONOMORPHIC; | 2583 return MONOMORPHIC; |
| 2584 } | 2584 } |
| 2585 } | 2585 } |
| 2586 | 2586 |
| 2587 private: | 2587 private: |
| 2588 ToBooleanStub(Isolate* isolate, InitializationState init_state) | 2588 ToBooleanStub(Isolate* isolate, InitializationState init_state) |
| 2589 : HydrogenCodeStub(isolate, init_state) { | 2589 : HydrogenCodeStub(isolate, init_state) { |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2681 DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR(); | 2681 DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR(); |
| 2682 DEFINE_PLATFORM_CODE_STUB(StubFailureTrampoline, PlatformCodeStub); | 2682 DEFINE_PLATFORM_CODE_STUB(StubFailureTrampoline, PlatformCodeStub); |
| 2683 }; | 2683 }; |
| 2684 | 2684 |
| 2685 | 2685 |
| 2686 class ProfileEntryHookStub : public PlatformCodeStub { | 2686 class ProfileEntryHookStub : public PlatformCodeStub { |
| 2687 public: | 2687 public: |
| 2688 explicit ProfileEntryHookStub(Isolate* isolate) : PlatformCodeStub(isolate) {} | 2688 explicit ProfileEntryHookStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
| 2689 | 2689 |
| 2690 // The profile entry hook function is not allowed to cause a GC. | 2690 // The profile entry hook function is not allowed to cause a GC. |
| 2691 bool SometimesSetsUpAFrame() OVERRIDE { return false; } | 2691 bool SometimesSetsUpAFrame() override { return false; } |
| 2692 | 2692 |
| 2693 // Generates a call to the entry hook if it's enabled. | 2693 // Generates a call to the entry hook if it's enabled. |
| 2694 static void MaybeCallEntryHook(MacroAssembler* masm); | 2694 static void MaybeCallEntryHook(MacroAssembler* masm); |
| 2695 | 2695 |
| 2696 private: | 2696 private: |
| 2697 static void EntryHookTrampoline(intptr_t function, | 2697 static void EntryHookTrampoline(intptr_t function, |
| 2698 intptr_t stack_pointer, | 2698 intptr_t stack_pointer, |
| 2699 Isolate* isolate); | 2699 Isolate* isolate); |
| 2700 | 2700 |
| 2701 // ProfileEntryHookStub is called at the start of a function, so it has the | 2701 // ProfileEntryHookStub is called at the start of a function, so it has the |
| 2702 // same register set. | 2702 // same register set. |
| 2703 DEFINE_CALL_INTERFACE_DESCRIPTOR(CallFunction) | 2703 DEFINE_CALL_INTERFACE_DESCRIPTOR(CallFunction) |
| 2704 DEFINE_PLATFORM_CODE_STUB(ProfileEntryHook, PlatformCodeStub); | 2704 DEFINE_PLATFORM_CODE_STUB(ProfileEntryHook, PlatformCodeStub); |
| 2705 }; | 2705 }; |
| 2706 | 2706 |
| 2707 | 2707 |
| 2708 class StoreBufferOverflowStub : public PlatformCodeStub { | 2708 class StoreBufferOverflowStub : public PlatformCodeStub { |
| 2709 public: | 2709 public: |
| 2710 StoreBufferOverflowStub(Isolate* isolate, SaveFPRegsMode save_fp) | 2710 StoreBufferOverflowStub(Isolate* isolate, SaveFPRegsMode save_fp) |
| 2711 : PlatformCodeStub(isolate) { | 2711 : PlatformCodeStub(isolate) { |
| 2712 minor_key_ = SaveDoublesBits::encode(save_fp == kSaveFPRegs); | 2712 minor_key_ = SaveDoublesBits::encode(save_fp == kSaveFPRegs); |
| 2713 } | 2713 } |
| 2714 | 2714 |
| 2715 static void GenerateFixedRegStubsAheadOfTime(Isolate* isolate); | 2715 static void GenerateFixedRegStubsAheadOfTime(Isolate* isolate); |
| 2716 bool SometimesSetsUpAFrame() OVERRIDE { return false; } | 2716 bool SometimesSetsUpAFrame() override { return false; } |
| 2717 | 2717 |
| 2718 private: | 2718 private: |
| 2719 bool save_doubles() const { return SaveDoublesBits::decode(minor_key_); } | 2719 bool save_doubles() const { return SaveDoublesBits::decode(minor_key_); } |
| 2720 | 2720 |
| 2721 class SaveDoublesBits : public BitField<bool, 0, 1> {}; | 2721 class SaveDoublesBits : public BitField<bool, 0, 1> {}; |
| 2722 | 2722 |
| 2723 DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR(); | 2723 DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR(); |
| 2724 DEFINE_PLATFORM_CODE_STUB(StoreBufferOverflow, PlatformCodeStub); | 2724 DEFINE_PLATFORM_CODE_STUB(StoreBufferOverflow, PlatformCodeStub); |
| 2725 }; | 2725 }; |
| 2726 | 2726 |
| 2727 | 2727 |
| 2728 class SubStringStub : public PlatformCodeStub { | 2728 class SubStringStub : public PlatformCodeStub { |
| 2729 public: | 2729 public: |
| 2730 explicit SubStringStub(Isolate* isolate) : PlatformCodeStub(isolate) {} | 2730 explicit SubStringStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
| 2731 | 2731 |
| 2732 DEFINE_CALL_INTERFACE_DESCRIPTOR(ContextOnly); | 2732 DEFINE_CALL_INTERFACE_DESCRIPTOR(ContextOnly); |
| 2733 DEFINE_PLATFORM_CODE_STUB(SubString, PlatformCodeStub); | 2733 DEFINE_PLATFORM_CODE_STUB(SubString, PlatformCodeStub); |
| 2734 }; | 2734 }; |
| 2735 | 2735 |
| 2736 | 2736 |
| 2737 class ToNumberStub FINAL : public PlatformCodeStub { | 2737 class ToNumberStub final : public PlatformCodeStub { |
| 2738 public: | 2738 public: |
| 2739 explicit ToNumberStub(Isolate* isolate) : PlatformCodeStub(isolate) {} | 2739 explicit ToNumberStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
| 2740 | 2740 |
| 2741 DEFINE_CALL_INTERFACE_DESCRIPTOR(ToNumber); | 2741 DEFINE_CALL_INTERFACE_DESCRIPTOR(ToNumber); |
| 2742 DEFINE_PLATFORM_CODE_STUB(ToNumber, PlatformCodeStub); | 2742 DEFINE_PLATFORM_CODE_STUB(ToNumber, PlatformCodeStub); |
| 2743 }; | 2743 }; |
| 2744 | 2744 |
| 2745 | 2745 |
| 2746 class StringCompareStub : public PlatformCodeStub { | 2746 class StringCompareStub : public PlatformCodeStub { |
| 2747 public: | 2747 public: |
| 2748 explicit StringCompareStub(Isolate* isolate) : PlatformCodeStub(isolate) {} | 2748 explicit StringCompareStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
| 2749 | 2749 |
| 2750 DEFINE_CALL_INTERFACE_DESCRIPTOR(ContextOnly); | 2750 DEFINE_CALL_INTERFACE_DESCRIPTOR(ContextOnly); |
| 2751 DEFINE_PLATFORM_CODE_STUB(StringCompare, PlatformCodeStub); | 2751 DEFINE_PLATFORM_CODE_STUB(StringCompare, PlatformCodeStub); |
| 2752 }; | 2752 }; |
| 2753 | 2753 |
| 2754 | 2754 |
| 2755 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR | 2755 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR |
| 2756 #undef DEFINE_PLATFORM_CODE_STUB | 2756 #undef DEFINE_PLATFORM_CODE_STUB |
| 2757 #undef DEFINE_HANDLER_CODE_STUB | 2757 #undef DEFINE_HANDLER_CODE_STUB |
| 2758 #undef DEFINE_HYDROGEN_CODE_STUB | 2758 #undef DEFINE_HYDROGEN_CODE_STUB |
| 2759 #undef DEFINE_CODE_STUB | 2759 #undef DEFINE_CODE_STUB |
| 2760 #undef DEFINE_CODE_STUB_BASE | 2760 #undef DEFINE_CODE_STUB_BASE |
| 2761 } } // namespace v8::internal | 2761 } } // namespace v8::internal |
| 2762 | 2762 |
| 2763 #endif // V8_CODE_STUBS_H_ | 2763 #endif // V8_CODE_STUBS_H_ |
| OLD | NEW |