OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. |
6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
7 | 7 |
8 #include "vm/code_generator.h" | 8 #include "vm/code_generator.h" |
9 | 9 |
10 #include "lib/error.h" | 10 #include "lib/error.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 DECLARE_FLAG(bool, enable_type_checks); | 29 DECLARE_FLAG(bool, enable_type_checks); |
30 DECLARE_FLAG(bool, report_invocation_count); | 30 DECLARE_FLAG(bool, report_invocation_count); |
31 DECLARE_FLAG(bool, trace_compiler); | 31 DECLARE_FLAG(bool, trace_compiler); |
32 | 32 |
33 #define __ assembler_-> | 33 #define __ assembler_-> |
34 | 34 |
35 | 35 |
36 class CodeGeneratorState : public StackResource { | 36 class CodeGeneratorState : public StackResource { |
37 public: | 37 public: |
38 explicit CodeGeneratorState(CodeGenerator* codegen) | 38 explicit CodeGeneratorState(CodeGenerator* codegen) |
39 : codegen_(codegen), parent_(codegen->state()) { | 39 : StackResource(Isolate::Current()), |
| 40 codegen_(codegen), |
| 41 parent_(codegen->state()) { |
40 if (parent_ != NULL) { | 42 if (parent_ != NULL) { |
41 root_node_ = parent_->root_node_; | 43 root_node_ = parent_->root_node_; |
42 loop_level_ = parent_->loop_level_; | 44 loop_level_ = parent_->loop_level_; |
43 context_level_ = parent_->context_level_; | 45 context_level_ = parent_->context_level_; |
44 current_try_index_ = parent_->current_try_index_; | 46 current_try_index_ = parent_->current_try_index_; |
45 } else { | 47 } else { |
46 root_node_ = NULL; | 48 root_node_ = NULL; |
47 loop_level_ = 0; | 49 loop_level_ = 0; |
48 context_level_ = 0; | 50 context_level_ = 0; |
49 current_try_index_ = CatchClauseNode::kInvalidTryIndex; | 51 current_try_index_ = CatchClauseNode::kInvalidTryIndex; |
(...skipping 2685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2735 const Class& cls = Class::Handle(parsed_function_.function().owner()); | 2737 const Class& cls = Class::Handle(parsed_function_.function().owner()); |
2736 const Script& script = Script::Handle(cls.script()); | 2738 const Script& script = Script::Handle(cls.script()); |
2737 Parser::ReportMsg(script, token_index, "Error", error_msg, format, args); | 2739 Parser::ReportMsg(script, token_index, "Error", error_msg, format, args); |
2738 Isolate::Current()->long_jump_base()->Jump(1, error_msg); | 2740 Isolate::Current()->long_jump_base()->Jump(1, error_msg); |
2739 UNREACHABLE(); | 2741 UNREACHABLE(); |
2740 } | 2742 } |
2741 | 2743 |
2742 } // namespace dart | 2744 } // namespace dart |
2743 | 2745 |
2744 #endif // defined TARGET_ARCH_IA32 | 2746 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |