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 1808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1819 materialized_objects_->Add(arguments); | 1819 materialized_objects_->Add(arguments); |
1820 for (int i = 0; i < length; ++i) { | 1820 for (int i = 0; i < length; ++i) { |
1821 Handle<Object> value = MaterializeNextValue(); | 1821 Handle<Object> value = MaterializeNextValue(); |
1822 array->set(i, *value); | 1822 array->set(i, *value); |
1823 } | 1823 } |
1824 } else { | 1824 } else { |
1825 // Dispatch on the instance type of the object to be materialized. | 1825 // Dispatch on the instance type of the object to be materialized. |
1826 // We also need to make sure that the representation of all fields | 1826 // We also need to make sure that the representation of all fields |
1827 // in the given object are general enough to hold a tagged value. | 1827 // in the given object are general enough to hold a tagged value. |
1828 Handle<Map> map = Map::GeneralizeAllFieldRepresentations( | 1828 Handle<Map> map = Map::GeneralizeAllFieldRepresentations( |
1829 Handle<Map>::cast(MaterializeNextValue()), Representation::Tagged()); | 1829 Handle<Map>::cast(MaterializeNextValue())); |
1830 switch (map->instance_type()) { | 1830 switch (map->instance_type()) { |
1831 case HEAP_NUMBER_TYPE: { | 1831 case HEAP_NUMBER_TYPE: { |
1832 // Reuse the HeapNumber value directly as it is already properly | 1832 // Reuse the HeapNumber value directly as it is already properly |
1833 // tagged and skip materializing the HeapNumber explicitly. | 1833 // tagged and skip materializing the HeapNumber explicitly. |
1834 Handle<Object> object = MaterializeNextValue(); | 1834 Handle<Object> object = MaterializeNextValue(); |
1835 if (object_index < prev_materialized_count_) { | 1835 if (object_index < prev_materialized_count_) { |
1836 materialized_objects_->Add(Handle<Object>( | 1836 materialized_objects_->Add(Handle<Object>( |
1837 previously_materialized_objects_->get(object_index), isolate_)); | 1837 previously_materialized_objects_->get(object_index), isolate_)); |
1838 } else { | 1838 } else { |
1839 materialized_objects_->Add(object); | 1839 materialized_objects_->Add(object); |
(...skipping 1480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3320 ASSERT(slot_refs_[current_slot_].Representation() == SlotRef::LITERAL || | 3320 ASSERT(slot_refs_[current_slot_].Representation() == SlotRef::LITERAL || |
3321 slot_refs_[current_slot_].Representation() == SlotRef::TAGGED); | 3321 slot_refs_[current_slot_].Representation() == SlotRef::TAGGED); |
3322 | 3322 |
3323 int object_index = materialized_objects_.length(); | 3323 int object_index = materialized_objects_.length(); |
3324 if (object_index < prev_materialized_count_) { | 3324 if (object_index < prev_materialized_count_) { |
3325 return GetPreviouslyMaterialized(isolate, length); | 3325 return GetPreviouslyMaterialized(isolate, length); |
3326 } | 3326 } |
3327 | 3327 |
3328 Handle<Object> map_object = slot_refs_[current_slot_].GetValue(isolate); | 3328 Handle<Object> map_object = slot_refs_[current_slot_].GetValue(isolate); |
3329 Handle<Map> map = Map::GeneralizeAllFieldRepresentations( | 3329 Handle<Map> map = Map::GeneralizeAllFieldRepresentations( |
3330 Handle<Map>::cast(map_object), Representation::Tagged()); | 3330 Handle<Map>::cast(map_object)); |
3331 current_slot_++; | 3331 current_slot_++; |
3332 // TODO(jarin) this should be unified with the code in | 3332 // TODO(jarin) this should be unified with the code in |
3333 // Deoptimizer::MaterializeNextHeapObject() | 3333 // Deoptimizer::MaterializeNextHeapObject() |
3334 switch (map->instance_type()) { | 3334 switch (map->instance_type()) { |
3335 case HEAP_NUMBER_TYPE: { | 3335 case HEAP_NUMBER_TYPE: { |
3336 // Reuse the HeapNumber value directly as it is already properly | 3336 // Reuse the HeapNumber value directly as it is already properly |
3337 // tagged and skip materializing the HeapNumber explicitly. | 3337 // tagged and skip materializing the HeapNumber explicitly. |
3338 Handle<Object> object = GetNext(isolate, lvl + 1); | 3338 Handle<Object> object = GetNext(isolate, lvl + 1); |
3339 materialized_objects_.Add(object); | 3339 materialized_objects_.Add(object); |
3340 // On 32-bit architectures, there is an extra slot there because | 3340 // On 32-bit architectures, there is an extra slot there because |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3532 | 3532 |
3533 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { | 3533 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { |
3534 v->VisitPointer(BitCast<Object**>(&function_)); | 3534 v->VisitPointer(BitCast<Object**>(&function_)); |
3535 v->VisitPointers(parameters_, parameters_ + parameters_count_); | 3535 v->VisitPointers(parameters_, parameters_ + parameters_count_); |
3536 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); | 3536 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); |
3537 } | 3537 } |
3538 | 3538 |
3539 #endif // ENABLE_DEBUGGER_SUPPORT | 3539 #endif // ENABLE_DEBUGGER_SUPPORT |
3540 | 3540 |
3541 } } // namespace v8::internal | 3541 } } // namespace v8::internal |
OLD | NEW |