Revision: 16306
Author:   [email protected]
Date:     Fri Aug 23 16:31:31 2013 UTC
Log: Fix dependency of loading the heap-number for a double-field store to be the mapcheck.

[email protected]

Review URL: https://chromiumcodereview.appspot.com/22926027
http://code.google.com/p/v8/source/detail?r=16306

Modified:
 /branches/bleeding_edge/src/hydrogen-escape-analysis.cc
 /branches/bleeding_edge/src/hydrogen-instructions.h
 /branches/bleeding_edge/src/hydrogen.cc

=======================================
--- /branches/bleeding_edge/src/hydrogen-escape-analysis.cc Wed Aug 21 14:49:56 2013 UTC +++ /branches/bleeding_edge/src/hydrogen-escape-analysis.cc Fri Aug 23 16:31:31 2013 UTC
@@ -212,14 +212,8 @@
           if (mapcheck->value() != allocate) continue;
// TODO(mstarzinger): This approach breaks if the tracked map value
           // is not a HConstant. Find a repro test case and fix this.
- for (HUseIterator it(mapcheck->uses()); !it.Done(); it.Advance()) {
-            if (!it.value()->IsLoadNamedField()) continue;
-            HLoadNamedField* load = HLoadNamedField::cast(it.value());
-            load->ClearTypeCheck();
-          }
-          ASSERT(mapcheck->HasNoUses());
-
-          mapcheck->DeleteAndReplaceWith(NULL);
+          ASSERT(mapcheck->ActualValue() == allocate);
+          mapcheck->DeleteAndReplaceWith(mapcheck->ActualValue());
           break;
         }
         default:
=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.h Thu Aug 22 16:14:37 2013 UTC +++ /branches/bleeding_edge/src/hydrogen-instructions.h Fri Aug 23 16:31:31 2013 UTC
@@ -5599,7 +5599,6 @@

   HValue* object() { return OperandAt(0); }
   bool HasTypeCheck() { return object()->IsCheckMaps(); }
-  void ClearTypeCheck() { SetOperandAt(0, object()->ActualValue()); }
   HObjectAccess access() const { return access_; }
   Representation field_representation() const {
       return access_.representation();
=======================================
--- /branches/bleeding_edge/src/hydrogen.cc     Fri Aug 23 08:11:12 2013 UTC
+++ /branches/bleeding_edge/src/hydrogen.cc     Fri Aug 23 16:31:31 2013 UTC
@@ -4443,7 +4443,7 @@


 HInstruction* HOptimizedGraphBuilder::BuildStoreNamedField(
-    HValue* object,
+    HValue* checked_object,
     Handle<String> name,
     HValue* value,
     Handle<Map> map,
@@ -4495,11 +4495,12 @@
AddStoreMapConstant(heap_number, isolate()->factory()->heap_number_map()); Add<HStoreNamedField>(heap_number, HObjectAccess::ForHeapNumberValue(),
                             value);
-      instr = New<HStoreNamedField>(object, heap_number_access,
-                                           heap_number);
+      instr = New<HStoreNamedField>(checked_object,
+                                    heap_number_access,
+                                    heap_number);
     } else {
// Already holds a HeapNumber; load the box and write its value field.
-      HInstruction* heap_number = Add<HLoadNamedField>(object,
+      HInstruction* heap_number = Add<HLoadNamedField>(checked_object,
                                                        heap_number_access);
       heap_number->set_type(HType::HeapNumber());
       instr = New<HStoreNamedField>(heap_number,
@@ -4508,7 +4509,7 @@
     }
   } else {
     // This is a normal store.
-    instr = New<HStoreNamedField>(object, field_access, value);
+    instr = New<HStoreNamedField>(checked_object, field_access, value);
   }

   if (transition_to_field) {
@@ -4545,8 +4546,8 @@
   // Handle a store to a known field.
   LookupResult lookup(isolate());
   if (ComputeLoadStoreField(map, name, &lookup, true)) {
-    AddCheckMap(object, map);
-    return BuildStoreNamedField(object, name, value, map, &lookup);
+    HCheckMaps* checked_object = AddCheckMap(object, map);
+    return BuildStoreNamedField(checked_object, name, value, map, &lookup);
   }

   // No luck, do a generic store.
@@ -4808,11 +4809,11 @@

   // Everything matched; can use monomorphic store.
   BuildCheckHeapObject(object);
-  Add<HCheckMaps>(object, types);
+  HCheckMaps* checked_object = Add<HCheckMaps>(object, types);
   HInstruction* store;
   CHECK_ALIVE_OR_RETURN(
       store = BuildStoreNamedField(
-          object, name, store_value, types->at(count - 1), &lookup),
+ checked_object, name, store_value, types->at(count - 1), &lookup),
       true);
   if (!ast_context()->IsEffect()) Push(result_value);
   store->set_position(position);
@@ -4861,7 +4862,7 @@
       set_current_block(if_true);
       HInstruction* instr;
       CHECK_ALIVE(instr = BuildStoreNamedField(
-          object, name, store_value, map, &lookup));
+          compare, name, store_value, map, &lookup));
       instr->set_position(position);
       // Goto will add the HSimulate for the store.
       AddInstruction(instr);

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to