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

Side by Side Diff: src/runtime.h

Issue 216643002: Reland "Clean up runtime functions for Maths." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix Created 6 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 | Annotate | Revision Log
« no previous file with comments | « src/mips/full-codegen-mips.cc ('k') | src/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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 F(NumberSar, 2, 1) \ 150 F(NumberSar, 2, 1) \
151 \ 151 \
152 /* Comparisons */ \ 152 /* Comparisons */ \
153 F(NumberEquals, 2, 1) \ 153 F(NumberEquals, 2, 1) \
154 F(StringEquals, 2, 1) \ 154 F(StringEquals, 2, 1) \
155 \ 155 \
156 F(NumberCompare, 3, 1) \ 156 F(NumberCompare, 3, 1) \
157 F(SmiLexicographicCompare, 2, 1) \ 157 F(SmiLexicographicCompare, 2, 1) \
158 \ 158 \
159 /* Math */ \ 159 /* Math */ \
160 F(Math_acos, 1, 1) \ 160 F(MathAcos, 1, 1) \
161 F(Math_asin, 1, 1) \ 161 F(MathAsin, 1, 1) \
162 F(Math_atan, 1, 1) \ 162 F(MathAtan, 1, 1) \
163 F(Math_log, 1, 1) \ 163 F(MathFloor, 1, 1) \
164 F(Math_sqrt, 1, 1) \ 164 F(MathAtan2, 2, 1) \
165 F(Math_exp, 1, 1) \ 165 F(MathExp, 1, 1) \
166 F(Math_floor, 1, 1) \
167 F(Math_pow, 2, 1) \
168 F(Math_pow_cfunction, 2, 1) \
169 F(Math_atan2, 2, 1) \
170 F(RoundNumber, 1, 1) \ 166 F(RoundNumber, 1, 1) \
171 F(Math_fround, 1, 1) \ 167 F(MathFround, 1, 1) \
172 \ 168 \
173 /* Regular expressions */ \ 169 /* Regular expressions */ \
174 F(RegExpCompile, 3, 1) \ 170 F(RegExpCompile, 3, 1) \
175 F(RegExpExecMultiple, 4, 1) \ 171 F(RegExpExecMultiple, 4, 1) \
176 F(RegExpInitializeObject, 5, 1) \ 172 F(RegExpInitializeObject, 5, 1) \
177 \ 173 \
178 /* JSON */ \ 174 /* JSON */ \
179 F(ParseJson, 1, 1) \ 175 F(ParseJson, 1, 1) \
180 F(BasicJSONStringify, 1, 1) \ 176 F(BasicJSONStringify, 1, 1) \
181 F(QuoteJSONString, 1, 1) \ 177 F(QuoteJSONString, 1, 1) \
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 RUNTIME_FUNCTION_LIST_ALWAYS_1(F) \ 545 RUNTIME_FUNCTION_LIST_ALWAYS_1(F) \
550 RUNTIME_FUNCTION_LIST_ALWAYS_2(F) \ 546 RUNTIME_FUNCTION_LIST_ALWAYS_2(F) \
551 RUNTIME_FUNCTION_LIST_DEBUG(F) \ 547 RUNTIME_FUNCTION_LIST_DEBUG(F) \
552 RUNTIME_FUNCTION_LIST_DEBUGGER_SUPPORT(F) \ 548 RUNTIME_FUNCTION_LIST_DEBUGGER_SUPPORT(F) \
553 RUNTIME_FUNCTION_LIST_I18N_SUPPORT(F) 549 RUNTIME_FUNCTION_LIST_I18N_SUPPORT(F)
554 550
555 // RUNTIME_HIDDEN_FUNCTION_LIST defines all runtime functions accessed 551 // RUNTIME_HIDDEN_FUNCTION_LIST defines all runtime functions accessed
556 // by id from code generator, but not via native call by name. 552 // by id from code generator, but not via native call by name.
557 // Entries have the form F(name, number of arguments, number of return values). 553 // Entries have the form F(name, number of arguments, number of return values).
558 #define RUNTIME_HIDDEN_FUNCTION_LIST(F) \ 554 #define RUNTIME_HIDDEN_FUNCTION_LIST(F) \
555 /* String and Regexp */ \
559 F(NumberToString, 1, 1) \ 556 F(NumberToString, 1, 1) \
560 F(RegExpConstructResult, 3, 1) \ 557 F(RegExpConstructResult, 3, 1) \
561 F(RegExpExec, 4, 1) \ 558 F(RegExpExec, 4, 1) \
562 F(StringAdd, 2, 1) \ 559 F(StringAdd, 2, 1) \
563 F(SubString, 3, 1) \ 560 F(SubString, 3, 1) \
564 F(StringCompare, 2, 1) \ 561 F(StringCompare, 2, 1) \
565 F(StringCharCodeAt, 2, 1) \ 562 F(StringCharCodeAt, 2, 1) \
566 F(Log, 3, 1) \ 563 F(Log, 3, 1) \
567 F(GetFromCache, 2, 1) \ 564 F(GetFromCache, 2, 1) \
568 \ 565 \
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 F(StoreContextSlot, 4, 1) \ 624 F(StoreContextSlot, 4, 1) \
628 \ 625 \
629 /* Declarations and initialization */ \ 626 /* Declarations and initialization */ \
630 F(DeclareGlobals, 3, 1) \ 627 F(DeclareGlobals, 3, 1) \
631 F(DeclareModules, 1, 1) \ 628 F(DeclareModules, 1, 1) \
632 F(DeclareContextSlot, 4, 1) \ 629 F(DeclareContextSlot, 4, 1) \
633 F(InitializeConstGlobal, 2, 1) \ 630 F(InitializeConstGlobal, 2, 1) \
634 F(InitializeConstContextSlot, 3, 1) \ 631 F(InitializeConstContextSlot, 3, 1) \
635 \ 632 \
636 /* Eval */ \ 633 /* Eval */ \
637 F(ResolvePossiblyDirectEval, 5, 2) 634 F(ResolvePossiblyDirectEval, 5, 2) \
635 \
636 /* Maths */ \
637 F(MathPowSlow, 2, 1) \
638 F(MathPow, 2, 1)
638 639
639 // ---------------------------------------------------------------------------- 640 // ----------------------------------------------------------------------------
640 // INLINE_FUNCTION_LIST defines all inlined functions accessed 641 // INLINE_FUNCTION_LIST defines all inlined functions accessed
641 // with a native call of the form %_name from within JS code. 642 // with a native call of the form %_name from within JS code.
642 // Entries have the form F(name, number of arguments, number of return values). 643 // Entries have the form F(name, number of arguments, number of return values).
643 #define INLINE_FUNCTION_LIST(F) \ 644 #define INLINE_FUNCTION_LIST(F) \
644 F(IsSmi, 1, 1) \ 645 F(IsSmi, 1, 1) \
645 F(IsNonNegativeSmi, 1, 1) \ 646 F(IsNonNegativeSmi, 1, 1) \
646 F(IsArray, 1, 1) \ 647 F(IsArray, 1, 1) \
647 F(IsRegExp, 1, 1) \ 648 F(IsRegExp, 1, 1) \
648 F(IsConstructCall, 0, 1) \ 649 F(IsConstructCall, 0, 1) \
649 F(CallFunction, -1 /* receiver + n args + function */, 1) \ 650 F(CallFunction, -1 /* receiver + n args + function */, 1) \
650 F(ArgumentsLength, 0, 1) \ 651 F(ArgumentsLength, 0, 1) \
651 F(Arguments, 1, 1) \ 652 F(Arguments, 1, 1) \
652 F(ValueOf, 1, 1) \ 653 F(ValueOf, 1, 1) \
653 F(SetValueOf, 2, 1) \ 654 F(SetValueOf, 2, 1) \
654 F(DateField, 2 /* date object, field index */, 1) \ 655 F(DateField, 2 /* date object, field index */, 1) \
655 F(StringCharFromCode, 1, 1) \ 656 F(StringCharFromCode, 1, 1) \
656 F(StringCharAt, 2, 1) \ 657 F(StringCharAt, 2, 1) \
657 F(OneByteSeqStringSetChar, 3, 1) \ 658 F(OneByteSeqStringSetChar, 3, 1) \
658 F(TwoByteSeqStringSetChar, 3, 1) \ 659 F(TwoByteSeqStringSetChar, 3, 1) \
659 F(ObjectEquals, 2, 1) \ 660 F(ObjectEquals, 2, 1) \
660 F(IsObject, 1, 1) \ 661 F(IsObject, 1, 1) \
661 F(IsFunction, 1, 1) \ 662 F(IsFunction, 1, 1) \
662 F(IsUndetectableObject, 1, 1) \ 663 F(IsUndetectableObject, 1, 1) \
663 F(IsSpecObject, 1, 1) \ 664 F(IsSpecObject, 1, 1) \
664 F(IsStringWrapperSafeForDefaultValueOf, 1, 1) \ 665 F(IsStringWrapperSafeForDefaultValueOf, 1, 1) \
665 F(MathPow, 2, 1) \ 666 F(MathPow, 2, 1) \
666 F(MathSqrt, 1, 1) \
667 F(MathLog, 1, 1) \
668 F(IsMinusZero, 1, 1) \ 667 F(IsMinusZero, 1, 1) \
669 F(HasCachedArrayIndex, 1, 1) \ 668 F(HasCachedArrayIndex, 1, 1) \
670 F(GetCachedArrayIndex, 1, 1) \ 669 F(GetCachedArrayIndex, 1, 1) \
671 F(FastAsciiArrayJoin, 2, 1) \ 670 F(FastAsciiArrayJoin, 2, 1) \
672 F(GeneratorNext, 2, 1) \ 671 F(GeneratorNext, 2, 1) \
673 F(GeneratorThrow, 2, 1) \ 672 F(GeneratorThrow, 2, 1) \
674 F(DebugBreakInOptimizedCode, 0, 1) \ 673 F(DebugBreakInOptimizedCode, 0, 1) \
675 F(ClassOf, 1, 1) \ 674 F(ClassOf, 1, 1) \
676 F(StringCharCodeAt, 2, 1) \ 675 F(StringCharCodeAt, 2, 1) \
677 F(Log, 3, 1) \ 676 F(Log, 3, 1) \
678 F(StringAdd, 2, 1) \ 677 F(StringAdd, 2, 1) \
679 F(SubString, 3, 1) \ 678 F(SubString, 3, 1) \
680 F(StringCompare, 2, 1) \ 679 F(StringCompare, 2, 1) \
681 F(RegExpExec, 4, 1) \ 680 F(RegExpExec, 4, 1) \
682 F(RegExpConstructResult, 3, 1) \ 681 F(RegExpConstructResult, 3, 1) \
683 F(GetFromCache, 2, 1) \ 682 F(GetFromCache, 2, 1) \
684 F(NumberToString, 1, 1) 683 F(NumberToString, 1, 1)
685 684
686 685
687 // ---------------------------------------------------------------------------- 686 // ----------------------------------------------------------------------------
688 // INLINE_OPTIMIZED_FUNCTION_LIST defines all inlined functions accessed 687 // INLINE_OPTIMIZED_FUNCTION_LIST defines all inlined functions accessed
689 // with a native call of the form %_name from within JS code that also have 688 // with a native call of the form %_name from within JS code that also have
690 // a corresponding runtime function, that is called from non-optimized code. 689 // a corresponding runtime function, that is called from non-optimized code.
691 // Entries have the form F(name, number of arguments, number of return values). 690 // Entries have the form F(name, number of arguments, number of return values).
692 #define INLINE_OPTIMIZED_FUNCTION_LIST(F) \ 691 #define INLINE_OPTIMIZED_FUNCTION_LIST(F) \
693 F(DoubleHi, 1, 1) \ 692 /* Typed Arrays */ \
694 F(DoubleLo, 1, 1) \
695 F(ConstructDouble, 2, 1) \ 693 F(ConstructDouble, 2, 1) \
696 F(TypedArrayInitialize, 5, 1) \ 694 F(TypedArrayInitialize, 5, 1) \
697 F(DataViewInitialize, 4, 1) \ 695 F(DataViewInitialize, 4, 1) \
698 F(MaxSmi, 0, 1) \ 696 F(MaxSmi, 0, 1) \
699 F(TypedArrayMaxSizeInHeap, 0, 1) 697 F(TypedArrayMaxSizeInHeap, 0, 1) \
698 \
699 /* Maths */ \
700 F(DoubleHi, 1, 1) \
701 F(DoubleLo, 1, 1) \
702 F(MathSqrt, 1, 1) \
703 F(MathLog, 1, 1)
700 704
701 705
702 //--------------------------------------------------------------------------- 706 //---------------------------------------------------------------------------
703 // Runtime provides access to all C++ runtime functions. 707 // Runtime provides access to all C++ runtime functions.
704 708
705 class RuntimeState { 709 class RuntimeState {
706 public: 710 public:
707 StaticResource<ConsStringIteratorOp>* string_iterator() { 711 StaticResource<ConsStringIteratorOp>* string_iterator() {
708 return &string_iterator_; 712 return &string_iterator_;
709 } 713 }
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
911 class AllocateDoubleAlignFlag: public BitField<bool, 0, 1> {}; 915 class AllocateDoubleAlignFlag: public BitField<bool, 0, 1> {};
912 class AllocateTargetSpace: public BitField<AllocationSpace, 1, 3> {}; 916 class AllocateTargetSpace: public BitField<AllocationSpace, 1, 3> {};
913 917
914 class DeclareGlobalsEvalFlag: public BitField<bool, 0, 1> {}; 918 class DeclareGlobalsEvalFlag: public BitField<bool, 0, 1> {};
915 class DeclareGlobalsNativeFlag: public BitField<bool, 1, 1> {}; 919 class DeclareGlobalsNativeFlag: public BitField<bool, 1, 1> {};
916 class DeclareGlobalsStrictMode: public BitField<StrictMode, 2, 1> {}; 920 class DeclareGlobalsStrictMode: public BitField<StrictMode, 2, 1> {};
917 921
918 } } // namespace v8::internal 922 } } // namespace v8::internal
919 923
920 #endif // V8_RUNTIME_H_ 924 #endif // V8_RUNTIME_H_
OLDNEW
« no previous file with comments | « src/mips/full-codegen-mips.cc ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698