Chromium Code Reviews| 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 7542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7553 if (args->length() != 2) return false; | 7553 if (args->length() != 2) return false; |
| 7554 | 7554 |
| 7555 VariableProxy* arg_two = args->at(1)->AsVariableProxy(); | 7555 VariableProxy* arg_two = args->at(1)->AsVariableProxy(); |
| 7556 if (arg_two == NULL || !arg_two->var()->IsStackAllocated()) return false; | 7556 if (arg_two == NULL || !arg_two->var()->IsStackAllocated()) return false; |
| 7557 HValue* arg_two_value = LookupAndMakeLive(arg_two->var()); | 7557 HValue* arg_two_value = LookupAndMakeLive(arg_two->var()); |
| 7558 if (!arg_two_value->CheckFlag(HValue::kIsArguments)) return false; | 7558 if (!arg_two_value->CheckFlag(HValue::kIsArguments)) return false; |
| 7559 | 7559 |
| 7560 // Found pattern f.apply(receiver, arguments). | 7560 // Found pattern f.apply(receiver, arguments). |
| 7561 CHECK_ALIVE_OR_RETURN(VisitForValue(prop->obj()), true); | 7561 CHECK_ALIVE_OR_RETURN(VisitForValue(prop->obj()), true); |
| 7562 HValue* function = Top(); | 7562 HValue* function = Top(); |
| 7563 // The function get here may be an undefined constant if lookup fails. | |
| 7564 if (function->IsConstant() && | |
| 7565 !HConstant::cast(function)->handle(isolate())->IsJSFunction()) { | |
| 7566 return false; | |
|
Jakob Kummerow
2013/11/28 15:17:30
I think we need to Drop(1) before returning.
| |
| 7567 } | |
| 7568 | |
| 7563 AddCheckConstantFunction(expr->holder(), function, function_map); | 7569 AddCheckConstantFunction(expr->holder(), function, function_map); |
| 7564 Drop(1); | 7570 Drop(1); |
| 7565 | 7571 |
| 7566 CHECK_ALIVE_OR_RETURN(VisitForValue(args->at(0)), true); | 7572 CHECK_ALIVE_OR_RETURN(VisitForValue(args->at(0)), true); |
| 7567 HValue* receiver = Pop(); | 7573 HValue* receiver = Pop(); |
| 7568 | 7574 |
| 7569 if (function_state()->outer() == NULL) { | 7575 if (function_state()->outer() == NULL) { |
| 7570 HInstruction* elements = Add<HArgumentsElements>(false); | 7576 HInstruction* elements = Add<HArgumentsElements>(false); |
| 7571 HInstruction* length = Add<HArgumentsLength>(elements); | 7577 HInstruction* length = Add<HArgumentsLength>(elements); |
| 7572 HValue* wrapped_receiver = BuildWrapReceiver(receiver, function); | 7578 HValue* wrapped_receiver = BuildWrapReceiver(receiver, function); |
| (...skipping 3241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 10814 if (ShouldProduceTraceOutput()) { | 10820 if (ShouldProduceTraceOutput()) { |
| 10815 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 10821 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 10816 } | 10822 } |
| 10817 | 10823 |
| 10818 #ifdef DEBUG | 10824 #ifdef DEBUG |
| 10819 graph_->Verify(false); // No full verify. | 10825 graph_->Verify(false); // No full verify. |
| 10820 #endif | 10826 #endif |
| 10821 } | 10827 } |
| 10822 | 10828 |
| 10823 } } // namespace v8::internal | 10829 } } // namespace v8::internal |
| OLD | NEW |