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

Side by Side Diff: src/runtime/runtime.h

Issue 997933003: Re-arranged intrinsic macros a bit. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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/runtime/runtime.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_RUNTIME_RUNTIME_H_ 5 #ifndef V8_RUNTIME_RUNTIME_H_
6 #define V8_RUNTIME_RUNTIME_H_ 6 #define V8_RUNTIME_RUNTIME_H_
7 7
8 #include "src/allocation.h" 8 #include "src/allocation.h"
9 #include "src/objects.h" 9 #include "src/objects.h"
10 #include "src/zone.h" 10 #include "src/zone.h"
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 F(DeclareModules, 1, 1) \ 503 F(DeclareModules, 1, 1) \
504 F(DeclareLookupSlot, 4, 1) \ 504 F(DeclareLookupSlot, 4, 1) \
505 F(InitializeConstGlobal, 2, 1) \ 505 F(InitializeConstGlobal, 2, 1) \
506 F(InitializeLegacyConstLookupSlot, 3, 1) \ 506 F(InitializeLegacyConstLookupSlot, 3, 1) \
507 \ 507 \
508 /* Maths */ \ 508 /* Maths */ \
509 F(MathPowSlow, 2, 1) \ 509 F(MathPowSlow, 2, 1) \
510 F(MathPowRT, 2, 1) 510 F(MathPowRT, 2, 1)
511 511
512 512
513 #define RUNTIME_FUNCTION_LIST_RETURN_PAIR(F) \ 513 #define FOR_EACH_INTRINSIC_RETURN_PAIR(F) \
514 F(LoadLookupSlot, 2, 2) \ 514 F(LoadLookupSlot, 2, 2) \
515 F(LoadLookupSlotNoReferenceError, 2, 2) \ 515 F(LoadLookupSlotNoReferenceError, 2, 2) \
516 F(ResolvePossiblyDirectEval, 6, 2) \ 516 F(ResolvePossiblyDirectEval, 6, 2) \
517 F(ForInInit, 2, 2) /* TODO(turbofan): Only temporary */ \ 517 F(ForInInit, 2, 2) /* TODO(turbofan): Only temporary */ \
518 F(ForInNext, 4, 2) /* TODO(turbofan): Only temporary */ 518 F(ForInNext, 4, 2) /* TODO(turbofan): Only temporary */
519 519
520 520
521 #define RUNTIME_FUNCTION_LIST_DEBUGGER(F) \ 521 #define RUNTIME_FUNCTION_LIST_DEBUGGER(F) \
522 /* Debugger support*/ \ 522 /* Debugger support*/ \
523 F(DebugBreak, 0, 1) \ 523 F(DebugBreak, 0, 1) \
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 F(BreakIteratorFirst, 1, 1) \ 619 F(BreakIteratorFirst, 1, 1) \
620 F(BreakIteratorNext, 1, 1) \ 620 F(BreakIteratorNext, 1, 1) \
621 F(BreakIteratorCurrent, 1, 1) \ 621 F(BreakIteratorCurrent, 1, 1) \
622 F(BreakIteratorBreakType, 1, 1) 622 F(BreakIteratorBreakType, 1, 1)
623 623
624 #else 624 #else
625 #define RUNTIME_FUNCTION_LIST_I18N_SUPPORT(F) 625 #define RUNTIME_FUNCTION_LIST_I18N_SUPPORT(F)
626 #endif 626 #endif
627 627
628 628
629 #define RUNTIME_FUNCTION_LIST_RETURN_OBJECT(F) \
630 RUNTIME_FUNCTION_LIST_ALWAYS_1(F) \
631 RUNTIME_FUNCTION_LIST_ALWAYS_2(F) \
632 RUNTIME_FUNCTION_LIST_ALWAYS_3(F) \
633 RUNTIME_FUNCTION_LIST_DEBUGGER(F) \
634 RUNTIME_FUNCTION_LIST_I18N_SUPPORT(F)
635
636
637 // RUNTIME_FUNCTION_LIST_ defines the intrinsics typically implemented only
638 // as runtime functions. These come in 2 flavors, either returning an object or
639 // returning a pair.
640 // Entries have the form F(name, number of arguments, number of return values).
641 #define RUNTIME_FUNCTION_LIST(F) \
642 RUNTIME_FUNCTION_LIST_RETURN_OBJECT(F) \
643 RUNTIME_FUNCTION_LIST_RETURN_PAIR(F)
644
645
646 // ---------------------------------------------------------------------------- 629 // ----------------------------------------------------------------------------
647 // INLINE_FUNCTION_LIST defines the intrinsics typically handled specially by 630 // INLINE_FUNCTION_LIST defines the intrinsics typically handled specially by
648 // the various compilers. 631 // the various compilers.
649 // Entries have the form F(name, number of arguments, number of return values). 632 // Entries have the form F(name, number of arguments, number of return values).
650 #define INLINE_FUNCTION_LIST(F) \ 633 #define INLINE_FUNCTION_LIST(F) \
651 F(IsSmi, 1, 1) \ 634 F(IsSmi, 1, 1) \
652 F(IsNonNegativeSmi, 1, 1) \ 635 F(IsNonNegativeSmi, 1, 1) \
653 F(IsArray, 1, 1) \ 636 F(IsArray, 1, 1) \
654 F(IsRegExp, 1, 1) \ 637 F(IsRegExp, 1, 1) \
655 F(IsJSProxy, 1, 1) \ 638 F(IsJSProxy, 1, 1) \
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 F(SetClear, 1, 1) \ 708 F(SetClear, 1, 1) \
726 F(SetDelete, 2, 1) \ 709 F(SetDelete, 2, 1) \
727 F(SetGetSize, 1, 1) \ 710 F(SetGetSize, 1, 1) \
728 F(SetHas, 2, 1) \ 711 F(SetHas, 2, 1) \
729 F(SetInitialize, 1, 1) \ 712 F(SetInitialize, 1, 1) \
730 /* Arrays */ \ 713 /* Arrays */ \
731 F(HasFastPackedElements, 1, 1) \ 714 F(HasFastPackedElements, 1, 1) \
732 F(GetPrototype, 1, 1) 715 F(GetPrototype, 1, 1)
733 716
734 717
735 #define FOR_EACH_INTRINSIC(F) \ 718 #define FOR_EACH_INTRINSIC_RETURN_OBJECT(F) \
736 RUNTIME_FUNCTION_LIST(F) \ 719 RUNTIME_FUNCTION_LIST_ALWAYS_1(F) \
737 INLINE_FUNCTION_LIST(F) \ 720 RUNTIME_FUNCTION_LIST_ALWAYS_2(F) \
721 RUNTIME_FUNCTION_LIST_ALWAYS_3(F) \
722 RUNTIME_FUNCTION_LIST_DEBUGGER(F) \
723 RUNTIME_FUNCTION_LIST_I18N_SUPPORT(F) \
724 INLINE_FUNCTION_LIST(F) \
738 INLINE_OPTIMIZED_FUNCTION_LIST(F) 725 INLINE_OPTIMIZED_FUNCTION_LIST(F)
739 726
727
728 // FOR_EACH_INTRINSIC defines the list of all intrinsics, coming in 2 flavors,
729 // either returning an object or a pair.
730 // Entries have the form F(name, number of arguments, number of values).
731 #define FOR_EACH_INTRINSIC(F) \
732 FOR_EACH_INTRINSIC_RETURN_PAIR(F) \
733 FOR_EACH_INTRINSIC_RETURN_OBJECT(F)
734
735
740 //--------------------------------------------------------------------------- 736 //---------------------------------------------------------------------------
741 // Runtime provides access to all C++ runtime functions. 737 // Runtime provides access to all C++ runtime functions.
742 738
743 class RuntimeState { 739 class RuntimeState {
744 public: 740 public:
745 unibrow::Mapping<unibrow::ToUppercase, 128>* to_upper_mapping() { 741 unibrow::Mapping<unibrow::ToUppercase, 128>* to_upper_mapping() {
746 return &to_upper_mapping_; 742 return &to_upper_mapping_;
747 } 743 }
748 unibrow::Mapping<unibrow::ToLowercase, 128>* to_lower_mapping() { 744 unibrow::Mapping<unibrow::ToLowercase, 128>* to_lower_mapping() {
749 return &to_lower_mapping_; 745 return &to_lower_mapping_;
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
896 892
897 class DeclareGlobalsEvalFlag : public BitField<bool, 0, 1> {}; 893 class DeclareGlobalsEvalFlag : public BitField<bool, 0, 1> {};
898 class DeclareGlobalsNativeFlag : public BitField<bool, 1, 1> {}; 894 class DeclareGlobalsNativeFlag : public BitField<bool, 1, 1> {};
899 STATIC_ASSERT(LANGUAGE_END == 3); 895 STATIC_ASSERT(LANGUAGE_END == 3);
900 class DeclareGlobalsLanguageMode : public BitField<LanguageMode, 2, 2> {}; 896 class DeclareGlobalsLanguageMode : public BitField<LanguageMode, 2, 2> {};
901 897
902 } // namespace internal 898 } // namespace internal
903 } // namespace v8 899 } // namespace v8
904 900
905 #endif // V8_RUNTIME_RUNTIME_H_ 901 #endif // V8_RUNTIME_RUNTIME_H_
OLDNEW
« no previous file with comments | « no previous file | src/runtime/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698