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/hydrogen.h" | 5 #include "src/hydrogen.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "src/v8.h" | 9 #include "src/v8.h" |
10 | 10 |
(...skipping 8103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8114 } | 8114 } |
8115 } | 8115 } |
8116 | 8116 |
8117 // Generate the deoptimization data for the unoptimized version of | 8117 // Generate the deoptimization data for the unoptimized version of |
8118 // the target function if we don't already have it. | 8118 // the target function if we don't already have it. |
8119 if (!Compiler::EnsureDeoptimizationSupport(&target_info)) { | 8119 if (!Compiler::EnsureDeoptimizationSupport(&target_info)) { |
8120 TraceInline(target, caller, "could not generate deoptimization info"); | 8120 TraceInline(target, caller, "could not generate deoptimization info"); |
8121 return false; | 8121 return false; |
8122 } | 8122 } |
8123 | 8123 |
| 8124 // In strong mode it is an error to call a function with too few arguments. |
| 8125 // In that case do not inline because then the arity check would be skipped. |
| 8126 if (is_strong(function->language_mode()) && |
| 8127 arguments_count < function->parameter_count()) { |
| 8128 TraceInline(target, caller, |
| 8129 "too few arguments passed to a strong function"); |
| 8130 return false; |
| 8131 } |
| 8132 |
8124 // ---------------------------------------------------------------- | 8133 // ---------------------------------------------------------------- |
8125 // After this point, we've made a decision to inline this function (so | 8134 // After this point, we've made a decision to inline this function (so |
8126 // TryInline should always return true). | 8135 // TryInline should always return true). |
8127 | 8136 |
8128 // Type-check the inlined function. | 8137 // Type-check the inlined function. |
8129 DCHECK(target_shared->has_deoptimization_support()); | 8138 DCHECK(target_shared->has_deoptimization_support()); |
8130 AstTyper::Run(&target_info); | 8139 AstTyper::Run(&target_info); |
8131 | 8140 |
8132 int inlining_id = 0; | 8141 int inlining_id = 0; |
8133 if (top_info()->is_tracking_positions()) { | 8142 if (top_info()->is_tracking_positions()) { |
(...skipping 4995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13129 if (ShouldProduceTraceOutput()) { | 13138 if (ShouldProduceTraceOutput()) { |
13130 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13139 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
13131 } | 13140 } |
13132 | 13141 |
13133 #ifdef DEBUG | 13142 #ifdef DEBUG |
13134 graph_->Verify(false); // No full verify. | 13143 graph_->Verify(false); // No full verify. |
13135 #endif | 13144 #endif |
13136 } | 13145 } |
13137 | 13146 |
13138 } } // namespace v8::internal | 13147 } } // namespace v8::internal |
OLD | NEW |