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

Side by Side Diff: src/deoptimizer.cc

Issue 196283004: Fix of argument materialization of captured heap numbers. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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 | « no previous file | test/mjsunit/regress/regress-351315.js » ('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 3269 matching lines...) Expand 10 before | Expand all | Expand 10 after
3280 Handle<Map>::cast(map_object), Representation::Tagged()); 3280 Handle<Map>::cast(map_object), Representation::Tagged());
3281 current_slot_++; 3281 current_slot_++;
3282 // TODO(jarin) this should be unified with the code in 3282 // TODO(jarin) this should be unified with the code in
3283 // Deoptimizer::MaterializeNextHeapObject() 3283 // Deoptimizer::MaterializeNextHeapObject()
3284 switch (map->instance_type()) { 3284 switch (map->instance_type()) {
3285 case HEAP_NUMBER_TYPE: { 3285 case HEAP_NUMBER_TYPE: {
3286 // Reuse the HeapNumber value directly as it is already properly 3286 // Reuse the HeapNumber value directly as it is already properly
3287 // tagged and skip materializing the HeapNumber explicitly. 3287 // tagged and skip materializing the HeapNumber explicitly.
3288 Handle<Object> object = GetNext(isolate, lvl + 1); 3288 Handle<Object> object = GetNext(isolate, lvl + 1);
3289 materialized_objects_.Add(object); 3289 materialized_objects_.Add(object);
3290 // On 32-bit architectures, there is an extra slot there because
3291 // the escape analysis calculates the number of slots as
3292 // object-size/pointer-size. To account for this, we read out
3293 // any extra slots.
3294 for (int i = 0; i < length - 2; i++) {
3295 GetNext(isolate, lvl + 1);
3296 }
3290 return object; 3297 return object;
3291 } 3298 }
3292 case JS_OBJECT_TYPE: { 3299 case JS_OBJECT_TYPE: {
3293 Handle<JSObject> object = 3300 Handle<JSObject> object =
3294 isolate->factory()->NewJSObjectFromMap(map, NOT_TENURED, false); 3301 isolate->factory()->NewJSObjectFromMap(map, NOT_TENURED, false);
3295 materialized_objects_.Add(object); 3302 materialized_objects_.Add(object);
3296 Handle<Object> properties = GetNext(isolate, lvl + 1); 3303 Handle<Object> properties = GetNext(isolate, lvl + 1);
3297 Handle<Object> elements = GetNext(isolate, lvl + 1); 3304 Handle<Object> elements = GetNext(isolate, lvl + 1);
3298 object->set_properties(FixedArray::cast(*properties)); 3305 object->set_properties(FixedArray::cast(*properties));
3299 object->set_elements(FixedArrayBase::cast(*elements)); 3306 object->set_elements(FixedArrayBase::cast(*elements));
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
3334 UNREACHABLE(); 3341 UNREACHABLE();
3335 break; 3342 break;
3336 } 3343 }
3337 3344
3338 FATAL("We should never get here - unexpected deopt slot kind."); 3345 FATAL("We should never get here - unexpected deopt slot kind.");
3339 return Handle<Object>::null(); 3346 return Handle<Object>::null();
3340 } 3347 }
3341 3348
3342 3349
3343 void SlotRefValueBuilder::Finish(Isolate* isolate) { 3350 void SlotRefValueBuilder::Finish(Isolate* isolate) {
3344 // We should have processed all slot 3351 // We should have processed all the slots
3345 ASSERT(slot_refs_.length() == current_slot_); 3352 ASSERT(slot_refs_.length() == current_slot_);
3346 3353
3347 if (materialized_objects_.length() > prev_materialized_count_) { 3354 if (materialized_objects_.length() > prev_materialized_count_) {
3348 // We have materialized some new objects, so we have to store them 3355 // We have materialized some new objects, so we have to store them
3349 // to prevent duplicate materialization 3356 // to prevent duplicate materialization
3350 Handle<FixedArray> array = isolate->factory()->NewFixedArray( 3357 Handle<FixedArray> array = isolate->factory()->NewFixedArray(
3351 materialized_objects_.length()); 3358 materialized_objects_.length());
3352 for (int i = 0; i < materialized_objects_.length(); i++) { 3359 for (int i = 0; i < materialized_objects_.length(); i++) {
3353 array->set(i, *(materialized_objects_.at(i))); 3360 array->set(i, *(materialized_objects_.at(i)));
3354 } 3361 }
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
3475 3482
3476 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { 3483 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) {
3477 v->VisitPointer(BitCast<Object**>(&function_)); 3484 v->VisitPointer(BitCast<Object**>(&function_));
3478 v->VisitPointers(parameters_, parameters_ + parameters_count_); 3485 v->VisitPointers(parameters_, parameters_ + parameters_count_);
3479 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); 3486 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_);
3480 } 3487 }
3481 3488
3482 #endif // ENABLE_DEBUGGER_SUPPORT 3489 #endif // ENABLE_DEBUGGER_SUPPORT
3483 3490
3484 } } // namespace v8::internal 3491 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-351315.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698