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

Side by Side Diff: src/deoptimizer.cc

Issue 183063006: Fix materialization of captured objects in adapted arguments. (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-348512.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 1734 matching lines...) Expand 10 before | Expand all | Expand 10 after
1745 // Found a previously materialized object by de-duplication. 1745 // Found a previously materialized object by de-duplication.
1746 object_index = desc.duplicate_object(); 1746 object_index = desc.duplicate_object();
1747 materialized_objects_->Add(Handle<Object>()); 1747 materialized_objects_->Add(Handle<Object>());
1748 } else if (desc.is_arguments() && ArgumentsObjectIsAdapted(object_index)) { 1748 } else if (desc.is_arguments() && ArgumentsObjectIsAdapted(object_index)) {
1749 // Use the arguments adapter frame we just built to materialize the 1749 // Use the arguments adapter frame we just built to materialize the
1750 // arguments object. FunctionGetArguments can't throw an exception. 1750 // arguments object. FunctionGetArguments can't throw an exception.
1751 Handle<JSFunction> function = ArgumentsObjectFunction(object_index); 1751 Handle<JSFunction> function = ArgumentsObjectFunction(object_index);
1752 Handle<JSObject> arguments = Handle<JSObject>::cast( 1752 Handle<JSObject> arguments = Handle<JSObject>::cast(
1753 Accessors::FunctionGetArguments(function)); 1753 Accessors::FunctionGetArguments(function));
1754 materialized_objects_->Add(arguments); 1754 materialized_objects_->Add(arguments);
1755 materialization_value_index_ += length; 1755 // To keep consistent object counters, we still materialize the
1756 // nested values (but we throw them away).
1757 for (int i = 0; i < length; ++i) {
1758 MaterializeNextValue();
1759 }
1756 } else if (desc.is_arguments()) { 1760 } else if (desc.is_arguments()) {
1757 // Construct an arguments object and copy the parameters to a newly 1761 // Construct an arguments object and copy the parameters to a newly
1758 // allocated arguments object backing store. 1762 // allocated arguments object backing store.
1759 Handle<JSFunction> function = ArgumentsObjectFunction(object_index); 1763 Handle<JSFunction> function = ArgumentsObjectFunction(object_index);
1760 Handle<JSObject> arguments = 1764 Handle<JSObject> arguments =
1761 isolate_->factory()->NewArgumentsObject(function, length); 1765 isolate_->factory()->NewArgumentsObject(function, length);
1762 Handle<FixedArray> array = isolate_->factory()->NewFixedArray(length); 1766 Handle<FixedArray> array = isolate_->factory()->NewFixedArray(length);
1763 ASSERT(array->length() == length); 1767 ASSERT(array->length() == length);
1764 arguments->set_elements(*array); 1768 arguments->set_elements(*array);
1765 materialized_objects_->Add(arguments); 1769 materialized_objects_->Add(arguments);
(...skipping 1705 matching lines...) Expand 10 before | Expand all | Expand 10 after
3471 3475
3472 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { 3476 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) {
3473 v->VisitPointer(BitCast<Object**>(&function_)); 3477 v->VisitPointer(BitCast<Object**>(&function_));
3474 v->VisitPointers(parameters_, parameters_ + parameters_count_); 3478 v->VisitPointers(parameters_, parameters_ + parameters_count_);
3475 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); 3479 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_);
3476 } 3480 }
3477 3481
3478 #endif // ENABLE_DEBUGGER_SUPPORT 3482 #endif // ENABLE_DEBUGGER_SUPPORT
3479 3483
3480 } } // namespace v8::internal 3484 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-348512.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698