OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 19 matching lines...) Expand all Loading... |
30 | 30 |
31 namespace v8 { namespace internal { | 31 namespace v8 { namespace internal { |
32 | 32 |
33 // The interface to C++ runtime functions. | 33 // The interface to C++ runtime functions. |
34 | 34 |
35 // ---------------------------------------------------------------------------- | 35 // ---------------------------------------------------------------------------- |
36 // RUNTIME_FUNCTION_LIST_ALWAYS defines runtime calls available in both | 36 // RUNTIME_FUNCTION_LIST_ALWAYS defines runtime calls available in both |
37 // release and debug mode. | 37 // release and debug mode. |
38 // This macro should only be used by the macro RUNTIME_FUNCTION_LIST. | 38 // This macro should only be used by the macro RUNTIME_FUNCTION_LIST. |
39 | 39 |
40 #define RUNTIME_FUNCTION_LIST_ALWAYS(F) \ | 40 // WARNING: RUNTIME_FUNCTION_LIST_ALWAYS_* is a very large macro that caused |
| 41 // MSVC Intellisense to crash. It was broken into two macros to work around |
| 42 // this problem. Please avoid large recursive macros whenever possible. |
| 43 #define RUNTIME_FUNCTION_LIST_ALWAYS_1(F) \ |
41 /* Property access */ \ | 44 /* Property access */ \ |
42 F(GetProperty, 2) \ | 45 F(GetProperty, 2) \ |
43 F(KeyedGetProperty, 2) \ | 46 F(KeyedGetProperty, 2) \ |
44 F(DeleteProperty, 2) \ | 47 F(DeleteProperty, 2) \ |
45 F(HasLocalProperty, 2) \ | 48 F(HasLocalProperty, 2) \ |
46 F(HasProperty, 2) \ | 49 F(HasProperty, 2) \ |
47 F(HasElement, 2) \ | 50 F(HasElement, 2) \ |
48 F(IsPropertyEnumerable, 2) \ | 51 F(IsPropertyEnumerable, 2) \ |
49 F(GetPropertyNames, 1) \ | 52 F(GetPropertyNames, 1) \ |
50 F(GetPropertyNamesFast, 1) \ | 53 F(GetPropertyNamesFast, 1) \ |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 F(StringLastIndexOf, 3) \ | 149 F(StringLastIndexOf, 3) \ |
147 F(StringLocaleCompare, 2) \ | 150 F(StringLocaleCompare, 2) \ |
148 F(StringSlice, 3) \ | 151 F(StringSlice, 3) \ |
149 F(StringReplaceRegExpWithString, 4) \ | 152 F(StringReplaceRegExpWithString, 4) \ |
150 F(StringMatch, 3) \ | 153 F(StringMatch, 3) \ |
151 \ | 154 \ |
152 /* Numbers */ \ | 155 /* Numbers */ \ |
153 F(NumberToRadixString, 2) \ | 156 F(NumberToRadixString, 2) \ |
154 F(NumberToFixed, 2) \ | 157 F(NumberToFixed, 2) \ |
155 F(NumberToExponential, 2) \ | 158 F(NumberToExponential, 2) \ |
156 F(NumberToPrecision, 2) \ | 159 F(NumberToPrecision, 2) |
157 \ | 160 |
| 161 #define RUNTIME_FUNCTION_LIST_ALWAYS_2(F) \ |
158 /* Reflection */ \ | 162 /* Reflection */ \ |
159 F(FunctionSetInstanceClassName, 2) \ | 163 F(FunctionSetInstanceClassName, 2) \ |
160 F(FunctionSetLength, 2) \ | 164 F(FunctionSetLength, 2) \ |
161 F(FunctionSetPrototype, 2) \ | 165 F(FunctionSetPrototype, 2) \ |
162 F(FunctionGetName, 1) \ | 166 F(FunctionGetName, 1) \ |
163 F(FunctionSetName, 2) \ | 167 F(FunctionSetName, 2) \ |
164 F(FunctionGetSourceCode, 1) \ | 168 F(FunctionGetSourceCode, 1) \ |
165 F(FunctionGetScript, 1) \ | 169 F(FunctionGetScript, 1) \ |
166 F(FunctionGetScriptSourcePosition, 1) \ | 170 F(FunctionGetScriptSourcePosition, 1) \ |
167 F(FunctionIsAPIFunction, 1) \ | 171 F(FunctionIsAPIFunction, 1) \ |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 #define RUNTIME_FUNCTION_LIST_DEBUG(F) | 317 #define RUNTIME_FUNCTION_LIST_DEBUG(F) |
314 #endif | 318 #endif |
315 | 319 |
316 | 320 |
317 // ---------------------------------------------------------------------------- | 321 // ---------------------------------------------------------------------------- |
318 // RUNTIME_FUNCTION_LIST defines all runtime functions accessed | 322 // RUNTIME_FUNCTION_LIST defines all runtime functions accessed |
319 // either directly by id (via the code generator), or indirectly | 323 // either directly by id (via the code generator), or indirectly |
320 // via a native call by name (from within JS code). | 324 // via a native call by name (from within JS code). |
321 | 325 |
322 #define RUNTIME_FUNCTION_LIST(F) \ | 326 #define RUNTIME_FUNCTION_LIST(F) \ |
323 RUNTIME_FUNCTION_LIST_ALWAYS(F) \ | 327 RUNTIME_FUNCTION_LIST_ALWAYS_1(F) \ |
| 328 RUNTIME_FUNCTION_LIST_ALWAYS_2(F) \ |
324 RUNTIME_FUNCTION_LIST_DEBUG(F) \ | 329 RUNTIME_FUNCTION_LIST_DEBUG(F) \ |
325 RUNTIME_FUNCTION_LIST_DEBUGGER_SUPPORT(F) | 330 RUNTIME_FUNCTION_LIST_DEBUGGER_SUPPORT(F) |
326 | 331 |
327 // ---------------------------------------------------------------------------- | 332 // ---------------------------------------------------------------------------- |
328 // Runtime provides access to all C++ runtime functions. | 333 // Runtime provides access to all C++ runtime functions. |
329 | 334 |
330 class Runtime : public AllStatic { | 335 class Runtime : public AllStatic { |
331 public: | 336 public: |
332 enum FunctionId { | 337 enum FunctionId { |
333 #define F(name, nargs) k##name, | 338 #define F(name, nargs) k##name, |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 int position); | 392 int position); |
388 | 393 |
389 // Helper functions used stubs. | 394 // Helper functions used stubs. |
390 static void PerformGC(Object* result); | 395 static void PerformGC(Object* result); |
391 }; | 396 }; |
392 | 397 |
393 | 398 |
394 } } // namespace v8::internal | 399 } } // namespace v8::internal |
395 | 400 |
396 #endif // V8_RUNTIME_H_ | 401 #endif // V8_RUNTIME_H_ |
OLD | NEW |