Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/ast/ast-numbering.h" | 5 #include "src/ast/ast-numbering.h" |
| 6 | 6 |
| 7 #include "src/ast/ast.h" | 7 #include "src/ast/ast.h" |
| 8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| (...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 570 DisableCrankshaft(kRestParameter); | 570 DisableCrankshaft(kRestParameter); |
| 571 } | 571 } |
| 572 | 572 |
| 573 if (IsGeneratorFunction(node->kind()) || IsAsyncFunction(node->kind())) { | 573 if (IsGeneratorFunction(node->kind()) || IsAsyncFunction(node->kind())) { |
| 574 // TODO(neis): We may want to allow Turbofan optimization here if | 574 // TODO(neis): We may want to allow Turbofan optimization here if |
| 575 // --turbo-from-bytecode is set and we know that Ignition is used. | 575 // --turbo-from-bytecode is set and we know that Ignition is used. |
| 576 // Unfortunately we can't express that here. | 576 // Unfortunately we can't express that here. |
| 577 DisableOptimization(kGenerator); | 577 DisableOptimization(kGenerator); |
| 578 } | 578 } |
| 579 | 579 |
| 580 // Create a canonical handle scope if compiling ignition bytecode. This is | |
| 581 // required by the constant array builder to de-duplicate objects without | |
| 582 // dereferencing handles. | |
| 583 std::unique_ptr<CanonicalHandleScope> canonical; | |
| 584 if (FLAG_ignition) canonical.reset(new CanonicalHandleScope(isolate_)); | |
|
marja
2016/09/12 07:26:41
Why do we need to create the canonical handle scop
| |
| 585 | |
| 580 VisitDeclarations(scope->declarations()); | 586 VisitDeclarations(scope->declarations()); |
| 581 VisitStatements(node->body()); | 587 VisitStatements(node->body()); |
| 582 | 588 |
| 583 node->set_ast_properties(&properties_); | 589 node->set_ast_properties(&properties_); |
| 584 node->set_dont_optimize_reason(dont_optimize_reason()); | 590 node->set_dont_optimize_reason(dont_optimize_reason()); |
| 585 node->set_yield_count(yield_count_); | 591 node->set_yield_count(yield_count_); |
| 586 return !HasStackOverflow(); | 592 return !HasStackOverflow(); |
| 587 } | 593 } |
| 588 | 594 |
| 589 | 595 |
| 590 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, | 596 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, |
| 591 FunctionLiteral* function) { | 597 FunctionLiteral* function) { |
| 592 AstNumberingVisitor visitor(isolate, zone); | 598 AstNumberingVisitor visitor(isolate, zone); |
| 593 return visitor.Renumber(function); | 599 return visitor.Renumber(function); |
| 594 } | 600 } |
| 595 } // namespace internal | 601 } // namespace internal |
| 596 } // namespace v8 | 602 } // namespace v8 |
| OLD | NEW |