OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/crankshaft/hydrogen.h" | 5 #include "src/crankshaft/hydrogen.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <sstream> | 8 #include <sstream> |
9 | 9 |
10 #include "src/allocation-site-scopes.h" | 10 #include "src/allocation-site-scopes.h" |
(...skipping 9809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9820 Push(receiver); | 9820 Push(receiver); |
9821 | 9821 |
9822 CHECK_ALIVE(VisitExpressions(expr->arguments(), arguments_flag)); | 9822 CHECK_ALIVE(VisitExpressions(expr->arguments(), arguments_flag)); |
9823 call = NewCallFunction(function, argument_count, syntactic_tail_call_mode, | 9823 call = NewCallFunction(function, argument_count, syntactic_tail_call_mode, |
9824 ConvertReceiverMode::kNotNullOrUndefined, | 9824 ConvertReceiverMode::kNotNullOrUndefined, |
9825 tail_call_mode); | 9825 tail_call_mode); |
9826 } | 9826 } |
9827 PushArgumentsFromEnvironment(argument_count); | 9827 PushArgumentsFromEnvironment(argument_count); |
9828 | 9828 |
9829 } else { | 9829 } else { |
9830 VariableProxy* proxy = expr->expression()->AsVariableProxy(); | 9830 if (expr->is_possibly_eval()) { |
9831 if (proxy != NULL && proxy->var()->is_possibly_eval(isolate())) { | |
9832 return Bailout(kPossibleDirectCallToEval); | 9831 return Bailout(kPossibleDirectCallToEval); |
9833 } | 9832 } |
9834 | 9833 |
9835 // The function is on the stack in the unoptimized code during | 9834 // The function is on the stack in the unoptimized code during |
9836 // evaluation of the arguments. | 9835 // evaluation of the arguments. |
9837 CHECK_ALIVE(VisitForValue(expr->expression())); | 9836 CHECK_ALIVE(VisitForValue(expr->expression())); |
9838 HValue* function = Top(); | 9837 HValue* function = Top(); |
9839 if (function->IsConstant() && | 9838 if (function->IsConstant() && |
9840 HConstant::cast(function)->handle(isolate())->IsJSFunction()) { | 9839 HConstant::cast(function)->handle(isolate())->IsJSFunction()) { |
9841 Handle<Object> constant = HConstant::cast(function)->handle(isolate()); | 9840 Handle<Object> constant = HConstant::cast(function)->handle(isolate()); |
(...skipping 24 matching lines...) Expand all Loading... |
9866 } | 9865 } |
9867 if (TryInlineApiFunctionCall(expr, receiver)) return; | 9866 if (TryInlineApiFunctionCall(expr, receiver)) return; |
9868 if (TryHandleArrayCall(expr, function)) return; | 9867 if (TryHandleArrayCall(expr, function)) return; |
9869 if (TryInlineCall(expr)) return; | 9868 if (TryInlineCall(expr)) return; |
9870 | 9869 |
9871 PushArgumentsFromEnvironment(argument_count); | 9870 PushArgumentsFromEnvironment(argument_count); |
9872 call = NewCallConstantFunction(expr->target(), argument_count, | 9871 call = NewCallConstantFunction(expr->target(), argument_count, |
9873 syntactic_tail_call_mode, tail_call_mode); | 9872 syntactic_tail_call_mode, tail_call_mode); |
9874 } else { | 9873 } else { |
9875 PushArgumentsFromEnvironment(argument_count); | 9874 PushArgumentsFromEnvironment(argument_count); |
9876 if (expr->is_uninitialized() && | 9875 if (expr->is_uninitialized() && expr->IsUsingCallFeedbackICSlot()) { |
9877 expr->IsUsingCallFeedbackICSlot(isolate())) { | |
9878 // We've never seen this call before, so let's have Crankshaft learn | 9876 // We've never seen this call before, so let's have Crankshaft learn |
9879 // through the type vector. | 9877 // through the type vector. |
9880 call = NewCallFunctionViaIC(function, argument_count, | 9878 call = NewCallFunctionViaIC(function, argument_count, |
9881 syntactic_tail_call_mode, | 9879 syntactic_tail_call_mode, |
9882 ConvertReceiverMode::kNullOrUndefined, | 9880 ConvertReceiverMode::kNullOrUndefined, |
9883 tail_call_mode, expr->CallFeedbackICSlot()); | 9881 tail_call_mode, expr->CallFeedbackICSlot()); |
9884 } else { | 9882 } else { |
9885 call = NewCallFunction( | 9883 call = NewCallFunction( |
9886 function, argument_count, syntactic_tail_call_mode, | 9884 function, argument_count, syntactic_tail_call_mode, |
9887 ConvertReceiverMode::kNullOrUndefined, tail_call_mode); | 9885 ConvertReceiverMode::kNullOrUndefined, tail_call_mode); |
(...skipping 3545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13433 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13431 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
13434 } | 13432 } |
13435 | 13433 |
13436 #ifdef DEBUG | 13434 #ifdef DEBUG |
13437 graph_->Verify(false); // No full verify. | 13435 graph_->Verify(false); // No full verify. |
13438 #endif | 13436 #endif |
13439 } | 13437 } |
13440 | 13438 |
13441 } // namespace internal | 13439 } // namespace internal |
13442 } // namespace v8 | 13440 } // namespace v8 |
OLD | NEW |