| OLD | NEW |
| 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 Loading... |
| 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(MathAcos, 1, 1) \ | 160 F(Math_acos, 1, 1) \ |
| 161 F(MathAsin, 1, 1) \ | 161 F(Math_asin, 1, 1) \ |
| 162 F(MathAtan, 1, 1) \ | 162 F(Math_atan, 1, 1) \ |
| 163 F(MathFloor, 1, 1) \ | 163 F(Math_log, 1, 1) \ |
| 164 F(MathAtan2, 2, 1) \ | 164 F(Math_sqrt, 1, 1) \ |
| 165 F(Math_exp, 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) \ |
| 165 F(RoundNumber, 1, 1) \ | 170 F(RoundNumber, 1, 1) \ |
| 166 F(MathFround, 1, 1) \ | 171 F(Math_fround, 1, 1) \ |
| 167 \ | 172 \ |
| 168 /* Regular expressions */ \ | 173 /* Regular expressions */ \ |
| 169 F(RegExpCompile, 3, 1) \ | 174 F(RegExpCompile, 3, 1) \ |
| 170 F(RegExpExecMultiple, 4, 1) \ | 175 F(RegExpExecMultiple, 4, 1) \ |
| 171 F(RegExpInitializeObject, 5, 1) \ | 176 F(RegExpInitializeObject, 5, 1) \ |
| 172 \ | 177 \ |
| 173 /* JSON */ \ | 178 /* JSON */ \ |
| 174 F(ParseJson, 1, 1) \ | 179 F(ParseJson, 1, 1) \ |
| 175 F(BasicJSONStringify, 1, 1) \ | 180 F(BasicJSONStringify, 1, 1) \ |
| 176 F(QuoteJSONString, 1, 1) \ | 181 F(QuoteJSONString, 1, 1) \ |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 544 RUNTIME_FUNCTION_LIST_ALWAYS_1(F) \ | 549 RUNTIME_FUNCTION_LIST_ALWAYS_1(F) \ |
| 545 RUNTIME_FUNCTION_LIST_ALWAYS_2(F) \ | 550 RUNTIME_FUNCTION_LIST_ALWAYS_2(F) \ |
| 546 RUNTIME_FUNCTION_LIST_DEBUG(F) \ | 551 RUNTIME_FUNCTION_LIST_DEBUG(F) \ |
| 547 RUNTIME_FUNCTION_LIST_DEBUGGER_SUPPORT(F) \ | 552 RUNTIME_FUNCTION_LIST_DEBUGGER_SUPPORT(F) \ |
| 548 RUNTIME_FUNCTION_LIST_I18N_SUPPORT(F) | 553 RUNTIME_FUNCTION_LIST_I18N_SUPPORT(F) |
| 549 | 554 |
| 550 // RUNTIME_HIDDEN_FUNCTION_LIST defines all runtime functions accessed | 555 // RUNTIME_HIDDEN_FUNCTION_LIST defines all runtime functions accessed |
| 551 // by id from code generator, but not via native call by name. | 556 // by id from code generator, but not via native call by name. |
| 552 // Entries have the form F(name, number of arguments, number of return values). | 557 // Entries have the form F(name, number of arguments, number of return values). |
| 553 #define RUNTIME_HIDDEN_FUNCTION_LIST(F) \ | 558 #define RUNTIME_HIDDEN_FUNCTION_LIST(F) \ |
| 554 /* String and Regexp */ \ | |
| 555 F(NumberToString, 1, 1) \ | 559 F(NumberToString, 1, 1) \ |
| 556 F(RegExpConstructResult, 3, 1) \ | 560 F(RegExpConstructResult, 3, 1) \ |
| 557 F(RegExpExec, 4, 1) \ | 561 F(RegExpExec, 4, 1) \ |
| 558 F(StringAdd, 2, 1) \ | 562 F(StringAdd, 2, 1) \ |
| 559 F(SubString, 3, 1) \ | 563 F(SubString, 3, 1) \ |
| 560 F(StringCompare, 2, 1) \ | 564 F(StringCompare, 2, 1) \ |
| 561 F(StringCharCodeAt, 2, 1) \ | 565 F(StringCharCodeAt, 2, 1) \ |
| 562 F(Log, 3, 1) \ | 566 F(Log, 3, 1) \ |
| 563 F(GetFromCache, 2, 1) \ | 567 F(GetFromCache, 2, 1) \ |
| 564 \ | 568 \ |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 623 F(StoreContextSlot, 4, 1) \ | 627 F(StoreContextSlot, 4, 1) \ |
| 624 \ | 628 \ |
| 625 /* Declarations and initialization */ \ | 629 /* Declarations and initialization */ \ |
| 626 F(DeclareGlobals, 3, 1) \ | 630 F(DeclareGlobals, 3, 1) \ |
| 627 F(DeclareModules, 1, 1) \ | 631 F(DeclareModules, 1, 1) \ |
| 628 F(DeclareContextSlot, 4, 1) \ | 632 F(DeclareContextSlot, 4, 1) \ |
| 629 F(InitializeConstGlobal, 2, 1) \ | 633 F(InitializeConstGlobal, 2, 1) \ |
| 630 F(InitializeConstContextSlot, 3, 1) \ | 634 F(InitializeConstContextSlot, 3, 1) \ |
| 631 \ | 635 \ |
| 632 /* Eval */ \ | 636 /* Eval */ \ |
| 633 F(ResolvePossiblyDirectEval, 5, 2) \ | 637 F(ResolvePossiblyDirectEval, 5, 2) |
| 634 \ | |
| 635 /* Maths */ \ | |
| 636 F(MathPowSlow, 2, 1) \ | |
| 637 F(MathPow, 2, 1) | |
| 638 | 638 |
| 639 // ---------------------------------------------------------------------------- | 639 // ---------------------------------------------------------------------------- |
| 640 // INLINE_FUNCTION_LIST defines all inlined functions accessed | 640 // INLINE_FUNCTION_LIST defines all inlined functions accessed |
| 641 // with a native call of the form %_name from within JS code. | 641 // 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). | 642 // Entries have the form F(name, number of arguments, number of return values). |
| 643 #define INLINE_FUNCTION_LIST(F) \ | 643 #define INLINE_FUNCTION_LIST(F) \ |
| 644 F(IsSmi, 1, 1) \ | 644 F(IsSmi, 1, 1) \ |
| 645 F(IsNonNegativeSmi, 1, 1) \ | 645 F(IsNonNegativeSmi, 1, 1) \ |
| 646 F(IsArray, 1, 1) \ | 646 F(IsArray, 1, 1) \ |
| 647 F(IsRegExp, 1, 1) \ | 647 F(IsRegExp, 1, 1) \ |
| 648 F(IsConstructCall, 0, 1) \ | 648 F(IsConstructCall, 0, 1) \ |
| 649 F(CallFunction, -1 /* receiver + n args + function */, 1) \ | 649 F(CallFunction, -1 /* receiver + n args + function */, 1) \ |
| 650 F(ArgumentsLength, 0, 1) \ | 650 F(ArgumentsLength, 0, 1) \ |
| 651 F(Arguments, 1, 1) \ | 651 F(Arguments, 1, 1) \ |
| 652 F(ValueOf, 1, 1) \ | 652 F(ValueOf, 1, 1) \ |
| 653 F(SetValueOf, 2, 1) \ | 653 F(SetValueOf, 2, 1) \ |
| 654 F(DateField, 2 /* date object, field index */, 1) \ | 654 F(DateField, 2 /* date object, field index */, 1) \ |
| 655 F(StringCharFromCode, 1, 1) \ | 655 F(StringCharFromCode, 1, 1) \ |
| 656 F(StringCharAt, 2, 1) \ | 656 F(StringCharAt, 2, 1) \ |
| 657 F(OneByteSeqStringSetChar, 3, 1) \ | 657 F(OneByteSeqStringSetChar, 3, 1) \ |
| 658 F(TwoByteSeqStringSetChar, 3, 1) \ | 658 F(TwoByteSeqStringSetChar, 3, 1) \ |
| 659 F(ObjectEquals, 2, 1) \ | 659 F(ObjectEquals, 2, 1) \ |
| 660 F(IsObject, 1, 1) \ | 660 F(IsObject, 1, 1) \ |
| 661 F(IsFunction, 1, 1) \ | 661 F(IsFunction, 1, 1) \ |
| 662 F(IsUndetectableObject, 1, 1) \ | 662 F(IsUndetectableObject, 1, 1) \ |
| 663 F(IsSpecObject, 1, 1) \ | 663 F(IsSpecObject, 1, 1) \ |
| 664 F(IsStringWrapperSafeForDefaultValueOf, 1, 1) \ | 664 F(IsStringWrapperSafeForDefaultValueOf, 1, 1) \ |
| 665 F(MathPow, 2, 1) \ | 665 F(MathPow, 2, 1) \ |
| 666 F(MathSqrt, 1, 1) \ |
| 667 F(MathLog, 1, 1) \ |
| 666 F(IsMinusZero, 1, 1) \ | 668 F(IsMinusZero, 1, 1) \ |
| 667 F(HasCachedArrayIndex, 1, 1) \ | 669 F(HasCachedArrayIndex, 1, 1) \ |
| 668 F(GetCachedArrayIndex, 1, 1) \ | 670 F(GetCachedArrayIndex, 1, 1) \ |
| 669 F(FastAsciiArrayJoin, 2, 1) \ | 671 F(FastAsciiArrayJoin, 2, 1) \ |
| 670 F(GeneratorNext, 2, 1) \ | 672 F(GeneratorNext, 2, 1) \ |
| 671 F(GeneratorThrow, 2, 1) \ | 673 F(GeneratorThrow, 2, 1) \ |
| 672 F(DebugBreakInOptimizedCode, 0, 1) \ | 674 F(DebugBreakInOptimizedCode, 0, 1) \ |
| 673 F(ClassOf, 1, 1) \ | 675 F(ClassOf, 1, 1) \ |
| 674 F(StringCharCodeAt, 2, 1) \ | 676 F(StringCharCodeAt, 2, 1) \ |
| 675 F(Log, 3, 1) \ | 677 F(Log, 3, 1) \ |
| 676 F(StringAdd, 2, 1) \ | 678 F(StringAdd, 2, 1) \ |
| 677 F(SubString, 3, 1) \ | 679 F(SubString, 3, 1) \ |
| 678 F(StringCompare, 2, 1) \ | 680 F(StringCompare, 2, 1) \ |
| 679 F(RegExpExec, 4, 1) \ | 681 F(RegExpExec, 4, 1) \ |
| 680 F(RegExpConstructResult, 3, 1) \ | 682 F(RegExpConstructResult, 3, 1) \ |
| 681 F(GetFromCache, 2, 1) \ | 683 F(GetFromCache, 2, 1) \ |
| 682 F(NumberToString, 1, 1) | 684 F(NumberToString, 1, 1) |
| 683 | 685 |
| 684 | 686 |
| 685 // ---------------------------------------------------------------------------- | 687 // ---------------------------------------------------------------------------- |
| 686 // INLINE_OPTIMIZED_FUNCTION_LIST defines all inlined functions accessed | 688 // INLINE_OPTIMIZED_FUNCTION_LIST defines all inlined functions accessed |
| 687 // with a native call of the form %_name from within JS code that also have | 689 // with a native call of the form %_name from within JS code that also have |
| 688 // a corresponding runtime function, that is called from non-optimized code. | 690 // a corresponding runtime function, that is called from non-optimized code. |
| 689 // Entries have the form F(name, number of arguments, number of return values). | 691 // Entries have the form F(name, number of arguments, number of return values). |
| 690 #define INLINE_OPTIMIZED_FUNCTION_LIST(F) \ | 692 #define INLINE_OPTIMIZED_FUNCTION_LIST(F) \ |
| 691 /* Typed Arrays */ \ | 693 F(DoubleHi, 1, 1) \ |
| 694 F(DoubleLo, 1, 1) \ |
| 692 F(ConstructDouble, 2, 1) \ | 695 F(ConstructDouble, 2, 1) \ |
| 693 F(TypedArrayInitialize, 5, 1) \ | 696 F(TypedArrayInitialize, 5, 1) \ |
| 694 F(DataViewInitialize, 4, 1) \ | 697 F(DataViewInitialize, 4, 1) \ |
| 695 F(MaxSmi, 0, 1) \ | 698 F(MaxSmi, 0, 1) \ |
| 696 F(TypedArrayMaxSizeInHeap, 0, 1) \ | 699 F(TypedArrayMaxSizeInHeap, 0, 1) |
| 697 \ | |
| 698 /* Maths */ \ | |
| 699 F(DoubleHi, 1, 1) \ | |
| 700 F(DoubleLo, 1, 1) \ | |
| 701 F(MathSqrt, 1, 1) \ | |
| 702 F(MathExp, 1, 1) \ | |
| 703 F(MathLog, 1, 1) | |
| 704 | 700 |
| 705 | 701 |
| 706 //--------------------------------------------------------------------------- | 702 //--------------------------------------------------------------------------- |
| 707 // Runtime provides access to all C++ runtime functions. | 703 // Runtime provides access to all C++ runtime functions. |
| 708 | 704 |
| 709 class RuntimeState { | 705 class RuntimeState { |
| 710 public: | 706 public: |
| 711 StaticResource<ConsStringIteratorOp>* string_iterator() { | 707 StaticResource<ConsStringIteratorOp>* string_iterator() { |
| 712 return &string_iterator_; | 708 return &string_iterator_; |
| 713 } | 709 } |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 915 class AllocateDoubleAlignFlag: public BitField<bool, 0, 1> {}; | 911 class AllocateDoubleAlignFlag: public BitField<bool, 0, 1> {}; |
| 916 class AllocateTargetSpace: public BitField<AllocationSpace, 1, 3> {}; | 912 class AllocateTargetSpace: public BitField<AllocationSpace, 1, 3> {}; |
| 917 | 913 |
| 918 class DeclareGlobalsEvalFlag: public BitField<bool, 0, 1> {}; | 914 class DeclareGlobalsEvalFlag: public BitField<bool, 0, 1> {}; |
| 919 class DeclareGlobalsNativeFlag: public BitField<bool, 1, 1> {}; | 915 class DeclareGlobalsNativeFlag: public BitField<bool, 1, 1> {}; |
| 920 class DeclareGlobalsStrictMode: public BitField<StrictMode, 2, 1> {}; | 916 class DeclareGlobalsStrictMode: public BitField<StrictMode, 2, 1> {}; |
| 921 | 917 |
| 922 } } // namespace v8::internal | 918 } } // namespace v8::internal |
| 923 | 919 |
| 924 #endif // V8_RUNTIME_H_ | 920 #endif // V8_RUNTIME_H_ |
| OLD | NEW |