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/parsing/rewriter.h" | 5 #include "src/parsing/rewriter.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 #include "src/execution.h" |
| 10 #include "src/isolate.h" |
9 #include "src/parsing/parse-info.h" | 11 #include "src/parsing/parse-info.h" |
10 #include "src/parsing/parser.h" | 12 #include "src/parsing/parser.h" |
11 | 13 |
12 namespace v8 { | 14 namespace v8 { |
13 namespace internal { | 15 namespace internal { |
14 | 16 |
15 class Processor final : public AstVisitor<Processor> { | 17 class Processor final : public AstVisitor<Processor> { |
16 public: | 18 public: |
17 Processor(Isolate* isolate, DeclarationScope* closure_scope, Variable* result, | 19 Processor(Isolate* isolate, DeclarationScope* closure_scope, Variable* result, |
18 AstValueFactory* ast_value_factory) | 20 AstValueFactory* ast_value_factory) |
19 : result_(result), | 21 : result_(result), |
20 result_assigned_(false), | 22 result_assigned_(false), |
21 replacement_(nullptr), | 23 replacement_(nullptr), |
22 is_set_(false), | 24 is_set_(false), |
23 zone_(ast_value_factory->zone()), | 25 zone_(ast_value_factory->zone()), |
24 closure_scope_(closure_scope), | 26 closure_scope_(closure_scope), |
25 factory_(ast_value_factory) { | 27 factory_(ast_value_factory) { |
26 DCHECK_EQ(closure_scope, closure_scope->GetClosureScope()); | 28 DCHECK_EQ(closure_scope, closure_scope->GetClosureScope()); |
27 InitializeAstVisitor(isolate); | 29 InitializeAstVisitor(isolate->stack_guard()->climit()); |
28 } | 30 } |
29 | 31 |
30 Processor(Parser* parser, DeclarationScope* closure_scope, Variable* result, | 32 Processor(Parser* parser, DeclarationScope* closure_scope, Variable* result, |
31 AstValueFactory* ast_value_factory) | 33 AstValueFactory* ast_value_factory) |
32 : result_(result), | 34 : result_(result), |
33 result_assigned_(false), | 35 result_assigned_(false), |
34 replacement_(nullptr), | 36 replacement_(nullptr), |
35 is_set_(false), | 37 is_set_(false), |
36 zone_(ast_value_factory->zone()), | 38 zone_(ast_value_factory->zone()), |
37 closure_scope_(closure_scope), | 39 closure_scope_(closure_scope), |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 processor.SetResult(undef), expr->position()); | 390 processor.SetResult(undef), expr->position()); |
389 body->Add(completion, factory->zone()); | 391 body->Add(completion, factory->zone()); |
390 } | 392 } |
391 } | 393 } |
392 return true; | 394 return true; |
393 } | 395 } |
394 | 396 |
395 | 397 |
396 } // namespace internal | 398 } // namespace internal |
397 } // namespace v8 | 399 } // namespace v8 |
OLD | NEW |