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

Side by Side Diff: src/deoptimizer.cc

Issue 19638003: Handlify Accessors::FunctionGetArguments method. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Minor adjustments. Created 7 years, 5 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
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 1600 matching lines...) Expand 10 before | Expand all | Expand 10 after
1611 Handle<JSFunction> function(frame->function(), isolate_); 1611 Handle<JSFunction> function(frame->function(), isolate_);
1612 Handle<JSObject> arguments; 1612 Handle<JSObject> arguments;
1613 for (int i = frame->ComputeExpressionsCount() - 1; i >= 0; --i) { 1613 for (int i = frame->ComputeExpressionsCount() - 1; i >= 0; --i) {
1614 if (frame->GetExpression(i) == isolate_->heap()->arguments_marker()) { 1614 if (frame->GetExpression(i) == isolate_->heap()->arguments_marker()) {
1615 ObjectMaterializationDescriptor descriptor = 1615 ObjectMaterializationDescriptor descriptor =
1616 deferred_objects_.RemoveLast(); 1616 deferred_objects_.RemoveLast();
1617 const int length = descriptor.object_length(); 1617 const int length = descriptor.object_length();
1618 if (arguments.is_null()) { 1618 if (arguments.is_null()) {
1619 if (frame->has_adapted_arguments()) { 1619 if (frame->has_adapted_arguments()) {
1620 // Use the arguments adapter frame we just built to materialize the 1620 // Use the arguments adapter frame we just built to materialize the
1621 // arguments object. FunctionGetArguments can't throw an exception, 1621 // arguments object. FunctionGetArguments can't throw an exception.
1622 // so cast away the doubt with an assert. 1622 arguments = Handle<JSObject>::cast(
1623 arguments = Handle<JSObject>(JSObject::cast( 1623 Accessors::FunctionGetArguments(function));
1624 Accessors::FunctionGetArguments(*function,
1625 NULL)->ToObjectUnchecked()));
1626 values.RewindBy(length); 1624 values.RewindBy(length);
1627 } else { 1625 } else {
1628 // Construct an arguments object and copy the parameters to a newly 1626 // Construct an arguments object and copy the parameters to a newly
1629 // allocated arguments object backing store. 1627 // allocated arguments object backing store.
1630 arguments = 1628 arguments =
1631 isolate_->factory()->NewArgumentsObject(function, length); 1629 isolate_->factory()->NewArgumentsObject(function, length);
1632 Handle<FixedArray> array = 1630 Handle<FixedArray> array =
1633 isolate_->factory()->NewFixedArray(length); 1631 isolate_->factory()->NewFixedArray(length);
1634 ASSERT(array->length() == length); 1632 ASSERT(array->length() == length);
1635 for (int i = length - 1; i >= 0 ; --i) { 1633 for (int i = length - 1; i >= 0 ; --i) {
(...skipping 1456 matching lines...) Expand 10 before | Expand all | Expand 10 after
3092 3090
3093 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { 3091 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) {
3094 v->VisitPointer(BitCast<Object**>(&function_)); 3092 v->VisitPointer(BitCast<Object**>(&function_));
3095 v->VisitPointers(parameters_, parameters_ + parameters_count_); 3093 v->VisitPointers(parameters_, parameters_ + parameters_count_);
3096 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); 3094 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_);
3097 } 3095 }
3098 3096
3099 #endif // ENABLE_DEBUGGER_SUPPORT 3097 #endif // ENABLE_DEBUGGER_SUPPORT
3100 3098
3101 } } // namespace v8::internal 3099 } } // namespace v8::internal
OLDNEW
« src/accessors.cc ('K') | « src/accessors.cc ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698