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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 /* Arrays */ \ | 208 /* Arrays */ \ |
209 F(RemoveArrayHoles, 1) \ | 209 F(RemoveArrayHoles, 1) \ |
210 F(GetArrayKeys, 2) \ | 210 F(GetArrayKeys, 2) \ |
211 F(MoveArrayContents, 2) \ | 211 F(MoveArrayContents, 2) \ |
212 F(EstimateNumberOfElements, 1) \ | 212 F(EstimateNumberOfElements, 1) \ |
213 \ | 213 \ |
214 /* Getters and Setters */ \ | 214 /* Getters and Setters */ \ |
215 F(DefineAccessor, -1 /* 4 or 5 */) \ | 215 F(DefineAccessor, -1 /* 4 or 5 */) \ |
216 F(LookupAccessor, 3) \ | 216 F(LookupAccessor, 3) \ |
217 \ | 217 \ |
218 /* Debugging */ \ | |
219 F(SetDebugEventListener, 2) \ | |
220 F(Break, 0) \ | |
221 F(DebugGetPropertyDetails, 2) \ | |
222 F(DebugGetProperty, 2) \ | |
223 F(DebugLocalPropertyNames, 1) \ | |
224 F(DebugLocalElementNames, 1) \ | |
225 F(DebugPropertyTypeFromDetails, 1) \ | |
226 F(DebugPropertyAttributesFromDetails, 1) \ | |
227 F(DebugPropertyIndexFromDetails, 1) \ | |
228 F(DebugInterceptorInfo, 1) \ | |
229 F(DebugNamedInterceptorPropertyNames, 1) \ | |
230 F(DebugIndexedInterceptorElementNames, 1) \ | |
231 F(DebugNamedInterceptorPropertyValue, 2) \ | |
232 F(DebugIndexedInterceptorElementValue, 2) \ | |
233 F(CheckExecutionState, 1) \ | |
234 F(GetFrameCount, 1) \ | |
235 F(GetFrameDetails, 2) \ | |
236 F(GetCFrames, 1) \ | |
237 F(GetThreadCount, 1) \ | |
238 F(GetThreadDetails, 2) \ | |
239 F(GetBreakLocations, 1) \ | |
240 F(SetFunctionBreakPoint, 3) \ | |
241 F(SetScriptBreakPoint, 3) \ | |
242 F(ClearBreakPoint, 1) \ | |
243 F(ChangeBreakOnException, 2) \ | |
244 F(PrepareStep, 3) \ | |
245 F(ClearStepping, 0) \ | |
246 F(DebugEvaluate, 4) \ | |
247 F(DebugEvaluateGlobal, 3) \ | |
248 F(DebugGetLoadedScripts, 0) \ | |
249 F(DebugReferencedBy, 3) \ | |
250 F(DebugConstructedBy, 2) \ | |
251 F(DebugGetPrototype, 1) \ | |
252 F(SystemBreak, 0) \ | |
253 \ | |
254 /* Literals */ \ | 218 /* Literals */ \ |
255 F(MaterializeRegExpLiteral, 4)\ | 219 F(MaterializeRegExpLiteral, 4)\ |
256 F(CreateArrayLiteralBoilerplate, 3) \ | 220 F(CreateArrayLiteralBoilerplate, 3) \ |
257 F(CreateObjectLiteralBoilerplate, 3) \ | 221 F(CreateObjectLiteralBoilerplate, 3) \ |
258 F(CloneLiteralBoilerplate, 1) \ | 222 F(CloneLiteralBoilerplate, 1) \ |
259 F(CloneShallowLiteralBoilerplate, 1) \ | 223 F(CloneShallowLiteralBoilerplate, 1) \ |
260 \ | 224 \ |
261 /* Catch context extension objects */ \ | 225 /* Catch context extension objects */ \ |
262 F(CreateCatchExtensionObject, 2) \ | 226 F(CreateCatchExtensionObject, 2) \ |
263 \ | 227 \ |
(...skipping 19 matching lines...) Expand all Loading... |
283 F(DeclareContextSlot, 4) \ | 247 F(DeclareContextSlot, 4) \ |
284 F(InitializeVarGlobal, -1 /* 1 or 2 */) \ | 248 F(InitializeVarGlobal, -1 /* 1 or 2 */) \ |
285 F(InitializeConstGlobal, 2) \ | 249 F(InitializeConstGlobal, 2) \ |
286 F(InitializeConstContextSlot, 3) \ | 250 F(InitializeConstContextSlot, 3) \ |
287 \ | 251 \ |
288 /* Debugging */ \ | 252 /* Debugging */ \ |
289 F(DebugPrint, 1) \ | 253 F(DebugPrint, 1) \ |
290 F(DebugTrace, 0) \ | 254 F(DebugTrace, 0) \ |
291 F(TraceEnter, 0) \ | 255 F(TraceEnter, 0) \ |
292 F(TraceExit, 1) \ | 256 F(TraceExit, 1) \ |
293 F(DebugBreak, 0) \ | |
294 F(FunctionGetAssemblerCode, 1) \ | |
295 F(Abort, 2) \ | 257 F(Abort, 2) \ |
296 /* Logging */ \ | 258 /* Logging */ \ |
297 F(Log, 2) \ | 259 F(Log, 2) \ |
298 \ | 260 \ |
299 /* Pseudo functions - handled as macros by parser */ \ | 261 /* Pseudo functions - handled as macros by parser */ \ |
300 F(IS_VAR, 1) | 262 F(IS_VAR, 1) |
301 | 263 |
| 264 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 265 #define RUNTIME_FUNCTION_LIST_DEBUGGER_SUPPORT(F) \ |
| 266 /* Debugger support*/ \ |
| 267 F(DebugBreak, 0) \ |
| 268 F(SetDebugEventListener, 2) \ |
| 269 F(Break, 0) \ |
| 270 F(DebugGetPropertyDetails, 2) \ |
| 271 F(DebugGetProperty, 2) \ |
| 272 F(DebugLocalPropertyNames, 1) \ |
| 273 F(DebugLocalElementNames, 1) \ |
| 274 F(DebugPropertyTypeFromDetails, 1) \ |
| 275 F(DebugPropertyAttributesFromDetails, 1) \ |
| 276 F(DebugPropertyIndexFromDetails, 1) \ |
| 277 F(DebugInterceptorInfo, 1) \ |
| 278 F(DebugNamedInterceptorPropertyNames, 1) \ |
| 279 F(DebugIndexedInterceptorElementNames, 1) \ |
| 280 F(DebugNamedInterceptorPropertyValue, 2) \ |
| 281 F(DebugIndexedInterceptorElementValue, 2) \ |
| 282 F(CheckExecutionState, 1) \ |
| 283 F(GetFrameCount, 1) \ |
| 284 F(GetFrameDetails, 2) \ |
| 285 F(GetCFrames, 1) \ |
| 286 F(GetThreadCount, 1) \ |
| 287 F(GetThreadDetails, 2) \ |
| 288 F(GetBreakLocations, 1) \ |
| 289 F(SetFunctionBreakPoint, 3) \ |
| 290 F(SetScriptBreakPoint, 3) \ |
| 291 F(ClearBreakPoint, 1) \ |
| 292 F(ChangeBreakOnException, 2) \ |
| 293 F(PrepareStep, 3) \ |
| 294 F(ClearStepping, 0) \ |
| 295 F(DebugEvaluate, 4) \ |
| 296 F(DebugEvaluateGlobal, 3) \ |
| 297 F(DebugGetLoadedScripts, 0) \ |
| 298 F(DebugReferencedBy, 3) \ |
| 299 F(DebugConstructedBy, 2) \ |
| 300 F(DebugGetPrototype, 1) \ |
| 301 F(SystemBreak, 0) \ |
| 302 F(FunctionGetAssemblerCode, 1) |
| 303 #else |
| 304 #define RUNTIME_FUNCTION_LIST_DEBUGGER_SUPPORT(F) |
| 305 #endif |
302 | 306 |
303 #ifdef DEBUG | 307 #ifdef DEBUG |
304 #define RUNTIME_FUNCTION_LIST_DEBUG(F) \ | 308 #define RUNTIME_FUNCTION_LIST_DEBUG(F) \ |
305 /* Testing */ \ | 309 /* Testing */ \ |
306 F(ListNatives, 0) | 310 F(ListNatives, 0) |
307 #else | 311 #else |
308 #define RUNTIME_FUNCTION_LIST_DEBUG(F) | 312 #define RUNTIME_FUNCTION_LIST_DEBUG(F) |
309 #endif | 313 #endif |
310 | 314 |
311 | 315 |
312 // ---------------------------------------------------------------------------- | 316 // ---------------------------------------------------------------------------- |
313 // RUNTIME_FUNCTION_LIST defines all runtime functions accessed | 317 // RUNTIME_FUNCTION_LIST defines all runtime functions accessed |
314 // either directly by id (via the code generator), or indirectly | 318 // either directly by id (via the code generator), or indirectly |
315 // via a native call by name (from within JS code). | 319 // via a native call by name (from within JS code). |
316 | 320 |
317 #define RUNTIME_FUNCTION_LIST(F) \ | 321 #define RUNTIME_FUNCTION_LIST(F) \ |
318 RUNTIME_FUNCTION_LIST_ALWAYS(F) \ | 322 RUNTIME_FUNCTION_LIST_ALWAYS(F) \ |
319 RUNTIME_FUNCTION_LIST_DEBUG(F) | 323 RUNTIME_FUNCTION_LIST_DEBUG(F) \ |
| 324 RUNTIME_FUNCTION_LIST_DEBUGGER_SUPPORT(F) |
320 | 325 |
321 // ---------------------------------------------------------------------------- | 326 // ---------------------------------------------------------------------------- |
322 // Runtime provides access to all C++ runtime functions. | 327 // Runtime provides access to all C++ runtime functions. |
323 | 328 |
324 class Runtime : public AllStatic { | 329 class Runtime : public AllStatic { |
325 public: | 330 public: |
326 enum FunctionId { | 331 enum FunctionId { |
327 #define F(name, nargs) k##name, | 332 #define F(name, nargs) k##name, |
328 RUNTIME_FUNCTION_LIST(F) | 333 RUNTIME_FUNCTION_LIST(F) |
329 kNofFunctions | 334 kNofFunctions |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 int position); | 381 int position); |
377 | 382 |
378 // Helper functions used stubs. | 383 // Helper functions used stubs. |
379 static void PerformGC(Object* result); | 384 static void PerformGC(Object* result); |
380 }; | 385 }; |
381 | 386 |
382 | 387 |
383 } } // namespace v8::internal | 388 } } // namespace v8::internal |
384 | 389 |
385 #endif // V8_RUNTIME_H_ | 390 #endif // V8_RUNTIME_H_ |
OLD | NEW |