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

Side by Side Diff: src/hydrogen.cc

Issue 133773002: Fix of Hydrogen environment building for function "apply" calls (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Nanotweak Created 6 years, 11 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/arguments-apply-deopt.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 7595 matching lines...) Expand 10 before | Expand all | Expand 10 after
7606 VariableProxy* arg_two = args->at(1)->AsVariableProxy(); 7606 VariableProxy* arg_two = args->at(1)->AsVariableProxy();
7607 if (arg_two == NULL || !arg_two->var()->IsStackAllocated()) return false; 7607 if (arg_two == NULL || !arg_two->var()->IsStackAllocated()) return false;
7608 HValue* arg_two_value = LookupAndMakeLive(arg_two->var()); 7608 HValue* arg_two_value = LookupAndMakeLive(arg_two->var());
7609 if (!arg_two_value->CheckFlag(HValue::kIsArguments)) return false; 7609 if (!arg_two_value->CheckFlag(HValue::kIsArguments)) return false;
7610 7610
7611 // Found pattern f.apply(receiver, arguments). 7611 // Found pattern f.apply(receiver, arguments).
7612 CHECK_ALIVE_OR_RETURN(VisitForValue(prop->obj()), true); 7612 CHECK_ALIVE_OR_RETURN(VisitForValue(prop->obj()), true);
7613 HValue* function = Top(); 7613 HValue* function = Top();
7614 7614
7615 AddCheckConstantFunction(expr->holder(), function, function_map); 7615 AddCheckConstantFunction(expr->holder(), function, function_map);
7616 Drop(1);
7617 7616
7618 CHECK_ALIVE_OR_RETURN(VisitForValue(args->at(0)), true); 7617 CHECK_ALIVE_OR_RETURN(VisitForValue(args->at(0)), true);
7619 HValue* receiver = Pop(); 7618 HValue* receiver = Pop();
7620 7619
7620 Drop(1); // Pop the function.
7621
7621 if (function_state()->outer() == NULL) { 7622 if (function_state()->outer() == NULL) {
7622 HInstruction* elements = Add<HArgumentsElements>(false); 7623 HInstruction* elements = Add<HArgumentsElements>(false);
7623 HInstruction* length = Add<HArgumentsLength>(elements); 7624 HInstruction* length = Add<HArgumentsLength>(elements);
7624 HValue* wrapped_receiver = BuildWrapReceiver(receiver, function); 7625 HValue* wrapped_receiver = BuildWrapReceiver(receiver, function);
7625 HInstruction* result = New<HApplyArguments>(function, 7626 HInstruction* result = New<HApplyArguments>(function,
7626 wrapped_receiver, 7627 wrapped_receiver,
7627 length, 7628 length,
7628 elements); 7629 elements);
7629 ast_context()->ReturnInstruction(result, expr->id()); 7630 ast_context()->ReturnInstruction(result, expr->id());
7630 return true; 7631 return true;
(...skipping 3329 matching lines...) Expand 10 before | Expand all | Expand 10 after
10960 if (ShouldProduceTraceOutput()) { 10961 if (ShouldProduceTraceOutput()) {
10961 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 10962 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
10962 } 10963 }
10963 10964
10964 #ifdef DEBUG 10965 #ifdef DEBUG
10965 graph_->Verify(false); // No full verify. 10966 graph_->Verify(false); // No full verify.
10966 #endif 10967 #endif
10967 } 10968 }
10968 10969
10969 } } // namespace v8::internal 10970 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/arguments-apply-deopt.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698