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

Unified Diff: src/execution.cc

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, 2 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/execution.h ('k') | src/factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/execution.cc
===================================================================
--- src/execution.cc (revision 5696)
+++ src/execution.cc (working copy)
@@ -50,7 +50,7 @@
VMState state(JS);
// Placeholder for return value.
- Object* value = reinterpret_cast<Object*>(kZapValue);
+ MaybeObject* value = reinterpret_cast<Object*>(kZapValue);
typedef Object* (*JSEntryFunction)(
byte* entry,
@@ -109,7 +109,7 @@
Top::clear_pending_message();
}
- return Handle<Object>(value);
+ return Handle<Object>(value->ToObjectUnchecked());
}
@@ -172,7 +172,17 @@
// and Safari so we allow it too.
if (object->IsJSRegExp()) {
Handle<String> exec = Factory::exec_symbol();
- return Handle<Object>(object->GetProperty(*exec));
+ // TODO(lrn): Bug 617. We should use the default function here, not the
+ // one on the RegExp object.
+ Object* exec_function;
+ { MaybeObject* maybe_exec_function = object->GetProperty(*exec);
+ // This can lose an exception, but the alternative is to put a failure
+ // object in a handle, which is not GC safe.
+ if (!maybe_exec_function->ToObject(&exec_function)) {
+ return Factory::undefined_value();
+ }
+ }
+ return Handle<Object>(exec_function);
}
// Objects created through the API can have an instance-call handler
@@ -517,8 +527,8 @@
Handle<FunctionTemplateInfo> data, bool* exc) {
// Fast case: see if the function has already been instantiated
int serial_number = Smi::cast(data->serial_number())->value();
- Object* elm =
- Top::global_context()->function_cache()->GetElement(serial_number);
+ Object* elm = Top::global_context()->function_cache()->
+ GetElementNoExceptionThrown(serial_number);
if (elm->IsJSFunction()) return Handle<JSFunction>(JSFunction::cast(elm));
// The function has not yet been instantiated in this context; do it.
Object** args[1] = { Handle<Object>::cast(data).location() };
@@ -671,7 +681,7 @@
#endif
-Object* Execution::HandleStackGuardInterrupt() {
+MaybeObject* Execution::HandleStackGuardInterrupt() {
#ifdef ENABLE_DEBUGGER_SUPPORT
if (StackGuard::IsDebugBreak() || StackGuard::IsDebugCommand()) {
DebugBreakHelper();
« no previous file with comments | « src/execution.h ('k') | src/factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698