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

Side by Side Diff: vm/debugger.h

Issue 12225031: Minor cleanup of activation frame creation code. Get the code object while iterating the frames as … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 7 years, 10 months 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 | « no previous file | vm/debugger.cc » ('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_DEBUGGER_H_ 5 #ifndef VM_DEBUGGER_H_
6 #define VM_DEBUGGER_H_ 6 #define VM_DEBUGGER_H_
7 7
8 #include "include/dart_debugger_api.h" 8 #include "include/dart_debugger_api.h"
9 9
10 #include "vm/object.h" 10 #include "vm/object.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 112
113 friend class Debugger; 113 friend class Debugger;
114 DISALLOW_COPY_AND_ASSIGN(CodeBreakpoint); 114 DISALLOW_COPY_AND_ASSIGN(CodeBreakpoint);
115 }; 115 };
116 116
117 117
118 // ActivationFrame represents one dart function activation frame 118 // ActivationFrame represents one dart function activation frame
119 // on the call stack. 119 // on the call stack.
120 class ActivationFrame : public ZoneAllocated { 120 class ActivationFrame : public ZoneAllocated {
121 public: 121 public:
122 explicit ActivationFrame(uword pc, uword fp, uword sp, const Context& ctx); 122 ActivationFrame(uword pc, uword fp, uword sp,
123 const Code& code, const Context& ctx);
123 124
124 uword pc() const { return pc_; } 125 uword pc() const { return pc_; }
125 uword fp() const { return fp_; } 126 uword fp() const { return fp_; }
126 uword sp() const { return sp_; } 127 uword sp() const { return sp_; }
128 const Function& function() const {
129 ASSERT(!function_.IsNull());
130 return function_;
131 }
132 const Code& code() const {
133 ASSERT(!code_.IsNull());
134 return code_;
135 }
127 136
128 const Function& DartFunction();
129 const Code& DartCode();
130 RawString* QualifiedFunctionName(); 137 RawString* QualifiedFunctionName();
131 RawString* SourceUrl(); 138 RawString* SourceUrl();
132 RawScript* SourceScript(); 139 RawScript* SourceScript();
133 RawLibrary* Library(); 140 RawLibrary* Library();
134 intptr_t TokenPos(); 141 intptr_t TokenPos();
135 intptr_t LineNumber(); 142 intptr_t LineNumber();
136 143
137 // The context level of a frame is the context level at the 144 // The context level of a frame is the context level at the
138 // PC/token index of the frame. It determines the depth of the context 145 // PC/token index of the frame. It determines the depth of the context
139 // chain that belongs to the function of this activation frame. 146 // chain that belongs to the function of this activation frame.
(...skipping 20 matching lines...) Expand all
160 void GetDescIndices(); 167 void GetDescIndices();
161 RawInstance* GetLocalVarValue(intptr_t slot_index); 168 RawInstance* GetLocalVarValue(intptr_t slot_index);
162 RawInstance* GetInstanceCallReceiver(intptr_t num_actual_args); 169 RawInstance* GetInstanceCallReceiver(intptr_t num_actual_args);
163 170
164 uword pc_; 171 uword pc_;
165 uword fp_; 172 uword fp_;
166 uword sp_; 173 uword sp_;
167 174
168 // The anchor of the context chain for this function. 175 // The anchor of the context chain for this function.
169 const Context& ctx_; 176 const Context& ctx_;
170 177 const Code& code_;
171 Function& function_; 178 const Function& function_;
172 Code& code_;
173 intptr_t token_pos_; 179 intptr_t token_pos_;
174 intptr_t pc_desc_index_; 180 intptr_t pc_desc_index_;
175 intptr_t line_number_; 181 intptr_t line_number_;
176 intptr_t context_level_; 182 intptr_t context_level_;
177 183
178 bool vars_initialized_; 184 bool vars_initialized_;
179 LocalVarDescriptors& var_descriptors_; 185 LocalVarDescriptors& var_descriptors_;
180 ZoneGrowableArray<intptr_t> desc_indices_; 186 ZoneGrowableArray<intptr_t> desc_indices_;
181 PcDescriptors& pc_desc_; 187 PcDescriptors& pc_desc_;
182 188
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 static EventHandler* event_handler_; 382 static EventHandler* event_handler_;
377 383
378 friend class SourceBreakpoint; 384 friend class SourceBreakpoint;
379 DISALLOW_COPY_AND_ASSIGN(Debugger); 385 DISALLOW_COPY_AND_ASSIGN(Debugger);
380 }; 386 };
381 387
382 388
383 } // namespace dart 389 } // namespace dart
384 390
385 #endif // VM_DEBUGGER_H_ 391 #endif // VM_DEBUGGER_H_
OLDNEW
« no previous file with comments | « no previous file | vm/debugger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698