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

Unified Diff: src/execution.cc

Issue 3788008: [Isolates] Fix auto extraction of isolate from heap objects in handle constructor. (Closed)
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/debug.cc ('k') | src/handles.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/execution.cc
diff --git a/src/execution.cc b/src/execution.cc
index 318ae81010f6c64fd453d1b382462a328c57e967..99749bb9b77f630bd4402cc7d7c8c209ee2512b7 100644
--- a/src/execution.cc
+++ b/src/execution.cc
@@ -69,6 +69,8 @@ static Handle<Object> Invoke(bool construct,
int argc,
Object*** args,
bool* has_pending_exception) {
+ Isolate* isolate = func->GetIsolate();
+
// Entering JavaScript.
VMState state(JS);
@@ -106,7 +108,7 @@ static Handle<Object> Invoke(bool construct,
{
// Save and restore context around invocation and block the
// allocation of handles without explicit handle scopes.
- SaveContext save;
+ SaveContext save(isolate);
NoHandleAllocation na;
JSEntryFunction entry = FUNCTION_CAST<JSEntryFunction>(code->entry());
@@ -126,13 +128,13 @@ static Handle<Object> Invoke(bool construct,
*has_pending_exception = value->IsException();
ASSERT(*has_pending_exception == Isolate::Current()->has_pending_exception());
if (*has_pending_exception) {
- Isolate::Current()->ReportPendingMessages();
+ isolate->ReportPendingMessages();
return Handle<Object>();
} else {
- Isolate::Current()->clear_pending_message();
+ isolate->clear_pending_message();
}
- return Handle<Object>(value);
+ return Handle<Object>(value, isolate);
}
« no previous file with comments | « src/debug.cc ('k') | src/handles.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698