Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(490)

Side by Side Diff: src/deoptimizer.cc

Issue 2014343004: [runtime] Allow generic allocation of sloppy arguments. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/heap/heap.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 = isolate_->factory()->NewJSObjectFromMap( 3688 Handle<JSObject> object =
3689 map->has_sloppy_arguments_elements() 3689 isolate_->factory()->NewJSObjectFromMap(map, NOT_TENURED);
3690 ? isolate()->sloppy_arguments_map()
3691 : map,
3692 NOT_TENURED);
3693 slot->value_ = object; 3690 slot->value_ = object;
3694 Handle<Object> properties = MaterializeAt(frame_index, value_index); 3691 Handle<Object> properties = MaterializeAt(frame_index, value_index);
3695 Handle<Object> elements = MaterializeAt(frame_index, value_index); 3692 Handle<Object> elements = MaterializeAt(frame_index, value_index);
3696 object->set_map(*map); // Correct elements kind for sloppy arguments.
3697 object->set_properties(FixedArray::cast(*properties)); 3693 object->set_properties(FixedArray::cast(*properties));
3698 object->set_elements(FixedArrayBase::cast(*elements)); 3694 object->set_elements(FixedArrayBase::cast(*elements));
3699 for (int i = 0; i < length - 3; ++i) { 3695 for (int i = 0; i < length - 3; ++i) {
3700 Handle<Object> value = MaterializeAt(frame_index, value_index); 3696 Handle<Object> value = MaterializeAt(frame_index, value_index);
3701 FieldIndex index = FieldIndex::ForPropertyIndex(object->map(), i); 3697 FieldIndex index = FieldIndex::ForPropertyIndex(object->map(), i);
3702 object->FastPropertyAtPut(index, *value); 3698 object->FastPropertyAtPut(index, *value);
3703 } 3699 }
3704 return object; 3700 return object;
3705 } 3701 }
3706 case JS_ARRAY_TYPE: { 3702 case JS_ARRAY_TYPE: {
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
3966 CHECK(value_info->IsMaterializedObject()); 3962 CHECK(value_info->IsMaterializedObject());
3967 3963
3968 value_info->value_ = 3964 value_info->value_ =
3969 Handle<Object>(previously_materialized_objects->get(i), isolate_); 3965 Handle<Object>(previously_materialized_objects->get(i), isolate_);
3970 } 3966 }
3971 } 3967 }
3972 } 3968 }
3973 3969
3974 } // namespace internal 3970 } // namespace internal
3975 } // namespace v8 3971 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/heap/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698