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

Unified Diff: src/hydrogen.cc

Issue 711313002: Reland "In-object double fields unboxing (for 64-bit only)." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: The fix 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/heap/store-buffer.cc ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 6184bb9e46b25c6a22015b216a3e60046a537f2d..3386e60cb08cfcedf1a0cc2f4f1cd07bfa0963a8 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -5533,9 +5533,11 @@ static bool IsFastLiteral(Handle<JSObject> boilerplate,
for (int i = 0; i < limit; i++) {
PropertyDetails details = descriptors->GetDetails(i);
if (details.type() != FIELD) continue;
- int index = descriptors->GetFieldIndex(i);
if ((*max_properties)-- == 0) return false;
- Handle<Object> value(boilerplate->InObjectPropertyAt(index), isolate);
+ FieldIndex field_index = FieldIndex::ForDescriptor(boilerplate->map(), i);
+ if (boilerplate->IsUnboxedDoubleField(field_index)) continue;
+ Handle<Object> value(boilerplate->RawFastPropertyAt(field_index),
+ isolate);
if (value->IsJSObject()) {
Handle<JSObject> value_object = Handle<JSObject>::cast(value);
if (!IsFastLiteral(value_object,
@@ -5838,7 +5840,8 @@ HInstruction* HOptimizedGraphBuilder::BuildLoadNamedField(
}
HObjectAccess access = info->access();
- if (access.representation().IsDouble()) {
+ if (access.representation().IsDouble() &&
+ (!FLAG_unbox_double_fields || !access.IsInobject())) {
// Load the heap number.
checked_object = Add<HLoadNamedField>(
checked_object, static_cast<HValue*>(NULL),
@@ -5870,7 +5873,8 @@ HInstruction* HOptimizedGraphBuilder::BuildStoreNamedField(
HObjectAccess field_access = info->access();
HStoreNamedField *instr;
- if (field_access.representation().IsDouble()) {
+ if (field_access.representation().IsDouble() &&
+ (!FLAG_unbox_double_fields || !field_access.IsInobject())) {
HObjectAccess heap_number_access =
field_access.WithRepresentation(Representation::Tagged());
if (transition_to_field) {
@@ -11186,18 +11190,27 @@ void HOptimizedGraphBuilder::BuildEmitInObjectProperties(
PropertyDetails details = descriptors->GetDetails(i);
if (details.type() != FIELD) continue;
copied_fields++;
- int index = descriptors->GetFieldIndex(i);
- int property_offset = boilerplate_object->GetInObjectPropertyOffset(index);
+ FieldIndex field_index = FieldIndex::ForDescriptor(*boilerplate_map, i);
+
+
+ int property_offset = field_index.offset();
Handle<Name> name(descriptors->GetKey(i));
- Handle<Object> value =
- Handle<Object>(boilerplate_object->InObjectPropertyAt(index),
- isolate());
// The access for the store depends on the type of the boilerplate.
HObjectAccess access = boilerplate_object->IsJSArray() ?
HObjectAccess::ForJSArrayOffset(property_offset) :
HObjectAccess::ForMapAndOffset(boilerplate_map, property_offset);
+ if (boilerplate_object->IsUnboxedDoubleField(field_index)) {
+ CHECK(!boilerplate_object->IsJSArray());
+ double value = boilerplate_object->RawFastDoublePropertyAt(field_index);
+ access = access.WithRepresentation(Representation::Double());
+ Add<HStoreNamedField>(object, access, Add<HConstant>(value));
+ continue;
+ }
+ Handle<Object> value(boilerplate_object->RawFastPropertyAt(field_index),
+ isolate());
+
if (value->IsJSObject()) {
Handle<JSObject> value_object = Handle<JSObject>::cast(value);
Handle<AllocationSite> current_site = site_context->EnterNewScope();
« no previous file with comments | « src/heap/store-buffer.cc ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698