Fix double-boxing issue when materializing captured objects.
authormstarzinger@chromium.org <mstarzinger@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 5 Nov 2013 09:32:39 +0000 (09:32 +0000)
committermstarzinger@chromium.org <mstarzinger@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 5 Nov 2013 09:32:39 +0000 (09:32 +0000)
R=verwaest@chromium.org
TEST=mjsunit/compiler/escape-analysis-representation

Review URL: https://codereview.chromium.org/57783003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17468 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/deoptimizer.cc

index 84e80b9..96871d6 100644 (file)
@@ -1620,10 +1620,10 @@ Handle<Object> Deoptimizer::MaterializeNextHeapObject() {
         Handle<Map>::cast(MaterializeNextValue()), Representation::Tagged());
     switch (map->instance_type()) {
       case HEAP_NUMBER_TYPE: {
-        Handle<HeapNumber> object = isolate_->factory()->NewHeapNumber(0.0);
+        // Reuse the HeapNumber value directly as it is already properly
+        // tagged and skip materializing the HeapNumber explicitly.
+        Handle<Object> object = MaterializeNextValue();
         materialized_objects_->Add(object);
-        Handle<Object> number = MaterializeNextValue();
-        object->set_value(number->Number());
         materialization_value_index_ += kDoubleSize / kPointerSize - 1;
         break;
       }