Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1074)

Side by Side Diff: runtime/vm/parser.h

Issue 70183010: Fixes a couple problems with GC of unoptimized code. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/pages.cc ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 #ifndef VM_PARSER_H_ 5 #ifndef VM_PARSER_H_
6 #define VM_PARSER_H_ 6 #define VM_PARSER_H_
7 7
8 #include "include/dart_api.h" 8 #include "include/dart_api.h"
9 9
10 #include "platform/assert.h" 10 #include "platform/assert.h"
(...skipping 22 matching lines...) Expand all
33 struct MemberDesc; 33 struct MemberDesc;
34 struct ParamList; 34 struct ParamList;
35 struct QualIdent; 35 struct QualIdent;
36 struct TopLevel; 36 struct TopLevel;
37 37
38 // The class ParsedFunction holds the result of parsing a function. 38 // The class ParsedFunction holds the result of parsing a function.
39 class ParsedFunction : public ZoneAllocated { 39 class ParsedFunction : public ZoneAllocated {
40 public: 40 public:
41 explicit ParsedFunction(const Function& function) 41 explicit ParsedFunction(const Function& function)
42 : function_(function), 42 : function_(function),
43 code_(Code::Handle(function.unoptimized_code())),
43 node_sequence_(NULL), 44 node_sequence_(NULL),
44 instantiator_(NULL), 45 instantiator_(NULL),
45 default_parameter_values_(Array::ZoneHandle()), 46 default_parameter_values_(Array::ZoneHandle()),
46 saved_current_context_var_(NULL), 47 saved_current_context_var_(NULL),
47 saved_entry_context_var_(NULL), 48 saved_entry_context_var_(NULL),
48 expression_temp_var_(NULL), 49 expression_temp_var_(NULL),
49 first_parameter_index_(0), 50 first_parameter_index_(0),
50 first_stack_local_index_(0), 51 first_stack_local_index_(0),
51 num_copied_params_(0), 52 num_copied_params_(0),
52 num_stack_locals_(0) { 53 num_stack_locals_(0) {
53 ASSERT(function.IsZoneHandle()); 54 ASSERT(function.IsZoneHandle());
54 } 55 }
55 56
56 const Function& function() const { return function_; } 57 const Function& function() const { return function_; }
58 RawCode* code() const { return code_.raw(); }
57 59
58 SequenceNode* node_sequence() const { return node_sequence_; } 60 SequenceNode* node_sequence() const { return node_sequence_; }
59 void SetNodeSequence(SequenceNode* node_sequence); 61 void SetNodeSequence(SequenceNode* node_sequence);
60 62
61 AstNode* instantiator() const { return instantiator_; } 63 AstNode* instantiator() const { return instantiator_; }
62 void set_instantiator(AstNode* instantiator) { 64 void set_instantiator(AstNode* instantiator) {
63 // May be NULL. 65 // May be NULL.
64 instantiator_ = instantiator; 66 instantiator_ = instantiator;
65 } 67 }
66 68
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 110
109 int first_parameter_index() const { return first_parameter_index_; } 111 int first_parameter_index() const { return first_parameter_index_; }
110 int first_stack_local_index() const { return first_stack_local_index_; } 112 int first_stack_local_index() const { return first_stack_local_index_; }
111 int num_copied_params() const { return num_copied_params_; } 113 int num_copied_params() const { return num_copied_params_; }
112 int num_stack_locals() const { return num_stack_locals_; } 114 int num_stack_locals() const { return num_stack_locals_; }
113 115
114 void AllocateVariables(); 116 void AllocateVariables();
115 117
116 private: 118 private:
117 const Function& function_; 119 const Function& function_;
120 Code& code_;
118 SequenceNode* node_sequence_; 121 SequenceNode* node_sequence_;
119 AstNode* instantiator_; 122 AstNode* instantiator_;
120 Array& default_parameter_values_; 123 Array& default_parameter_values_;
121 LocalVariable* saved_current_context_var_; 124 LocalVariable* saved_current_context_var_;
122 LocalVariable* saved_entry_context_var_; 125 LocalVariable* saved_entry_context_var_;
123 LocalVariable* expression_temp_var_; 126 LocalVariable* expression_temp_var_;
124 127
125 int first_parameter_index_; 128 int first_parameter_index_;
126 int first_stack_local_index_; 129 int first_stack_local_index_;
127 int num_copied_params_; 130 int num_copied_params_;
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 intptr_t last_used_try_index_; 711 intptr_t last_used_try_index_;
709 712
710 bool unregister_pending_function_; 713 bool unregister_pending_function_;
711 714
712 DISALLOW_COPY_AND_ASSIGN(Parser); 715 DISALLOW_COPY_AND_ASSIGN(Parser);
713 }; 716 };
714 717
715 } // namespace dart 718 } // namespace dart
716 719
717 #endif // VM_PARSER_H_ 720 #endif // VM_PARSER_H_
OLDNEW
« no previous file with comments | « runtime/vm/pages.cc ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698