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 <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "src/allocation-site-scopes.h" | 9 #include "src/allocation-site-scopes.h" |
10 #include "src/ast/ast-numbering.h" | 10 #include "src/ast/ast-numbering.h" |
(...skipping 8363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8374 // If the function uses the arguments object check that inlining of functions | 8374 // If the function uses the arguments object check that inlining of functions |
8375 // with arguments object is enabled and the arguments-variable is | 8375 // with arguments object is enabled and the arguments-variable is |
8376 // stack allocated. | 8376 // stack allocated. |
8377 if (function->scope()->arguments() != NULL) { | 8377 if (function->scope()->arguments() != NULL) { |
8378 if (!FLAG_inline_arguments) { | 8378 if (!FLAG_inline_arguments) { |
8379 TraceInline(target, caller, "target uses arguments object"); | 8379 TraceInline(target, caller, "target uses arguments object"); |
8380 return false; | 8380 return false; |
8381 } | 8381 } |
8382 } | 8382 } |
8383 | 8383 |
| 8384 // Unsupported variable references present. |
| 8385 if (function->scope()->this_function_var() != nullptr || |
| 8386 function->scope()->new_target_var() != nullptr) { |
| 8387 TraceInline(target, caller, "target uses new target or this function"); |
| 8388 return false; |
| 8389 } |
| 8390 |
8384 // All declarations must be inlineable. | 8391 // All declarations must be inlineable. |
8385 ZoneList<Declaration*>* decls = target_info.scope()->declarations(); | 8392 ZoneList<Declaration*>* decls = target_info.scope()->declarations(); |
8386 int decl_count = decls->length(); | 8393 int decl_count = decls->length(); |
8387 for (int i = 0; i < decl_count; ++i) { | 8394 for (int i = 0; i < decl_count; ++i) { |
8388 if (!decls->at(i)->IsInlineable()) { | 8395 if (!decls->at(i)->IsInlineable()) { |
8389 TraceInline(target, caller, "target has non-trivial declaration"); | 8396 TraceInline(target, caller, "target has non-trivial declaration"); |
8390 return false; | 8397 return false; |
8391 } | 8398 } |
8392 } | 8399 } |
8393 | 8400 |
(...skipping 5226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13620 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13627 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
13621 } | 13628 } |
13622 | 13629 |
13623 #ifdef DEBUG | 13630 #ifdef DEBUG |
13624 graph_->Verify(false); // No full verify. | 13631 graph_->Verify(false); // No full verify. |
13625 #endif | 13632 #endif |
13626 } | 13633 } |
13627 | 13634 |
13628 } // namespace internal | 13635 } // namespace internal |
13629 } // namespace v8 | 13636 } // namespace v8 |
OLD | NEW |