Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Side by Side Diff: src/code-stubs.h

Issue 1150263002: JavaScript stubs have access to their calling convention and minor key now. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/code-stubs.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 void Generate(MacroAssembler* masm) override; \ 348 void Generate(MacroAssembler* masm) override; \
349 DEFINE_CODE_STUB(NAME, SUPER) 349 DEFINE_CODE_STUB(NAME, SUPER)
350 350
351 351
352 #define DEFINE_HYDROGEN_CODE_STUB(NAME, SUPER) \ 352 #define DEFINE_HYDROGEN_CODE_STUB(NAME, SUPER) \
353 public: \ 353 public: \
354 void InitializeDescriptor(CodeStubDescriptor* descriptor) override; \ 354 void InitializeDescriptor(CodeStubDescriptor* descriptor) override; \
355 Handle<Code> GenerateCode() override; \ 355 Handle<Code> GenerateCode() override; \
356 DEFINE_CODE_STUB(NAME, SUPER) 356 DEFINE_CODE_STUB(NAME, SUPER)
357 357
358 #define DEFINE_TURBOFAN_CODE_STUB(NAME, SUPER) \
359 public: \
360 const char* GetFunctionName() const override { return #NAME "_STUB"; } \
361 DEFINE_CODE_STUB(NAME, SUPER)
362
363 #define DEFINE_HANDLER_CODE_STUB(NAME, SUPER) \ 358 #define DEFINE_HANDLER_CODE_STUB(NAME, SUPER) \
364 public: \ 359 public: \
365 Handle<Code> GenerateCode() override; \ 360 Handle<Code> GenerateCode() override; \
366 DEFINE_CODE_STUB(NAME, SUPER) 361 DEFINE_CODE_STUB(NAME, SUPER)
367 362
368 #define DEFINE_CALL_INTERFACE_DESCRIPTOR(NAME) \ 363 #define DEFINE_CALL_INTERFACE_DESCRIPTOR(NAME) \
369 public: \ 364 public: \
370 CallInterfaceDescriptor GetCallInterfaceDescriptor() override { \ 365 CallInterfaceDescriptor GetCallInterfaceDescriptor() override { \
371 return NAME##Descriptor(isolate()); \ 366 return NAME##Descriptor(isolate()); \
372 } 367 }
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 }; 521 };
527 522
528 523
529 class TurboFanCodeStub : public CodeStub { 524 class TurboFanCodeStub : public CodeStub {
530 public: 525 public:
531 // Retrieve the code for the stub. Generate the code if needed. 526 // Retrieve the code for the stub. Generate the code if needed.
532 Handle<Code> GenerateCode() override; 527 Handle<Code> GenerateCode() override;
533 528
534 Code::StubType GetStubType() const override { return Code::FAST; } 529 Code::StubType GetStubType() const override { return Code::FAST; }
535 530
536 virtual const char* GetFunctionName() const = 0;
537
538 protected: 531 protected:
539 explicit TurboFanCodeStub(Isolate* isolate) : CodeStub(isolate) {} 532 explicit TurboFanCodeStub(Isolate* isolate) : CodeStub(isolate) {}
540 533
541 private: 534 private:
542 DEFINE_CODE_STUB_BASE(TurboFanCodeStub, CodeStub); 535 DEFINE_CODE_STUB_BASE(TurboFanCodeStub, CodeStub);
543 }; 536 };
544 537
545 538
546 // Helper interface to prepare to/restore after making runtime calls. 539 // Helper interface to prepare to/restore after making runtime calls.
547 class RuntimeCallHelper { 540 class RuntimeCallHelper {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 virtual void AfterCall(MacroAssembler* masm) const {} 601 virtual void AfterCall(MacroAssembler* masm) const {}
609 }; 602 };
610 603
611 604
612 class MathFloorStub : public TurboFanCodeStub { 605 class MathFloorStub : public TurboFanCodeStub {
613 public: 606 public:
614 explicit MathFloorStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} 607 explicit MathFloorStub(Isolate* isolate) : TurboFanCodeStub(isolate) {}
615 int GetStackParameterCount() const override { return 1; } 608 int GetStackParameterCount() const override { return 1; }
616 609
617 DEFINE_CALL_INTERFACE_DESCRIPTOR(MathRoundVariant); 610 DEFINE_CALL_INTERFACE_DESCRIPTOR(MathRoundVariant);
618 DEFINE_TURBOFAN_CODE_STUB(MathFloor, TurboFanCodeStub); 611 DEFINE_CODE_STUB(MathFloor, TurboFanCodeStub);
619 }; 612 };
620 613
621 614
622 class StringLengthTFStub : public TurboFanCodeStub { 615 class StringLengthTFStub : public TurboFanCodeStub {
623 public: 616 public:
624 explicit StringLengthTFStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} 617 explicit StringLengthTFStub(Isolate* isolate) : TurboFanCodeStub(isolate) {}
625 618
626 Code::Kind GetCodeKind() const override { return Code::HANDLER; } 619 Code::Kind GetCodeKind() const override { return Code::HANDLER; }
627 InlineCacheState GetICState() const override { return MONOMORPHIC; } 620 InlineCacheState GetICState() const override { return MONOMORPHIC; }
628 ExtraICState GetExtraICState() const override { return Code::LOAD_IC; } 621 ExtraICState GetExtraICState() const override { return Code::LOAD_IC; }
629 622
630 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); 623 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector);
631 DEFINE_TURBOFAN_CODE_STUB(StringLengthTF, TurboFanCodeStub); 624 DEFINE_CODE_STUB(StringLengthTF, TurboFanCodeStub);
632 }; 625 };
633 626
634 627
635 enum StringAddFlags { 628 enum StringAddFlags {
636 // Omit both parameter checks. 629 // Omit both parameter checks.
637 STRING_ADD_CHECK_NONE = 0, 630 STRING_ADD_CHECK_NONE = 0,
638 // Check left parameter. 631 // Check left parameter.
639 STRING_ADD_CHECK_LEFT = 1 << 0, 632 STRING_ADD_CHECK_LEFT = 1 << 0,
640 // Check right parameter. 633 // Check right parameter.
641 STRING_ADD_CHECK_RIGHT = 1 << 1, 634 STRING_ADD_CHECK_RIGHT = 1 << 1,
(...skipping 22 matching lines...) Expand all
664 return PretenureFlagBits::decode(MinorKey()); 657 return PretenureFlagBits::decode(MinorKey());
665 } 658 }
666 659
667 private: 660 private:
668 class StringAddFlagsBits : public BitField<StringAddFlags, 0, 2> {}; 661 class StringAddFlagsBits : public BitField<StringAddFlags, 0, 2> {};
669 class PretenureFlagBits : public BitField<PretenureFlag, 2, 1> {}; 662 class PretenureFlagBits : public BitField<PretenureFlag, 2, 1> {};
670 663
671 void PrintBaseName(std::ostream& os) const override; // NOLINT 664 void PrintBaseName(std::ostream& os) const override; // NOLINT
672 665
673 DEFINE_CALL_INTERFACE_DESCRIPTOR(StringAdd); 666 DEFINE_CALL_INTERFACE_DESCRIPTOR(StringAdd);
674 DEFINE_TURBOFAN_CODE_STUB(StringAddTF, TurboFanCodeStub); 667 DEFINE_CODE_STUB(StringAddTF, TurboFanCodeStub);
675 }; 668 };
676 669
677 670
678 class NumberToStringStub final : public HydrogenCodeStub { 671 class NumberToStringStub final : public HydrogenCodeStub {
679 public: 672 public:
680 explicit NumberToStringStub(Isolate* isolate) : HydrogenCodeStub(isolate) {} 673 explicit NumberToStringStub(Isolate* isolate) : HydrogenCodeStub(isolate) {}
681 674
682 // Parameters accessed via CodeStubGraphBuilder::GetParameter() 675 // Parameters accessed via CodeStubGraphBuilder::GetParameter()
683 static const int kNumber = 0; 676 static const int kNumber = 0;
684 677
(...skipping 2191 matching lines...) Expand 10 before | Expand all | Expand 10 after
2876 2869
2877 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR 2870 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR
2878 #undef DEFINE_PLATFORM_CODE_STUB 2871 #undef DEFINE_PLATFORM_CODE_STUB
2879 #undef DEFINE_HANDLER_CODE_STUB 2872 #undef DEFINE_HANDLER_CODE_STUB
2880 #undef DEFINE_HYDROGEN_CODE_STUB 2873 #undef DEFINE_HYDROGEN_CODE_STUB
2881 #undef DEFINE_CODE_STUB 2874 #undef DEFINE_CODE_STUB
2882 #undef DEFINE_CODE_STUB_BASE 2875 #undef DEFINE_CODE_STUB_BASE
2883 } } // namespace v8::internal 2876 } } // namespace v8::internal
2884 2877
2885 #endif // V8_CODE_STUBS_H_ 2878 #endif // V8_CODE_STUBS_H_
OLDNEW
« no previous file with comments | « no previous file | src/code-stubs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698