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

Unified Diff: src/runtime.cc

Issue 3031005: [Isolates] Avoid dereferencing Isolate::Current() to check oddball identities... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
Patch Set: '' Created 10 years, 4 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/prettyprinter.cc ('k') | src/string-stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
===================================================================
--- src/runtime.cc (revision 5190)
+++ src/runtime.cc (working copy)
@@ -397,9 +397,11 @@
CONVERT_SMI_CHECKED(fast_elements, args[3]);
bool should_have_fast_elements = fast_elements == 1;
+ Heap* heap = Isolate::Current()->heap();
+
// Check if boilerplate exists. If not, create it first.
Handle<Object> boilerplate(literals->get(literals_index));
- if (*boilerplate == HEAP->undefined_value()) {
+ if (*boilerplate == heap->undefined_value()) {
boilerplate = CreateObjectLiteralBoilerplate(literals,
constant_properties,
should_have_fast_elements);
@@ -407,7 +409,7 @@
// Update the functions literal and return the boilerplate.
literals->set(literals_index, *boilerplate);
}
- return DeepCopyBoilerplate(HEAP, JSObject::cast(*boilerplate));
+ return DeepCopyBoilerplate(heap, JSObject::cast(*boilerplate));
}
@@ -420,9 +422,11 @@
CONVERT_SMI_CHECKED(fast_elements, args[3]);
bool should_have_fast_elements = fast_elements == 1;
+ Heap* heap = Isolate::Current()->heap();
+
// Check if boilerplate exists. If not, create it first.
Handle<Object> boilerplate(literals->get(literals_index));
- if (*boilerplate == HEAP->undefined_value()) {
+ if (*boilerplate == heap->undefined_value()) {
boilerplate = CreateObjectLiteralBoilerplate(literals,
constant_properties,
should_have_fast_elements);
@@ -430,7 +434,7 @@
// Update the functions literal and return the boilerplate.
literals->set(literals_index, *boilerplate);
}
- return HEAP->CopyJSObject(JSObject::cast(*boilerplate));
+ return heap->CopyJSObject(JSObject::cast(*boilerplate));
}
@@ -441,15 +445,17 @@
CONVERT_SMI_CHECKED(literals_index, args[1]);
CONVERT_ARG_CHECKED(FixedArray, elements, 2);
+ Heap* heap = Isolate::Current()->heap();
+
// Check if boilerplate exists. If not, create it first.
Handle<Object> boilerplate(literals->get(literals_index));
- if (*boilerplate == HEAP->undefined_value()) {
+ if (*boilerplate == heap->undefined_value()) {
boilerplate = CreateArrayLiteralBoilerplate(literals, elements);
if (boilerplate.is_null()) return Failure::Exception();
// Update the functions literal and return the boilerplate.
literals->set(literals_index, *boilerplate);
}
- return DeepCopyBoilerplate(HEAP, JSObject::cast(*boilerplate));
+ return DeepCopyBoilerplate(heap, JSObject::cast(*boilerplate));
}
@@ -460,15 +466,17 @@
CONVERT_SMI_CHECKED(literals_index, args[1]);
CONVERT_ARG_CHECKED(FixedArray, elements, 2);
+ Heap* heap = Isolate::Current()->heap();
+
// Check if boilerplate exists. If not, create it first.
Handle<Object> boilerplate(literals->get(literals_index));
- if (*boilerplate == HEAP->undefined_value()) {
+ if (*boilerplate == heap->undefined_value()) {
boilerplate = CreateArrayLiteralBoilerplate(literals, elements);
if (boilerplate.is_null()) return Failure::Exception();
// Update the functions literal and return the boilerplate.
literals->set(literals_index, *boilerplate);
}
- return HEAP->CopyJSObject(JSObject::cast(*boilerplate));
+ return heap->CopyJSObject(JSObject::cast(*boilerplate));
}
« no previous file with comments | « src/prettyprinter.cc ('k') | src/string-stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698