Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Side by Side Diff: src/runtime.h

Issue 3970005: Make Failure inherit from MaybeObject instead of Object. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/property.h ('k') | src/runtime.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 // Size of result. Most functions return a single pointer, size 1. 479 // Size of result. Most functions return a single pointer, size 1.
480 int result_size; 480 int result_size;
481 }; 481 };
482 482
483 static const int kNotFound = -1; 483 static const int kNotFound = -1;
484 484
485 // Add symbols for all the intrinsic function names to a StringDictionary. 485 // Add symbols for all the intrinsic function names to a StringDictionary.
486 // 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
487 // retried with a new, empty StringDictionary, not with the same one. 487 // retried with a new, empty StringDictionary, not with the same one.
488 // Alternatively, heap initialization can be completely restarted. 488 // Alternatively, heap initialization can be completely restarted.
489 static Object* InitializeIntrinsicFunctionNames(Object* dictionary); 489 MUST_USE_RESULT static MaybeObject* InitializeIntrinsicFunctionNames(
490 Object* dictionary);
490 491
491 // 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.
492 static Function* FunctionForSymbol(Handle<String> name); 493 static Function* FunctionForSymbol(Handle<String> name);
493 494
494 // Get the intrinsic function with the given FunctionId. 495 // Get the intrinsic function with the given FunctionId.
495 static Function* FunctionForId(FunctionId id); 496 static Function* FunctionForId(FunctionId id);
496 497
497 // General-purpose helper functions for runtime system. 498 // General-purpose helper functions for runtime system.
498 static int StringMatch(Handle<String> sub, Handle<String> pat, int index); 499 static int StringMatch(Handle<String> sub, Handle<String> pat, int index);
499 500
500 static bool IsUpperCaseChar(uint16_t ch); 501 static bool IsUpperCaseChar(uint16_t ch);
501 502
502 // TODO(1240886): The following three methods are *not* handle safe, 503 // TODO(1240886): The following three methods are *not* handle safe,
503 // but accept handle arguments. This seems fragile. 504 // but accept handle arguments. This seems fragile.
504 505
505 // Support getting the characters in a string using [] notation as 506 // Support getting the characters in a string using [] notation as
506 // in Firefox/SpiderMonkey, Safari and Opera. 507 // in Firefox/SpiderMonkey, Safari and Opera.
507 static Object* GetElementOrCharAt(Handle<Object> object, uint32_t index); 508 MUST_USE_RESULT static MaybeObject* GetElementOrCharAt(Handle<Object> object,
508 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);
509 512
510 static Object* SetObjectProperty(Handle<Object> object, 513 MUST_USE_RESULT static MaybeObject* SetObjectProperty(
511 Handle<Object> key, 514 Handle<Object> object,
512 Handle<Object> value, 515 Handle<Object> key,
513 PropertyAttributes attr); 516 Handle<Object> value,
517 PropertyAttributes attr);
514 518
515 static Object* ForceSetObjectProperty(Handle<JSObject> object, 519 MUST_USE_RESULT static MaybeObject* ForceSetObjectProperty(
516 Handle<Object> key, 520 Handle<JSObject> object,
517 Handle<Object> value, 521 Handle<Object> key,
518 PropertyAttributes attr); 522 Handle<Object> value,
523 PropertyAttributes attr);
519 524
520 static Object* ForceDeleteObjectProperty(Handle<JSObject> object, 525 MUST_USE_RESULT static MaybeObject* ForceDeleteObjectProperty(
521 Handle<Object> key); 526 Handle<JSObject> object,
527 Handle<Object> key);
522 528
523 static Object* GetObjectProperty(Handle<Object> object, Handle<Object> key); 529 MUST_USE_RESULT static MaybeObject* GetObjectProperty(Handle<Object> object,
530 Handle<Object> key);
524 531
525 // This function is used in FunctionNameUsing* tests. 532 // This function is used in FunctionNameUsing* tests.
526 static Object* FindSharedFunctionInfoInScript(Handle<Script> script, 533 static Object* FindSharedFunctionInfoInScript(Handle<Script> script,
527 int position); 534 int position);
528 535
529 // Helper functions used stubs. 536 // Helper functions used stubs.
530 static void PerformGC(Object* result); 537 static void PerformGC(Object* result);
531 }; 538 };
532 539
533 540
534 } } // namespace v8::internal 541 } } // namespace v8::internal
535 542
536 #endif // V8_RUNTIME_H_ 543 #endif // V8_RUNTIME_H_
OLDNEW
« no previous file with comments | « src/property.h ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698