| 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_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 11 matching lines...) Expand all Loading... |
| 22 // * IDs are Runtime::k##name and Runtime::kInline##name, respectively. | 22 // * IDs are Runtime::k##name and Runtime::kInline##name, respectively. |
| 23 // | 23 // |
| 24 // * All intrinsics have a C++ implementation Runtime_##name. | 24 // * All intrinsics have a C++ implementation Runtime_##name. |
| 25 // | 25 // |
| 26 // * Each compiler has an explicit list of intrisics it supports, falling back | 26 // * Each compiler has an explicit list of intrisics it supports, falling back |
| 27 // to a simple runtime call if necessary. | 27 // to a simple runtime call if necessary. |
| 28 | 28 |
| 29 | 29 |
| 30 // Entries have the form F(name, number of arguments, number of values): | 30 // Entries have the form F(name, number of arguments, number of values): |
| 31 | 31 |
| 32 #define FOR_EACH_INTRINSIC_ARRAY(F) \ | 32 #define FOR_EACH_INTRINSIC_ARRAY(F) \ |
| 33 F(FinishArrayPrototypeSetup, 1, 1) \ | 33 F(FinishArrayPrototypeSetup, 1, 1) \ |
| 34 F(SpecialArrayFunctions, 0, 1) \ | 34 F(SpecialArrayFunctions, 0, 1) \ |
| 35 F(TransitionElementsKind, 2, 1) \ | 35 F(TransitionElementsKind, 2, 1) \ |
| 36 F(PushIfAbsent, 2, 1) \ | 36 F(PushIfAbsent, 2, 1) \ |
| 37 F(ArrayConcat, 1, 1) \ | 37 F(ArrayConcat, 1, 1) \ |
| 38 F(RemoveArrayHoles, 2, 1) \ | 38 F(RemoveArrayHoles, 2, 1) \ |
| 39 F(MoveArrayContents, 2, 1) \ | 39 F(MoveArrayContents, 2, 1) \ |
| 40 F(EstimateNumberOfElements, 1, 1) \ | 40 F(EstimateNumberOfElements, 1, 1) \ |
| 41 F(GetArrayKeys, 2, 1) \ | 41 F(GetArrayKeys, 2, 1) \ |
| 42 F(ArrayConstructor, -1, 1) \ | 42 F(ArrayConstructor, -1, 1) \ |
| 43 F(ArrayConstructorWithSubclassing, -1, 1) \ | 43 F(ArrayConstructorWithSubclassing, -1, 1) \ |
| 44 F(InternalArrayConstructor, -1, 1) \ | 44 F(InternalArrayConstructor, -1, 1) \ |
| 45 F(NormalizeElements, 1, 1) \ | 45 F(NormalizeElements, 1, 1) \ |
| 46 F(GrowArrayElements, 2, 1) \ | 46 F(GrowArrayElements, 2, 1) \ |
| 47 F(HasComplexElements, 1, 1) \ | 47 F(HasComplexElements, 1, 1) \ |
| 48 F(ForInCacheArrayLength, 2, 1) /* TODO(turbofan): Only temporary */ \ | 48 F(IsArray, 1, 1) \ |
| 49 F(IsArray, 1, 1) \ | 49 F(HasCachedArrayIndex, 1, 1) \ |
| 50 F(HasCachedArrayIndex, 1, 1) \ | 50 F(GetCachedArrayIndex, 1, 1) \ |
| 51 F(GetCachedArrayIndex, 1, 1) \ | 51 F(FixedArrayGet, 2, 1) \ |
| 52 F(FixedArrayGet, 2, 1) \ | 52 F(FixedArraySet, 3, 1) \ |
| 53 F(FixedArraySet, 3, 1) \ | |
| 54 F(FastOneByteArrayJoin, 2, 1) | 53 F(FastOneByteArrayJoin, 2, 1) |
| 55 | 54 |
| 56 | 55 |
| 57 #define FOR_EACH_INTRINSIC_CLASSES(F) \ | 56 #define FOR_EACH_INTRINSIC_CLASSES(F) \ |
| 58 F(ThrowNonMethodError, 0, 1) \ | 57 F(ThrowNonMethodError, 0, 1) \ |
| 59 F(ThrowUnsupportedSuperError, 0, 1) \ | 58 F(ThrowUnsupportedSuperError, 0, 1) \ |
| 60 F(ThrowConstructorNonCallableError, 0, 1) \ | 59 F(ThrowConstructorNonCallableError, 0, 1) \ |
| 61 F(ThrowArrayNotSubclassableError, 0, 1) \ | 60 F(ThrowArrayNotSubclassableError, 0, 1) \ |
| 62 F(ThrowStaticPrototypeError, 0, 1) \ | 61 F(ThrowStaticPrototypeError, 0, 1) \ |
| 63 F(ThrowIfStaticPrototype, 1, 1) \ | 62 F(ThrowIfStaticPrototype, 1, 1) \ |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 F(DebugCallbackSupportsStepping, 1, 1) \ | 180 F(DebugCallbackSupportsStepping, 1, 1) \ |
| 182 F(DebugPrepareStepInIfStepping, 1, 1) \ | 181 F(DebugPrepareStepInIfStepping, 1, 1) \ |
| 183 F(DebugPushPromise, 2, 1) \ | 182 F(DebugPushPromise, 2, 1) \ |
| 184 F(DebugPopPromise, 0, 1) \ | 183 F(DebugPopPromise, 0, 1) \ |
| 185 F(DebugPromiseEvent, 1, 1) \ | 184 F(DebugPromiseEvent, 1, 1) \ |
| 186 F(DebugAsyncTaskEvent, 1, 1) \ | 185 F(DebugAsyncTaskEvent, 1, 1) \ |
| 187 F(DebugIsActive, 0, 1) \ | 186 F(DebugIsActive, 0, 1) \ |
| 188 F(DebugBreakInOptimizedCode, 0, 1) | 187 F(DebugBreakInOptimizedCode, 0, 1) |
| 189 | 188 |
| 190 | 189 |
| 190 #define FOR_EACH_INTRINSIC_FORIN(F) \ |
| 191 F(ForInDone, 2, 1) \ |
| 192 F(ForInFilter, 2, 1) \ |
| 193 F(ForInNext, 4, 1) \ |
| 194 F(ForInStep, 1, 1) |
| 195 |
| 196 |
| 191 #define FOR_EACH_INTRINSIC_FUNCTION(F) \ | 197 #define FOR_EACH_INTRINSIC_FUNCTION(F) \ |
| 192 F(IsSloppyModeFunction, 1, 1) \ | 198 F(IsSloppyModeFunction, 1, 1) \ |
| 193 F(FunctionGetName, 1, 1) \ | 199 F(FunctionGetName, 1, 1) \ |
| 194 F(FunctionSetName, 2, 1) \ | 200 F(FunctionSetName, 2, 1) \ |
| 195 F(FunctionNameShouldPrintAsAnonymous, 1, 1) \ | 201 F(FunctionNameShouldPrintAsAnonymous, 1, 1) \ |
| 196 F(FunctionMarkNameShouldPrintAsAnonymous, 1, 1) \ | 202 F(FunctionMarkNameShouldPrintAsAnonymous, 1, 1) \ |
| 197 F(FunctionIsArrow, 1, 1) \ | 203 F(FunctionIsArrow, 1, 1) \ |
| 198 F(FunctionIsConciseMethod, 1, 1) \ | 204 F(FunctionIsConciseMethod, 1, 1) \ |
| 199 F(FunctionRemovePrototype, 1, 1) \ | 205 F(FunctionRemovePrototype, 1, 1) \ |
| 200 F(FunctionGetScript, 1, 1) \ | 206 F(FunctionGetScript, 1, 1) \ |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 665 F(DataViewSetInt32, 4, 1) \ | 671 F(DataViewSetInt32, 4, 1) \ |
| 666 F(DataViewSetFloat32, 4, 1) \ | 672 F(DataViewSetFloat32, 4, 1) \ |
| 667 F(DataViewSetFloat64, 4, 1) | 673 F(DataViewSetFloat64, 4, 1) |
| 668 | 674 |
| 669 | 675 |
| 670 #define FOR_EACH_INTRINSIC_URI(F) \ | 676 #define FOR_EACH_INTRINSIC_URI(F) \ |
| 671 F(URIEscape, 1, 1) \ | 677 F(URIEscape, 1, 1) \ |
| 672 F(URIUnescape, 1, 1) | 678 F(URIUnescape, 1, 1) |
| 673 | 679 |
| 674 | 680 |
| 675 #define FOR_EACH_INTRINSIC_RETURN_PAIR(F) \ | 681 #define FOR_EACH_INTRINSIC_RETURN_PAIR(F) \ |
| 676 F(LoadLookupSlot, 2, 2) \ | 682 F(LoadLookupSlot, 2, 2) \ |
| 677 F(LoadLookupSlotNoReferenceError, 2, 2) \ | 683 F(LoadLookupSlotNoReferenceError, 2, 2) \ |
| 678 F(ResolvePossiblyDirectEval, 6, 2) \ | 684 F(ResolvePossiblyDirectEval, 6, 2) |
| 679 F(ForInInit, 2, 2) /* TODO(turbofan): Only temporary */ \ | |
| 680 F(ForInNext, 4, 2) /* TODO(turbofan): Only temporary */ | |
| 681 | 685 |
| 682 | 686 |
| 683 #define FOR_EACH_INTRINSIC_RETURN_OBJECT(F) \ | 687 #define FOR_EACH_INTRINSIC_RETURN_OBJECT(F) \ |
| 684 FOR_EACH_INTRINSIC_ARRAY(F) \ | 688 FOR_EACH_INTRINSIC_ARRAY(F) \ |
| 685 FOR_EACH_INTRINSIC_CLASSES(F) \ | 689 FOR_EACH_INTRINSIC_CLASSES(F) \ |
| 686 FOR_EACH_INTRINSIC_COLLECTIONS(F) \ | 690 FOR_EACH_INTRINSIC_COLLECTIONS(F) \ |
| 687 FOR_EACH_INTRINSIC_COMPILER(F) \ | 691 FOR_EACH_INTRINSIC_COMPILER(F) \ |
| 688 FOR_EACH_INTRINSIC_DATE(F) \ | 692 FOR_EACH_INTRINSIC_DATE(F) \ |
| 689 FOR_EACH_INTRINSIC_DEBUG(F) \ | 693 FOR_EACH_INTRINSIC_DEBUG(F) \ |
| 694 FOR_EACH_INTRINSIC_FORIN(F) \ |
| 690 FOR_EACH_INTRINSIC_FUNCTION(F) \ | 695 FOR_EACH_INTRINSIC_FUNCTION(F) \ |
| 691 FOR_EACH_INTRINSIC_GENERATOR(F) \ | 696 FOR_EACH_INTRINSIC_GENERATOR(F) \ |
| 692 FOR_EACH_INTRINSIC_I18N(F) \ | 697 FOR_EACH_INTRINSIC_I18N(F) \ |
| 693 FOR_EACH_INTRINSIC_INTERNAL(F) \ | 698 FOR_EACH_INTRINSIC_INTERNAL(F) \ |
| 694 FOR_EACH_INTRINSIC_JSON(F) \ | 699 FOR_EACH_INTRINSIC_JSON(F) \ |
| 695 FOR_EACH_INTRINSIC_LITERALS(F) \ | 700 FOR_EACH_INTRINSIC_LITERALS(F) \ |
| 696 FOR_EACH_INTRINSIC_LIVEEDIT(F) \ | 701 FOR_EACH_INTRINSIC_LIVEEDIT(F) \ |
| 697 FOR_EACH_INTRINSIC_MATHS(F) \ | 702 FOR_EACH_INTRINSIC_MATHS(F) \ |
| 698 FOR_EACH_INTRINSIC_NUMBERS(F) \ | 703 FOR_EACH_INTRINSIC_NUMBERS(F) \ |
| 699 FOR_EACH_INTRINSIC_OBJECT(F) \ | 704 FOR_EACH_INTRINSIC_OBJECT(F) \ |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 881 | 886 |
| 882 class DeclareGlobalsEvalFlag : public BitField<bool, 0, 1> {}; | 887 class DeclareGlobalsEvalFlag : public BitField<bool, 0, 1> {}; |
| 883 class DeclareGlobalsNativeFlag : public BitField<bool, 1, 1> {}; | 888 class DeclareGlobalsNativeFlag : public BitField<bool, 1, 1> {}; |
| 884 STATIC_ASSERT(LANGUAGE_END == 3); | 889 STATIC_ASSERT(LANGUAGE_END == 3); |
| 885 class DeclareGlobalsLanguageMode : public BitField<LanguageMode, 2, 2> {}; | 890 class DeclareGlobalsLanguageMode : public BitField<LanguageMode, 2, 2> {}; |
| 886 | 891 |
| 887 } // namespace internal | 892 } // namespace internal |
| 888 } // namespace v8 | 893 } // namespace v8 |
| 889 | 894 |
| 890 #endif // V8_RUNTIME_RUNTIME_H_ | 895 #endif // V8_RUNTIME_RUNTIME_H_ |
| OLD | NEW |