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

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

Issue 12049039: Fix source position for stack traces with optimized top function. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: avoid default arguments by using pending_deoptimization_env_ 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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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_DEOPT_INSTRUCTIONS_H_ 5 #ifndef VM_DEOPT_INSTRUCTIONS_H_
6 #define VM_DEOPT_INSTRUCTIONS_H_ 6 #define VM_DEOPT_INSTRUCTIONS_H_
7 7
8 #include "vm/allocation.h" 8 #include "vm/allocation.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/code_generator.h" 10 #include "vm/code_generator.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 static DeoptInstr* Create(intptr_t kind_as_int, intptr_t from_index); 108 static DeoptInstr* Create(intptr_t kind_as_int, intptr_t from_index);
109 109
110 DeoptInstr() {} 110 DeoptInstr() {}
111 virtual ~DeoptInstr() {} 111 virtual ~DeoptInstr() {}
112 112
113 virtual const char* ToCString() const = 0; 113 virtual const char* ToCString() const = 0;
114 114
115 virtual void Execute(DeoptimizationContext* deopt_context, 115 virtual void Execute(DeoptimizationContext* deopt_context,
116 intptr_t to_index) = 0; 116 intptr_t to_index) = 0;
117 117
118 virtual DeoptInstr::Kind kind() const = 0;
119
118 bool Equals(const DeoptInstr& other) const { 120 bool Equals(const DeoptInstr& other) const {
119 return (kind() == other.kind()) && (from_index() == other.from_index()); 121 return (kind() == other.kind()) && (from_index() == other.from_index());
120 } 122 }
121 123
122 // Decode the payload of a suffix command. Return the suffix length and 124 // Decode the payload of a suffix command. Return the suffix length and
123 // set the output parameter info_number to the index of the shared suffix. 125 // set the output parameter info_number to the index of the shared suffix.
124 static intptr_t DecodeSuffix(intptr_t from_index, intptr_t* info_number); 126 static intptr_t DecodeSuffix(intptr_t from_index, intptr_t* info_number);
125 127
126 // Get the function and return address which is encoded in this 128 // Get the function and return address which is encoded in this
127 // kRetAfterAddress deopt instruction. 129 // kRetAfterAddress deopt instruction.
128 static uword GetRetAfterAddress(intptr_t deopt_from_index, 130 static uword GetRetAfterAddress(DeoptInstr* instr,
129 const Array& object_table, 131 const Array& object_table,
srdjan 2013/01/28 18:03:58 Why not making this an instance method, implemente
Florian Schneider 2013/01/29 12:19:07 I would have to move all concrete deopt instructio
130 Function* func); 132 Function* func);
131 133
132 protected: 134 protected:
133 virtual DeoptInstr::Kind kind() const = 0;
134 virtual intptr_t from_index() const = 0; 135 virtual intptr_t from_index() const = 0;
135 136
136 friend class DeoptInfoBuilder; 137 friend class DeoptInfoBuilder;
137 138
138 private: 139 private:
139 DISALLOW_COPY_AND_ASSIGN(DeoptInstr); 140 DISALLOW_COPY_AND_ASSIGN(DeoptInstr);
140 }; 141 };
141 142
142 143
143 // Builds a deoptimization info table, one DeoptInfo at a time. Call AddXXX 144 // Builds a deoptimization info table, one DeoptInfo at a time. Call AddXXX
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 DeoptInfo* info, 218 DeoptInfo* info,
218 Smi* reason); 219 Smi* reason);
219 220
220 private: 221 private:
221 static const intptr_t kEntrySize = 3; 222 static const intptr_t kEntrySize = 3;
222 }; 223 };
223 224
224 } // namespace dart 225 } // namespace dart
225 226
226 #endif // VM_DEOPT_INSTRUCTIONS_H_ 227 #endif // VM_DEOPT_INSTRUCTIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698