OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 /* Debugging */ \ | 290 /* Debugging */ \ |
291 F(DebugPrint, 1, 1) \ | 291 F(DebugPrint, 1, 1) \ |
292 F(DebugTrace, 0, 1) \ | 292 F(DebugTrace, 0, 1) \ |
293 F(TraceEnter, 0, 1) \ | 293 F(TraceEnter, 0, 1) \ |
294 F(TraceExit, 1, 1) \ | 294 F(TraceExit, 1, 1) \ |
295 F(Abort, 2, 1) \ | 295 F(Abort, 2, 1) \ |
296 /* Logging */ \ | 296 /* Logging */ \ |
297 F(Log, 2, 1) \ | 297 F(Log, 2, 1) \ |
298 /* ES5 */ \ | 298 /* ES5 */ \ |
299 F(LocalKeys, 1, 1) \ | 299 F(LocalKeys, 1, 1) \ |
300 /* Handle scopes */ \ | |
301 F(DeleteHandleScopeExtensions, 0, 1) \ | |
302 /* Cache suport */ \ | 300 /* Cache suport */ \ |
303 F(GetFromCache, 2, 1) \ | 301 F(GetFromCache, 2, 1) \ |
304 \ | 302 \ |
305 /* Pseudo functions - handled as macros by parser */ \ | 303 /* Pseudo functions - handled as macros by parser */ \ |
306 F(IS_VAR, 1, 1) | 304 F(IS_VAR, 1, 1) |
307 | 305 |
308 #ifdef ENABLE_DEBUGGER_SUPPORT | 306 #ifdef ENABLE_DEBUGGER_SUPPORT |
309 #define RUNTIME_FUNCTION_LIST_DEBUGGER_SUPPORT(F) \ | 307 #define RUNTIME_FUNCTION_LIST_DEBUGGER_SUPPORT(F) \ |
310 /* Debugger support*/ \ | 308 /* Debugger support*/ \ |
311 F(DebugBreak, 0, 1) \ | 309 F(DebugBreak, 0, 1) \ |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 // Size of result. Most functions return a single pointer, size 1. | 479 // Size of result. Most functions return a single pointer, size 1. |
482 int result_size; | 480 int result_size; |
483 }; | 481 }; |
484 | 482 |
485 static const int kNotFound = -1; | 483 static const int kNotFound = -1; |
486 | 484 |
487 // Add symbols for all the intrinsic function names to a StringDictionary. | 485 // Add symbols for all the intrinsic function names to a StringDictionary. |
488 // Returns failure if an allocation fails. In this case, it must be | 486 // Returns failure if an allocation fails. In this case, it must be |
489 // retried with a new, empty StringDictionary, not with the same one. | 487 // retried with a new, empty StringDictionary, not with the same one. |
490 // Alternatively, heap initialization can be completely restarted. | 488 // Alternatively, heap initialization can be completely restarted. |
491 static Object* InitializeIntrinsicFunctionNames(Object* dictionary); | 489 MUST_USE_RESULT static MaybeObject* InitializeIntrinsicFunctionNames( |
| 490 Object* dictionary); |
492 | 491 |
493 // Get the intrinsic function with the given name, which must be a symbol. | 492 // Get the intrinsic function with the given name, which must be a symbol. |
494 static Function* FunctionForSymbol(Handle<String> name); | 493 static Function* FunctionForSymbol(Handle<String> name); |
495 | 494 |
496 // Get the intrinsic function with the given FunctionId. | 495 // Get the intrinsic function with the given FunctionId. |
497 static Function* FunctionForId(FunctionId id); | 496 static Function* FunctionForId(FunctionId id); |
498 | 497 |
499 // General-purpose helper functions for runtime system. | 498 // General-purpose helper functions for runtime system. |
500 static int StringMatch(Handle<String> sub, Handle<String> pat, int index); | 499 static int StringMatch(Handle<String> sub, Handle<String> pat, int index); |
501 | 500 |
502 static bool IsUpperCaseChar(uint16_t ch); | 501 static bool IsUpperCaseChar(uint16_t ch); |
503 | 502 |
504 // TODO(1240886): The following three methods are *not* handle safe, | 503 // TODO(1240886): The following three methods are *not* handle safe, |
505 // but accept handle arguments. This seems fragile. | 504 // but accept handle arguments. This seems fragile. |
506 | 505 |
507 // Support getting the characters in a string using [] notation as | 506 // Support getting the characters in a string using [] notation as |
508 // in Firefox/SpiderMonkey, Safari and Opera. | 507 // in Firefox/SpiderMonkey, Safari and Opera. |
509 static Object* GetElementOrCharAt(Handle<Object> object, uint32_t index); | 508 MUST_USE_RESULT static MaybeObject* GetElementOrCharAt(Handle<Object> object, |
510 static Object* GetElement(Handle<Object> object, uint32_t index); | 509 uint32_t index); |
| 510 MUST_USE_RESULT static MaybeObject* GetElement(Handle<Object> object, |
| 511 uint32_t index); |
511 | 512 |
512 static Object* SetObjectProperty(Handle<Object> object, | 513 MUST_USE_RESULT static MaybeObject* SetObjectProperty( |
513 Handle<Object> key, | 514 Handle<Object> object, |
514 Handle<Object> value, | 515 Handle<Object> key, |
515 PropertyAttributes attr); | 516 Handle<Object> value, |
| 517 PropertyAttributes attr); |
516 | 518 |
517 static Object* ForceSetObjectProperty(Handle<JSObject> object, | 519 MUST_USE_RESULT static MaybeObject* ForceSetObjectProperty( |
518 Handle<Object> key, | 520 Handle<JSObject> object, |
519 Handle<Object> value, | 521 Handle<Object> key, |
520 PropertyAttributes attr); | 522 Handle<Object> value, |
| 523 PropertyAttributes attr); |
521 | 524 |
522 static Object* ForceDeleteObjectProperty(Handle<JSObject> object, | 525 MUST_USE_RESULT static MaybeObject* ForceDeleteObjectProperty( |
523 Handle<Object> key); | 526 Handle<JSObject> object, |
| 527 Handle<Object> key); |
524 | 528 |
525 static Object* GetObjectProperty(Handle<Object> object, Handle<Object> key); | 529 MUST_USE_RESULT static MaybeObject* GetObjectProperty(Handle<Object> object, |
| 530 Handle<Object> key); |
526 | 531 |
527 // This function is used in FunctionNameUsing* tests. | 532 // This function is used in FunctionNameUsing* tests. |
528 static Object* FindSharedFunctionInfoInScript(Handle<Script> script, | 533 static Object* FindSharedFunctionInfoInScript(Handle<Script> script, |
529 int position); | 534 int position); |
530 | 535 |
531 // Helper functions used stubs. | 536 // Helper functions used stubs. |
532 static void PerformGC(Object* result); | 537 static void PerformGC(Object* result); |
533 }; | 538 }; |
534 | 539 |
535 | 540 |
536 } } // namespace v8::internal | 541 } } // namespace v8::internal |
537 | 542 |
538 #endif // V8_RUNTIME_H_ | 543 #endif // V8_RUNTIME_H_ |
OLD | NEW |