OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/deoptimizer.h" | 5 #include "src/deoptimizer.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/ast/prettyprinter.h" | 8 #include "src/ast/prettyprinter.h" |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/disasm.h" | 10 #include "src/disasm.h" |
(...skipping 3667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3678 // On 32-bit architectures, there is an extra slot there because | 3678 // On 32-bit architectures, there is an extra slot there because |
3679 // the escape analysis calculates the number of slots as | 3679 // the escape analysis calculates the number of slots as |
3680 // object-size/pointer-size. To account for this, we read out | 3680 // object-size/pointer-size. To account for this, we read out |
3681 // any extra slots. | 3681 // any extra slots. |
3682 for (int i = 0; i < length - 2; i++) { | 3682 for (int i = 0; i < length - 2; i++) { |
3683 MaterializeAt(frame_index, value_index); | 3683 MaterializeAt(frame_index, value_index); |
3684 } | 3684 } |
3685 return object; | 3685 return object; |
3686 } | 3686 } |
3687 case JS_OBJECT_TYPE: { | 3687 case JS_OBJECT_TYPE: { |
3688 Handle<JSObject> object = | 3688 Handle<JSObject> object = isolate_->factory()->NewJSObjectFromMap( |
3689 isolate_->factory()->NewJSObjectFromMap(map, NOT_TENURED); | 3689 map->has_sloppy_arguments_elements() |
| 3690 ? isolate()->sloppy_arguments_map() |
| 3691 : map, |
| 3692 NOT_TENURED); |
3690 slot->value_ = object; | 3693 slot->value_ = object; |
3691 Handle<Object> properties = MaterializeAt(frame_index, value_index); | 3694 Handle<Object> properties = MaterializeAt(frame_index, value_index); |
3692 Handle<Object> elements = MaterializeAt(frame_index, value_index); | 3695 Handle<Object> elements = MaterializeAt(frame_index, value_index); |
| 3696 object->set_map(*map); // Correct elements kind for sloppy arguments. |
3693 object->set_properties(FixedArray::cast(*properties)); | 3697 object->set_properties(FixedArray::cast(*properties)); |
3694 object->set_elements(FixedArrayBase::cast(*elements)); | 3698 object->set_elements(FixedArrayBase::cast(*elements)); |
3695 for (int i = 0; i < length - 3; ++i) { | 3699 for (int i = 0; i < length - 3; ++i) { |
3696 Handle<Object> value = MaterializeAt(frame_index, value_index); | 3700 Handle<Object> value = MaterializeAt(frame_index, value_index); |
3697 FieldIndex index = FieldIndex::ForPropertyIndex(object->map(), i); | 3701 FieldIndex index = FieldIndex::ForPropertyIndex(object->map(), i); |
3698 object->FastPropertyAtPut(index, *value); | 3702 object->FastPropertyAtPut(index, *value); |
3699 } | 3703 } |
3700 return object; | 3704 return object; |
3701 } | 3705 } |
3702 case JS_ARRAY_TYPE: { | 3706 case JS_ARRAY_TYPE: { |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3962 CHECK(value_info->IsMaterializedObject()); | 3966 CHECK(value_info->IsMaterializedObject()); |
3963 | 3967 |
3964 value_info->value_ = | 3968 value_info->value_ = |
3965 Handle<Object>(previously_materialized_objects->get(i), isolate_); | 3969 Handle<Object>(previously_materialized_objects->get(i), isolate_); |
3966 } | 3970 } |
3967 } | 3971 } |
3968 } | 3972 } |
3969 | 3973 |
3970 } // namespace internal | 3974 } // namespace internal |
3971 } // namespace v8 | 3975 } // namespace v8 |
OLD | NEW |