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 <memory> | 8 #include <memory> |
9 | 9 |
10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
(...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
919 F(ArrayBufferViewGetByteOffset, 1, 1) \ | 919 F(ArrayBufferViewGetByteOffset, 1, 1) \ |
920 F(TypedArrayGetLength, 1, 1) \ | 920 F(TypedArrayGetLength, 1, 1) \ |
921 F(TypedArrayGetBuffer, 1, 1) \ | 921 F(TypedArrayGetBuffer, 1, 1) \ |
922 F(TypedArraySetFastCases, 3, 1) \ | 922 F(TypedArraySetFastCases, 3, 1) \ |
923 F(TypedArrayMaxSizeInHeap, 0, 1) \ | 923 F(TypedArrayMaxSizeInHeap, 0, 1) \ |
924 F(IsTypedArray, 1, 1) \ | 924 F(IsTypedArray, 1, 1) \ |
925 F(IsSharedTypedArray, 1, 1) \ | 925 F(IsSharedTypedArray, 1, 1) \ |
926 F(IsSharedIntegerTypedArray, 1, 1) \ | 926 F(IsSharedIntegerTypedArray, 1, 1) \ |
927 F(IsSharedInteger32TypedArray, 1, 1) | 927 F(IsSharedInteger32TypedArray, 1, 1) |
928 | 928 |
929 #define FOR_EACH_INTRINSIC_WASM(F) \ | 929 #define FOR_EACH_INTRINSIC_WASM(F) \ |
930 F(WasmGrowMemory, 1, 1) \ | 930 F(WasmGrowMemory, 1, 1) \ |
931 F(WasmMemorySize, 0, 1) \ | 931 F(WasmMemorySize, 0, 1) \ |
932 F(ThrowWasmError, 2, 1) \ | 932 F(ThrowWasmError, 2, 1) \ |
933 F(WasmThrowTypeError, 0, 1) \ | 933 F(WasmThrowTypeError, 0, 1) \ |
934 F(WasmThrow, 2, 1) \ | 934 F(WasmThrow, 2, 1) \ |
935 F(WasmGetCaughtExceptionValue, 1, 1) | 935 F(WasmGetCaughtExceptionValue, 1, 1) \ |
| 936 F(ThrowWasmTrapUnreachable, 0, 1) \ |
| 937 F(ThrowWasmTrapMemOutOfBounds, 0, 1) \ |
| 938 F(ThrowWasmTrapDivByZero, 0, 1) \ |
| 939 F(ThrowWasmTrapDivUnrepresentable, 0, 1) \ |
| 940 F(ThrowWasmTrapRemByZero, 0, 1) \ |
| 941 F(ThrowWasmTrapFloatUnrepresentable, 0, 1) \ |
| 942 F(ThrowWasmTrapFuncInvalid, 0, 1) \ |
| 943 F(ThrowWasmTrapFuncSigMismatch, 0, 1) |
936 | 944 |
937 #define FOR_EACH_INTRINSIC_RETURN_PAIR(F) \ | 945 #define FOR_EACH_INTRINSIC_RETURN_PAIR(F) \ |
938 F(LoadLookupSlotForCall, 1, 2) | 946 F(LoadLookupSlotForCall, 1, 2) |
939 | 947 |
940 #define FOR_EACH_INTRINSIC_RETURN_TRIPLE(F) \ | 948 #define FOR_EACH_INTRINSIC_RETURN_TRIPLE(F) \ |
941 F(ForInPrepare, 1, 3) | 949 F(ForInPrepare, 1, 3) |
942 | 950 |
943 // Most intrinsics are implemented in the runtime/ directory, but ICs are | 951 // Most intrinsics are implemented in the runtime/ directory, but ICs are |
944 // implemented in ic.cc for now. | 952 // implemented in ic.cc for now. |
945 #define FOR_EACH_INTRINSIC_IC(F) \ | 953 #define FOR_EACH_INTRINSIC_IC(F) \ |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1009 Object* Runtime_##name(int args_length, Object** args_object, \ | 1017 Object* Runtime_##name(int args_length, Object** args_object, \ |
1010 Isolate* isolate); | 1018 Isolate* isolate); |
1011 FOR_EACH_INTRINSIC_RETURN_OBJECT(F) | 1019 FOR_EACH_INTRINSIC_RETURN_OBJECT(F) |
1012 #undef F | 1020 #undef F |
1013 | 1021 |
1014 //--------------------------------------------------------------------------- | 1022 //--------------------------------------------------------------------------- |
1015 // Runtime provides access to all C++ runtime functions. | 1023 // Runtime provides access to all C++ runtime functions. |
1016 | 1024 |
1017 class Runtime : public AllStatic { | 1025 class Runtime : public AllStatic { |
1018 public: | 1026 public: |
1019 enum FunctionId { | 1027 enum FunctionId : int32_t { |
1020 #define F(name, nargs, ressize) k##name, | 1028 #define F(name, nargs, ressize) k##name, |
1021 #define I(name, nargs, ressize) kInline##name, | 1029 #define I(name, nargs, ressize) kInline##name, |
1022 FOR_EACH_INTRINSIC(F) | 1030 FOR_EACH_INTRINSIC(F) FOR_EACH_INTRINSIC(I) |
1023 FOR_EACH_INTRINSIC(I) | |
1024 #undef I | 1031 #undef I |
1025 #undef F | 1032 #undef F |
1026 kNumFunctions, | 1033 kNumFunctions, |
1027 }; | 1034 }; |
1028 | 1035 |
1029 enum IntrinsicType { RUNTIME, INLINE }; | 1036 enum IntrinsicType { RUNTIME, INLINE }; |
1030 | 1037 |
1031 // Intrinsic function descriptor. | 1038 // Intrinsic function descriptor. |
1032 struct Function { | 1039 struct Function { |
1033 FunctionId function_id; | 1040 FunctionId function_id; |
1034 IntrinsicType intrinsic_type; | 1041 IntrinsicType intrinsic_type; |
1035 // The JS name of the function. | 1042 // The JS name of the function. |
1036 const char* name; | 1043 const char* name; |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1137 | 1144 |
1138 class DeclareGlobalsEvalFlag : public BitField<bool, 0, 1> {}; | 1145 class DeclareGlobalsEvalFlag : public BitField<bool, 0, 1> {}; |
1139 class DeclareGlobalsNativeFlag : public BitField<bool, 1, 1> {}; | 1146 class DeclareGlobalsNativeFlag : public BitField<bool, 1, 1> {}; |
1140 STATIC_ASSERT(LANGUAGE_END == 2); | 1147 STATIC_ASSERT(LANGUAGE_END == 2); |
1141 class DeclareGlobalsLanguageMode : public BitField<LanguageMode, 2, 1> {}; | 1148 class DeclareGlobalsLanguageMode : public BitField<LanguageMode, 2, 1> {}; |
1142 | 1149 |
1143 } // namespace internal | 1150 } // namespace internal |
1144 } // namespace v8 | 1151 } // namespace v8 |
1145 | 1152 |
1146 #endif // V8_RUNTIME_RUNTIME_H_ | 1153 #endif // V8_RUNTIME_RUNTIME_H_ |
OLD | NEW |