| 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 5779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5790 HInstruction* elements = Add<HArgumentsElements>(false); | 5790 HInstruction* elements = Add<HArgumentsElements>(false); |
| 5791 result = New<HArgumentsLength>(elements); | 5791 result = New<HArgumentsLength>(elements); |
| 5792 } else { | 5792 } else { |
| 5793 // Number of arguments without receiver. | 5793 // Number of arguments without receiver. |
| 5794 int argument_count = environment()-> | 5794 int argument_count = environment()-> |
| 5795 arguments_environment()->parameter_count() - 1; | 5795 arguments_environment()->parameter_count() - 1; |
| 5796 result = New<HConstant>(argument_count); | 5796 result = New<HConstant>(argument_count); |
| 5797 } | 5797 } |
| 5798 } else { | 5798 } else { |
| 5799 Push(graph()->GetArgumentsObject()); | 5799 Push(graph()->GetArgumentsObject()); |
| 5800 VisitForValue(expr->key()); | 5800 CHECK_ALIVE_OR_RETURN(VisitForValue(expr->key()), true); |
| 5801 if (HasStackOverflow() || current_block() == NULL) return true; | |
| 5802 HValue* key = Pop(); | 5801 HValue* key = Pop(); |
| 5803 Drop(1); // Arguments object. | 5802 Drop(1); // Arguments object. |
| 5804 if (function_state()->outer() == NULL) { | 5803 if (function_state()->outer() == NULL) { |
| 5805 HInstruction* elements = Add<HArgumentsElements>(false); | 5804 HInstruction* elements = Add<HArgumentsElements>(false); |
| 5806 HInstruction* length = Add<HArgumentsLength>(elements); | 5805 HInstruction* length = Add<HArgumentsLength>(elements); |
| 5807 HInstruction* checked_key = Add<HBoundsCheck>(key, length); | 5806 HInstruction* checked_key = Add<HBoundsCheck>(key, length); |
| 5808 result = new(zone()) HAccessArgumentsAt(elements, length, checked_key); | 5807 result = new(zone()) HAccessArgumentsAt(elements, length, checked_key); |
| 5809 } else { | 5808 } else { |
| 5810 EnsureArgumentsArePushedForAccess(); | 5809 EnsureArgumentsArePushedForAccess(); |
| 5811 | 5810 |
| (...skipping 1047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6859 | 6858 |
| 6860 ZoneList<Expression*>* args = expr->arguments(); | 6859 ZoneList<Expression*>* args = expr->arguments(); |
| 6861 if (args->length() != 2) return false; | 6860 if (args->length() != 2) return false; |
| 6862 | 6861 |
| 6863 VariableProxy* arg_two = args->at(1)->AsVariableProxy(); | 6862 VariableProxy* arg_two = args->at(1)->AsVariableProxy(); |
| 6864 if (arg_two == NULL || !arg_two->var()->IsStackAllocated()) return false; | 6863 if (arg_two == NULL || !arg_two->var()->IsStackAllocated()) return false; |
| 6865 HValue* arg_two_value = LookupAndMakeLive(arg_two->var()); | 6864 HValue* arg_two_value = LookupAndMakeLive(arg_two->var()); |
| 6866 if (!arg_two_value->CheckFlag(HValue::kIsArguments)) return false; | 6865 if (!arg_two_value->CheckFlag(HValue::kIsArguments)) return false; |
| 6867 | 6866 |
| 6868 // Found pattern f.apply(receiver, arguments). | 6867 // Found pattern f.apply(receiver, arguments). |
| 6869 VisitForValue(prop->obj()); | 6868 CHECK_ALIVE_OR_RETURN(VisitForValue(prop->obj()), true); |
| 6870 if (HasStackOverflow() || current_block() == NULL) return true; | |
| 6871 HValue* function = Top(); | 6869 HValue* function = Top(); |
| 6872 AddCheckConstantFunction(expr->holder(), function, function_map); | 6870 AddCheckConstantFunction(expr->holder(), function, function_map); |
| 6873 Drop(1); | 6871 Drop(1); |
| 6874 | 6872 |
| 6875 VisitForValue(args->at(0)); | 6873 CHECK_ALIVE_OR_RETURN(VisitForValue(args->at(0)), true); |
| 6876 if (HasStackOverflow() || current_block() == NULL) return true; | |
| 6877 HValue* receiver = Pop(); | 6874 HValue* receiver = Pop(); |
| 6878 | 6875 |
| 6879 if (function_state()->outer() == NULL) { | 6876 if (function_state()->outer() == NULL) { |
| 6880 HInstruction* elements = Add<HArgumentsElements>(false); | 6877 HInstruction* elements = Add<HArgumentsElements>(false); |
| 6881 HInstruction* length = Add<HArgumentsLength>(elements); | 6878 HInstruction* length = Add<HArgumentsLength>(elements); |
| 6882 HValue* wrapped_receiver = BuildWrapReceiver(receiver, function); | 6879 HValue* wrapped_receiver = BuildWrapReceiver(receiver, function); |
| 6883 HInstruction* result = | 6880 HInstruction* result = |
| 6884 new(zone()) HApplyArguments(function, | 6881 new(zone()) HApplyArguments(function, |
| 6885 wrapped_receiver, | 6882 wrapped_receiver, |
| 6886 length, | 6883 length, |
| (...skipping 2827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9714 if (ShouldProduceTraceOutput()) { | 9711 if (ShouldProduceTraceOutput()) { |
| 9715 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 9712 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 9716 } | 9713 } |
| 9717 | 9714 |
| 9718 #ifdef DEBUG | 9715 #ifdef DEBUG |
| 9719 graph_->Verify(false); // No full verify. | 9716 graph_->Verify(false); // No full verify. |
| 9720 #endif | 9717 #endif |
| 9721 } | 9718 } |
| 9722 | 9719 |
| 9723 } } // namespace v8::internal | 9720 } } // namespace v8::internal |
| OLD | NEW |