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/unicode.h" | 10 #include "src/unicode.h" |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 F(BreakIteratorCurrent, 1, 1) \ | 296 F(BreakIteratorCurrent, 1, 1) \ |
297 F(BreakIteratorBreakType, 1, 1) | 297 F(BreakIteratorBreakType, 1, 1) |
298 #else | 298 #else |
299 #define FOR_EACH_INTRINSIC_I18N(F) | 299 #define FOR_EACH_INTRINSIC_I18N(F) |
300 #endif | 300 #endif |
301 | 301 |
302 | 302 |
303 #define FOR_EACH_INTRINSIC_INTERNAL(F) \ | 303 #define FOR_EACH_INTRINSIC_INTERNAL(F) \ |
304 F(CheckIsBootstrapping, 0, 1) \ | 304 F(CheckIsBootstrapping, 0, 1) \ |
305 F(ExportPrivateSymbols, 1, 1) \ | 305 F(ExportPrivateSymbols, 1, 1) \ |
306 F(ImportToRuntime, 1, 1) \ | 306 F(InstallToContext, 1, 1) \ |
307 F(ImportExperimentalToRuntime, 1, 1) \ | |
308 F(InstallJSBuiltins, 1, 1) \ | 307 F(InstallJSBuiltins, 1, 1) \ |
309 F(Throw, 1, 1) \ | 308 F(Throw, 1, 1) \ |
310 F(ReThrow, 1, 1) \ | 309 F(ReThrow, 1, 1) \ |
311 F(UnwindAndFindExceptionHandler, 0, 1) \ | 310 F(UnwindAndFindExceptionHandler, 0, 1) \ |
312 F(PromoteScheduledException, 0, 1) \ | 311 F(PromoteScheduledException, 0, 1) \ |
313 F(ThrowReferenceError, 1, 1) \ | 312 F(ThrowReferenceError, 1, 1) \ |
314 F(NewTypeError, 2, 1) \ | 313 F(NewTypeError, 2, 1) \ |
315 F(NewSyntaxError, 2, 1) \ | 314 F(NewSyntaxError, 2, 1) \ |
316 F(NewReferenceError, 2, 1) \ | 315 F(NewReferenceError, 2, 1) \ |
317 F(ThrowIteratorResultNotAnObject, 1, 1) \ | 316 F(ThrowIteratorResultNotAnObject, 1, 1) \ |
(...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1086 | 1085 |
1087 | 1086 |
1088 class JavaScriptFrameIterator; // Forward declaration. | 1087 class JavaScriptFrameIterator; // Forward declaration. |
1089 | 1088 |
1090 | 1089 |
1091 class Runtime : public AllStatic { | 1090 class Runtime : public AllStatic { |
1092 public: | 1091 public: |
1093 enum FunctionId { | 1092 enum FunctionId { |
1094 #define F(name, nargs, ressize) k##name, | 1093 #define F(name, nargs, ressize) k##name, |
1095 #define I(name, nargs, ressize) kInline##name, | 1094 #define I(name, nargs, ressize) kInline##name, |
1096 FOR_EACH_INTRINSIC(F) FOR_EACH_INTRINSIC(I) | 1095 FOR_EACH_INTRINSIC(F) |
| 1096 FOR_EACH_INTRINSIC(I) |
1097 #undef I | 1097 #undef I |
1098 #undef F | 1098 #undef F |
1099 kNumFunctions, | 1099 kNumFunctions, |
1100 }; | 1100 }; |
1101 | 1101 |
1102 enum IntrinsicType { RUNTIME, INLINE }; | 1102 enum IntrinsicType { RUNTIME, INLINE }; |
1103 | 1103 |
1104 // Intrinsic function descriptor. | 1104 // Intrinsic function descriptor. |
1105 struct Function { | 1105 struct Function { |
1106 FunctionId function_id; | 1106 FunctionId function_id; |
1107 IntrinsicType intrinsic_type; | 1107 IntrinsicType intrinsic_type; |
1108 // The JS name of the function. | 1108 // The JS name of the function. |
1109 const char* name; | 1109 const char* name; |
1110 | 1110 |
1111 // The C++ (native) entry point. NULL if the function is inlined. | 1111 // For RUNTIME functions, this is the C++ entry point. |
1112 byte* entry; | 1112 // For INLINE functions this is the C++ entry point of the fall back. |
| 1113 Address entry; |
1113 | 1114 |
1114 // The number of arguments expected. nargs is -1 if the function takes | 1115 // The number of arguments expected. nargs is -1 if the function takes |
1115 // a variable number of arguments. | 1116 // a variable number of arguments. |
1116 int nargs; | 1117 int8_t nargs; |
1117 // Size of result. Most functions return a single pointer, size 1. | 1118 // Size of result. Most functions return a single pointer, size 1. |
1118 int result_size; | 1119 int8_t result_size; |
1119 }; | 1120 }; |
1120 | 1121 |
1121 static const int kNotFound = -1; | 1122 static const int kNotFound = -1; |
1122 | 1123 |
1123 // Add internalized strings for all the intrinsic function names to a | 1124 // Add internalized strings for all the intrinsic function names to a |
1124 // StringDictionary. | 1125 // StringDictionary. |
1125 static void InitializeIntrinsicFunctionNames(Isolate* isolate, | 1126 static void InitializeIntrinsicFunctionNames(Isolate* isolate, |
1126 Handle<NameDictionary> dict); | 1127 Handle<NameDictionary> dict); |
1127 | 1128 |
1128 // Get the intrinsic function with the given name, which must be internalized. | 1129 // Get the intrinsic function with the given name, which must be internalized. |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1249 inline bool Runtime::AtomicIsLockFree(uint32_t size) { | 1250 inline bool Runtime::AtomicIsLockFree(uint32_t size) { |
1250 return size == 1 || size == 2 || size == 4; | 1251 return size == 1 || size == 2 || size == 4; |
1251 } | 1252 } |
1252 | 1253 |
1253 #endif | 1254 #endif |
1254 | 1255 |
1255 } // namespace internal | 1256 } // namespace internal |
1256 } // namespace v8 | 1257 } // namespace v8 |
1257 | 1258 |
1258 #endif // V8_RUNTIME_RUNTIME_H_ | 1259 #endif // V8_RUNTIME_RUNTIME_H_ |
OLD | NEW |