| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 1602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1613 array->set(i, *value); | 1613 array->set(i, *value); |
| 1614 } | 1614 } |
| 1615 } else { | 1615 } else { |
| 1616 // Dispatch on the instance type of the object to be materialized. | 1616 // Dispatch on the instance type of the object to be materialized. |
| 1617 // We also need to make sure that the representation of all fields | 1617 // We also need to make sure that the representation of all fields |
| 1618 // in the given object are general enough to hold a tagged value. | 1618 // in the given object are general enough to hold a tagged value. |
| 1619 Handle<Map> map = Map::GeneralizeAllFieldRepresentations( | 1619 Handle<Map> map = Map::GeneralizeAllFieldRepresentations( |
| 1620 Handle<Map>::cast(MaterializeNextValue()), Representation::Tagged()); | 1620 Handle<Map>::cast(MaterializeNextValue()), Representation::Tagged()); |
| 1621 switch (map->instance_type()) { | 1621 switch (map->instance_type()) { |
| 1622 case HEAP_NUMBER_TYPE: { | 1622 case HEAP_NUMBER_TYPE: { |
| 1623 Handle<HeapNumber> object = isolate_->factory()->NewHeapNumber(0.0); | 1623 // Reuse the HeapNumber value directly as it is already properly |
| 1624 // tagged and skip materializing the HeapNumber explicitly. |
| 1625 Handle<Object> object = MaterializeNextValue(); |
| 1624 materialized_objects_->Add(object); | 1626 materialized_objects_->Add(object); |
| 1625 Handle<Object> number = MaterializeNextValue(); | |
| 1626 object->set_value(number->Number()); | |
| 1627 materialization_value_index_ += kDoubleSize / kPointerSize - 1; | 1627 materialization_value_index_ += kDoubleSize / kPointerSize - 1; |
| 1628 break; | 1628 break; |
| 1629 } | 1629 } |
| 1630 case JS_OBJECT_TYPE: { | 1630 case JS_OBJECT_TYPE: { |
| 1631 Handle<JSObject> object = | 1631 Handle<JSObject> object = |
| 1632 isolate_->factory()->NewJSObjectFromMap(map, NOT_TENURED, false); | 1632 isolate_->factory()->NewJSObjectFromMap(map, NOT_TENURED, false); |
| 1633 materialized_objects_->Add(object); | 1633 materialized_objects_->Add(object); |
| 1634 Handle<Object> properties = MaterializeNextValue(); | 1634 Handle<Object> properties = MaterializeNextValue(); |
| 1635 Handle<Object> elements = MaterializeNextValue(); | 1635 Handle<Object> elements = MaterializeNextValue(); |
| 1636 object->set_properties(FixedArray::cast(*properties)); | 1636 object->set_properties(FixedArray::cast(*properties)); |
| (...skipping 1311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2948 | 2948 |
| 2949 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { | 2949 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { |
| 2950 v->VisitPointer(BitCast<Object**>(&function_)); | 2950 v->VisitPointer(BitCast<Object**>(&function_)); |
| 2951 v->VisitPointers(parameters_, parameters_ + parameters_count_); | 2951 v->VisitPointers(parameters_, parameters_ + parameters_count_); |
| 2952 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); | 2952 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); |
| 2953 } | 2953 } |
| 2954 | 2954 |
| 2955 #endif // ENABLE_DEBUGGER_SUPPORT | 2955 #endif // ENABLE_DEBUGGER_SUPPORT |
| 2956 | 2956 |
| 2957 } } // namespace v8::internal | 2957 } } // namespace v8::internal |
| OLD | NEW |