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

Side by Side Diff: src/deoptimizer.cc

Issue 167303005: Track field types. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 6 years, 8 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/arm64/stub-cache-arm64.cc ('k') | src/flag-definitions.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 // 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 1822 matching lines...) Expand 10 before | Expand all | Expand 10 after
1833 materialized_objects_->Add(arguments); 1833 materialized_objects_->Add(arguments);
1834 for (int i = 0; i < length; ++i) { 1834 for (int i = 0; i < length; ++i) {
1835 Handle<Object> value = MaterializeNextValue(); 1835 Handle<Object> value = MaterializeNextValue();
1836 array->set(i, *value); 1836 array->set(i, *value);
1837 } 1837 }
1838 } else { 1838 } else {
1839 // Dispatch on the instance type of the object to be materialized. 1839 // Dispatch on the instance type of the object to be materialized.
1840 // We also need to make sure that the representation of all fields 1840 // We also need to make sure that the representation of all fields
1841 // in the given object are general enough to hold a tagged value. 1841 // in the given object are general enough to hold a tagged value.
1842 Handle<Map> map = Map::GeneralizeAllFieldRepresentations( 1842 Handle<Map> map = Map::GeneralizeAllFieldRepresentations(
1843 Handle<Map>::cast(MaterializeNextValue()), Representation::Tagged()); 1843 Handle<Map>::cast(MaterializeNextValue()));
1844 switch (map->instance_type()) { 1844 switch (map->instance_type()) {
1845 case HEAP_NUMBER_TYPE: { 1845 case HEAP_NUMBER_TYPE: {
1846 // Reuse the HeapNumber value directly as it is already properly 1846 // Reuse the HeapNumber value directly as it is already properly
1847 // tagged and skip materializing the HeapNumber explicitly. 1847 // tagged and skip materializing the HeapNumber explicitly.
1848 Handle<Object> object = MaterializeNextValue(); 1848 Handle<Object> object = MaterializeNextValue();
1849 if (object_index < prev_materialized_count_) { 1849 if (object_index < prev_materialized_count_) {
1850 materialized_objects_->Add(Handle<Object>( 1850 materialized_objects_->Add(Handle<Object>(
1851 previously_materialized_objects_->get(object_index), isolate_)); 1851 previously_materialized_objects_->get(object_index), isolate_));
1852 } else { 1852 } else {
1853 materialized_objects_->Add(object); 1853 materialized_objects_->Add(object);
(...skipping 1480 matching lines...) Expand 10 before | Expand all | Expand 10 after
3334 ASSERT(slot_refs_[current_slot_].Representation() == SlotRef::LITERAL || 3334 ASSERT(slot_refs_[current_slot_].Representation() == SlotRef::LITERAL ||
3335 slot_refs_[current_slot_].Representation() == SlotRef::TAGGED); 3335 slot_refs_[current_slot_].Representation() == SlotRef::TAGGED);
3336 3336
3337 int object_index = materialized_objects_.length(); 3337 int object_index = materialized_objects_.length();
3338 if (object_index < prev_materialized_count_) { 3338 if (object_index < prev_materialized_count_) {
3339 return GetPreviouslyMaterialized(isolate, length); 3339 return GetPreviouslyMaterialized(isolate, length);
3340 } 3340 }
3341 3341
3342 Handle<Object> map_object = slot_refs_[current_slot_].GetValue(isolate); 3342 Handle<Object> map_object = slot_refs_[current_slot_].GetValue(isolate);
3343 Handle<Map> map = Map::GeneralizeAllFieldRepresentations( 3343 Handle<Map> map = Map::GeneralizeAllFieldRepresentations(
3344 Handle<Map>::cast(map_object), Representation::Tagged()); 3344 Handle<Map>::cast(map_object));
3345 current_slot_++; 3345 current_slot_++;
3346 // TODO(jarin) this should be unified with the code in 3346 // TODO(jarin) this should be unified with the code in
3347 // Deoptimizer::MaterializeNextHeapObject() 3347 // Deoptimizer::MaterializeNextHeapObject()
3348 switch (map->instance_type()) { 3348 switch (map->instance_type()) {
3349 case HEAP_NUMBER_TYPE: { 3349 case HEAP_NUMBER_TYPE: {
3350 // Reuse the HeapNumber value directly as it is already properly 3350 // Reuse the HeapNumber value directly as it is already properly
3351 // tagged and skip materializing the HeapNumber explicitly. 3351 // tagged and skip materializing the HeapNumber explicitly.
3352 Handle<Object> object = GetNext(isolate, lvl + 1); 3352 Handle<Object> object = GetNext(isolate, lvl + 1);
3353 materialized_objects_.Add(object); 3353 materialized_objects_.Add(object);
3354 // On 32-bit architectures, there is an extra slot there because 3354 // On 32-bit architectures, there is an extra slot there because
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
3546 3546
3547 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { 3547 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) {
3548 v->VisitPointer(BitCast<Object**>(&function_)); 3548 v->VisitPointer(BitCast<Object**>(&function_));
3549 v->VisitPointers(parameters_, parameters_ + parameters_count_); 3549 v->VisitPointers(parameters_, parameters_ + parameters_count_);
3550 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); 3550 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_);
3551 } 3551 }
3552 3552
3553 #endif // ENABLE_DEBUGGER_SUPPORT 3553 #endif // ENABLE_DEBUGGER_SUPPORT
3554 3554
3555 } } // namespace v8::internal 3555 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm64/stub-cache-arm64.cc ('k') | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698