OLD | NEW |
---|---|
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 7547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7558 VariableProxy* arg_two = args->at(1)->AsVariableProxy(); | 7558 VariableProxy* arg_two = args->at(1)->AsVariableProxy(); |
7559 if (arg_two == NULL || !arg_two->var()->IsStackAllocated()) return false; | 7559 if (arg_two == NULL || !arg_two->var()->IsStackAllocated()) return false; |
7560 HValue* arg_two_value = LookupAndMakeLive(arg_two->var()); | 7560 HValue* arg_two_value = LookupAndMakeLive(arg_two->var()); |
7561 if (!arg_two_value->CheckFlag(HValue::kIsArguments)) return false; | 7561 if (!arg_two_value->CheckFlag(HValue::kIsArguments)) return false; |
7562 | 7562 |
7563 // Found pattern f.apply(receiver, arguments). | 7563 // Found pattern f.apply(receiver, arguments). |
7564 CHECK_ALIVE_OR_RETURN(VisitForValue(prop->obj()), true); | 7564 CHECK_ALIVE_OR_RETURN(VisitForValue(prop->obj()), true); |
7565 HValue* function = Top(); | 7565 HValue* function = Top(); |
7566 | 7566 |
7567 AddCheckConstantFunction(expr->holder(), function, function_map); | 7567 AddCheckConstantFunction(expr->holder(), function, function_map); |
7568 Drop(1); | |
7569 | 7568 |
7570 CHECK_ALIVE_OR_RETURN(VisitForValue(args->at(0)), true); | 7569 CHECK_ALIVE_OR_RETURN(VisitForValue(args->at(0)), true); |
7571 HValue* receiver = Pop(); | 7570 HValue* receiver = Pop(); |
7572 | 7571 |
7572 Drop(1); // Pop the function | |
Jakob Kummerow
2014/01/10 13:47:03
nit: trailing full stop please.
Jarin
2014/01/10 14:14:45
Done.
| |
7573 | |
7573 if (function_state()->outer() == NULL) { | 7574 if (function_state()->outer() == NULL) { |
7574 HInstruction* elements = Add<HArgumentsElements>(false); | 7575 HInstruction* elements = Add<HArgumentsElements>(false); |
7575 HInstruction* length = Add<HArgumentsLength>(elements); | 7576 HInstruction* length = Add<HArgumentsLength>(elements); |
7576 HValue* wrapped_receiver = BuildWrapReceiver(receiver, function); | 7577 HValue* wrapped_receiver = BuildWrapReceiver(receiver, function); |
7577 HInstruction* result = New<HApplyArguments>(function, | 7578 HInstruction* result = New<HApplyArguments>(function, |
7578 wrapped_receiver, | 7579 wrapped_receiver, |
7579 length, | 7580 length, |
7580 elements); | 7581 elements); |
7581 ast_context()->ReturnInstruction(result, expr->id()); | 7582 ast_context()->ReturnInstruction(result, expr->id()); |
7582 return true; | 7583 return true; |
(...skipping 3335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
10918 if (ShouldProduceTraceOutput()) { | 10919 if (ShouldProduceTraceOutput()) { |
10919 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 10920 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
10920 } | 10921 } |
10921 | 10922 |
10922 #ifdef DEBUG | 10923 #ifdef DEBUG |
10923 graph_->Verify(false); // No full verify. | 10924 graph_->Verify(false); // No full verify. |
10924 #endif | 10925 #endif |
10925 } | 10926 } |
10926 | 10927 |
10927 } } // namespace v8::internal | 10928 } } // namespace v8::internal |
OLD | NEW |