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

Side by Side Diff: src/deoptimizer.cc

Issue 300283002: Introduce FieldIndex to unify and abstract property/field offset (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix mutable boxed double runtime function Created 6 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 | Annotate | Revision Log
« no previous file with comments | « src/code-stubs-hydrogen.cc ('k') | src/field-index.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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/codegen.h" 8 #include "src/codegen.h"
9 #include "src/deoptimizer.h" 9 #include "src/deoptimizer.h"
10 #include "src/disasm.h" 10 #include "src/disasm.h"
(...skipping 1823 matching lines...) Expand 10 before | Expand all | Expand 10 after
1834 previously_materialized_objects_->get(object_index), isolate_)); 1834 previously_materialized_objects_->get(object_index), isolate_));
1835 } else { 1835 } else {
1836 materialized_objects_->Add(object); 1836 materialized_objects_->Add(object);
1837 } 1837 }
1838 Handle<Object> properties = MaterializeNextValue(); 1838 Handle<Object> properties = MaterializeNextValue();
1839 Handle<Object> elements = MaterializeNextValue(); 1839 Handle<Object> elements = MaterializeNextValue();
1840 object->set_properties(FixedArray::cast(*properties)); 1840 object->set_properties(FixedArray::cast(*properties));
1841 object->set_elements(FixedArrayBase::cast(*elements)); 1841 object->set_elements(FixedArrayBase::cast(*elements));
1842 for (int i = 0; i < length - 3; ++i) { 1842 for (int i = 0; i < length - 3; ++i) {
1843 Handle<Object> value = MaterializeNextValue(); 1843 Handle<Object> value = MaterializeNextValue();
1844 object->FastPropertyAtPut(i, *value); 1844 FieldIndex index = FieldIndex::ForPropertyIndex(object->map(), i);
1845 object->FastPropertyAtPut(index, *value);
1845 } 1846 }
1846 break; 1847 break;
1847 } 1848 }
1848 case JS_ARRAY_TYPE: { 1849 case JS_ARRAY_TYPE: {
1849 Handle<JSArray> object = 1850 Handle<JSArray> object =
1850 isolate_->factory()->NewJSArray(0, map->elements_kind()); 1851 isolate_->factory()->NewJSArray(0, map->elements_kind());
1851 if (object_index < prev_materialized_count_) { 1852 if (object_index < prev_materialized_count_) {
1852 materialized_objects_->Add(Handle<Object>( 1853 materialized_objects_->Add(Handle<Object>(
1853 previously_materialized_objects_->get(object_index), isolate_)); 1854 previously_materialized_objects_->get(object_index), isolate_));
1854 } else { 1855 } else {
(...skipping 1544 matching lines...) Expand 10 before | Expand all | Expand 10 after
3399 case JS_OBJECT_TYPE: { 3400 case JS_OBJECT_TYPE: {
3400 Handle<JSObject> object = 3401 Handle<JSObject> object =
3401 isolate->factory()->NewJSObjectFromMap(map, NOT_TENURED, false); 3402 isolate->factory()->NewJSObjectFromMap(map, NOT_TENURED, false);
3402 materialized_objects_.Add(object); 3403 materialized_objects_.Add(object);
3403 Handle<Object> properties = GetNext(isolate, lvl + 1); 3404 Handle<Object> properties = GetNext(isolate, lvl + 1);
3404 Handle<Object> elements = GetNext(isolate, lvl + 1); 3405 Handle<Object> elements = GetNext(isolate, lvl + 1);
3405 object->set_properties(FixedArray::cast(*properties)); 3406 object->set_properties(FixedArray::cast(*properties));
3406 object->set_elements(FixedArrayBase::cast(*elements)); 3407 object->set_elements(FixedArrayBase::cast(*elements));
3407 for (int i = 0; i < length - 3; ++i) { 3408 for (int i = 0; i < length - 3; ++i) {
3408 Handle<Object> value = GetNext(isolate, lvl + 1); 3409 Handle<Object> value = GetNext(isolate, lvl + 1);
3409 object->FastPropertyAtPut(i, *value); 3410 FieldIndex index = FieldIndex::ForPropertyIndex(object->map(), i);
3411 object->FastPropertyAtPut(index, *value);
3410 } 3412 }
3411 return object; 3413 return object;
3412 } 3414 }
3413 case JS_ARRAY_TYPE: { 3415 case JS_ARRAY_TYPE: {
3414 Handle<JSArray> object = 3416 Handle<JSArray> object =
3415 isolate->factory()->NewJSArray(0, map->elements_kind()); 3417 isolate->factory()->NewJSArray(0, map->elements_kind());
3416 materialized_objects_.Add(object); 3418 materialized_objects_.Add(object);
3417 Handle<Object> properties = GetNext(isolate, lvl + 1); 3419 Handle<Object> properties = GetNext(isolate, lvl + 1);
3418 Handle<Object> elements = GetNext(isolate, lvl + 1); 3420 Handle<Object> elements = GetNext(isolate, lvl + 1);
3419 Handle<Object> length = GetNext(isolate, lvl + 1); 3421 Handle<Object> length = GetNext(isolate, lvl + 1);
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
3580 } 3582 }
3581 3583
3582 3584
3583 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { 3585 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) {
3584 v->VisitPointer(BitCast<Object**>(&function_)); 3586 v->VisitPointer(BitCast<Object**>(&function_));
3585 v->VisitPointers(parameters_, parameters_ + parameters_count_); 3587 v->VisitPointers(parameters_, parameters_ + parameters_count_);
3586 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); 3588 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_);
3587 } 3589 }
3588 3590
3589 } } // namespace v8::internal 3591 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/code-stubs-hydrogen.cc ('k') | src/field-index.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698