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

Unified Diff: src/code-stubs-hydrogen.cc

Issue 391693002: In-object double fields unboxing (for 64-bit only). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebasing Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/bootstrapper.cc ('k') | src/field-index.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs-hydrogen.cc
diff --git a/src/code-stubs-hydrogen.cc b/src/code-stubs-hydrogen.cc
index dc527d7d70ca7f2812c65a9cacc6337e0b2dfda8..45d1417b0de1d5b2e50c0d9b64eb3af0454bb695 100644
--- a/src/code-stubs-hydrogen.cc
+++ b/src/code-stubs-hydrogen.cc
@@ -538,7 +538,8 @@ HLoadNamedField* CodeStubGraphBuilderBase::BuildLoadNamedField(
HObjectAccess access = index.is_inobject()
? HObjectAccess::ForObservableJSObjectOffset(offset, representation)
: HObjectAccess::ForBackingStoreOffset(offset, representation);
- if (index.is_double()) {
+ if (index.is_double() &&
+ (!FLAG_unbox_double_fields || !index.is_inobject())) {
// Load the heap number.
object = Add<HLoadNamedField>(
object, static_cast<HValue*>(NULL),
@@ -705,30 +706,32 @@ void CodeStubGraphBuilderBase::BuildStoreNamedField(
: HObjectAccess::ForBackingStoreOffset(offset, representation);
if (representation.IsDouble()) {
- HObjectAccess heap_number_access =
- access.WithRepresentation(Representation::Tagged());
- if (transition_to_field) {
- // The store requires a mutable HeapNumber to be allocated.
- NoObservableSideEffectsScope no_side_effects(this);
- HInstruction* heap_number_size = Add<HConstant>(HeapNumber::kSize);
-
- // TODO(hpayer): Allocation site pretenuring support.
- HInstruction* heap_number =
- Add<HAllocate>(heap_number_size, HType::HeapObject(), NOT_TENURED,
- MUTABLE_HEAP_NUMBER_TYPE);
- AddStoreMapConstant(heap_number,
- isolate()->factory()->mutable_heap_number_map());
- Add<HStoreNamedField>(heap_number, HObjectAccess::ForHeapNumberValue(),
- value);
- // Store the new mutable heap number into the object.
- access = heap_number_access;
- value = heap_number;
- } else {
- // Load the heap number.
- object = Add<HLoadNamedField>(object, static_cast<HValue*>(NULL),
- heap_number_access);
- // Store the double value into it.
- access = HObjectAccess::ForHeapNumberValue();
+ if (!FLAG_unbox_double_fields || !index.is_inobject()) {
+ HObjectAccess heap_number_access =
+ access.WithRepresentation(Representation::Tagged());
+ if (transition_to_field) {
+ // The store requires a mutable HeapNumber to be allocated.
+ NoObservableSideEffectsScope no_side_effects(this);
+ HInstruction* heap_number_size = Add<HConstant>(HeapNumber::kSize);
+
+ // TODO(hpayer): Allocation site pretenuring support.
+ HInstruction* heap_number =
+ Add<HAllocate>(heap_number_size, HType::HeapObject(), NOT_TENURED,
+ MUTABLE_HEAP_NUMBER_TYPE);
+ AddStoreMapConstant(heap_number,
+ isolate()->factory()->mutable_heap_number_map());
+ Add<HStoreNamedField>(heap_number, HObjectAccess::ForHeapNumberValue(),
+ value);
+ // Store the new mutable heap number into the object.
+ access = heap_number_access;
+ value = heap_number;
+ } else {
+ // Load the heap number.
+ object = Add<HLoadNamedField>(object, static_cast<HValue*>(NULL),
+ heap_number_access);
+ // Store the double value into it.
+ access = HObjectAccess::ForHeapNumberValue();
+ }
}
} else if (representation.IsHeapObject()) {
BuildCheckHeapObject(value);
« no previous file with comments | « src/bootstrapper.cc ('k') | src/field-index.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698