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

Side by Side Diff: src/ia32/lithium-ia32.h

Issue 21042003: Patch to enhance the source code line information for profiler. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 7 years, 4 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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 202
203 203
204 #define DECLARE_HYDROGEN_ACCESSOR(type) \ 204 #define DECLARE_HYDROGEN_ACCESSOR(type) \
205 H##type* hydrogen() const { \ 205 H##type* hydrogen() const { \
206 return H##type::cast(hydrogen_value()); \ 206 return H##type::cast(hydrogen_value()); \
207 } 207 }
208 208
209 209
210 class LInstruction: public ZoneObject { 210 class LInstruction: public ZoneObject {
211 public: 211 public:
212 LInstruction() 212 LInstruction() : environment_(NULL), hydrogen_value_(NULL) {
213 : environment_(NULL), 213 bit_field_ = IsCallBits::encode(false) |
214 hydrogen_value_(NULL), 214 PositionBits::encode(RelocInfo::kNoPosition + 1);
215 is_call_(false) { } 215 }
216
216 virtual ~LInstruction() { } 217 virtual ~LInstruction() { }
217 218
218 virtual void CompileToNative(LCodeGen* generator) = 0; 219 virtual void CompileToNative(LCodeGen* generator) = 0;
219 virtual const char* Mnemonic() const = 0; 220 virtual const char* Mnemonic() const = 0;
220 virtual void PrintTo(StringStream* stream); 221 virtual void PrintTo(StringStream* stream);
221 virtual void PrintDataTo(StringStream* stream); 222 virtual void PrintDataTo(StringStream* stream);
222 virtual void PrintOutputOperandTo(StringStream* stream); 223 virtual void PrintOutputOperandTo(StringStream* stream);
223 224
224 enum Opcode { 225 enum Opcode {
225 // Declare a unique enum value for each instruction. 226 // Declare a unique enum value for each instruction.
(...skipping 18 matching lines...) Expand all
244 virtual bool IsControl() const { return false; } 245 virtual bool IsControl() const { return false; }
245 246
246 void set_environment(LEnvironment* env) { environment_ = env; } 247 void set_environment(LEnvironment* env) { environment_ = env; }
247 LEnvironment* environment() const { return environment_; } 248 LEnvironment* environment() const { return environment_; }
248 bool HasEnvironment() const { return environment_ != NULL; } 249 bool HasEnvironment() const { return environment_ != NULL; }
249 250
250 void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); } 251 void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); }
251 LPointerMap* pointer_map() const { return pointer_map_.get(); } 252 LPointerMap* pointer_map() const { return pointer_map_.get(); }
252 bool HasPointerMap() const { return pointer_map_.is_set(); } 253 bool HasPointerMap() const { return pointer_map_.is_set(); }
253 254
255 // The 31 bits PositionBits is used to store the int position value. And the
256 // position value may be RelocInfo::kNoPosition (-1). The accessor always
257 // +1/-1 so that the encoded value of position in bit_field_ is always >= 0
258 // and can fit into the 31 bits PositionBits.
259 void set_position(int pos) {
260 bit_field_ = PositionBits::update(bit_field_, pos + 1);
261 }
262 int position() { return PositionBits::decode(bit_field_) - 1; }
254 263
255 void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; } 264 void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; }
256 HValue* hydrogen_value() const { return hydrogen_value_; } 265 HValue* hydrogen_value() const { return hydrogen_value_; }
257 266
258 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { } 267 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { }
259 268
260 void MarkAsCall() { is_call_ = true; } 269 void MarkAsCall() { bit_field_ = IsCallBits::update(bit_field_, true); }
261 270
262 // Interface to the register allocator and iterators. 271 // Interface to the register allocator and iterators.
263 bool ClobbersTemps() const { return is_call_; } 272 bool ClobbersTemps() const { return IsCallBits::decode(bit_field_); }
264 bool ClobbersRegisters() const { return is_call_; } 273 bool ClobbersRegisters() const { return IsCallBits::decode(bit_field_); }
265 virtual bool ClobbersDoubleRegisters() const { 274 virtual bool ClobbersDoubleRegisters() const {
266 return is_call_ || 275 return IsCallBits::decode(bit_field_) ||
267 (!CpuFeatures::IsSupported(SSE2) && 276 (!CpuFeatures::IsSupported(SSE2) &&
268 // We only have rudimentary X87Stack tracking, thus in general 277 // We only have rudimentary X87Stack tracking, thus in general
269 // cannot handle deoptimization nor phi-nodes. 278 // cannot handle deoptimization nor phi-nodes.
270 (HasEnvironment() || IsControl())); 279 (HasEnvironment() || IsControl()));
271 } 280 }
272 281
273 virtual bool HasResult() const = 0; 282 virtual bool HasResult() const = 0;
274 virtual LOperand* result() const = 0; 283 virtual LOperand* result() const = 0;
275 284
276 bool HasDoubleRegisterResult(); 285 bool HasDoubleRegisterResult();
(...skipping 15 matching lines...) Expand all
292 virtual int InputCount() = 0; 301 virtual int InputCount() = 0;
293 virtual LOperand* InputAt(int i) = 0; 302 virtual LOperand* InputAt(int i) = 0;
294 303
295 friend class TempIterator; 304 friend class TempIterator;
296 virtual int TempCount() = 0; 305 virtual int TempCount() = 0;
297 virtual LOperand* TempAt(int i) = 0; 306 virtual LOperand* TempAt(int i) = 0;
298 307
299 LEnvironment* environment_; 308 LEnvironment* environment_;
300 SetOncePointer<LPointerMap> pointer_map_; 309 SetOncePointer<LPointerMap> pointer_map_;
301 HValue* hydrogen_value_; 310 HValue* hydrogen_value_;
302 bool is_call_; 311 int bit_field_;
312 class IsCallBits: public BitField<bool, 0, 1> {};
313 class PositionBits: public BitField<int, 1, 31> {};
303 }; 314 };
304 315
305 316
306 // R = number of result operands (0 or 1). 317 // R = number of result operands (0 or 1).
307 // I = number of input operands. 318 // I = number of input operands.
308 // T = number of temporary operands. 319 // T = number of temporary operands.
309 template<int R, int I, int T> 320 template<int R, int I, int T>
310 class LTemplateInstruction: public LInstruction { 321 class LTemplateInstruction: public LInstruction {
311 public: 322 public:
312 // Allow 0 or 1 output operands. 323 // Allow 0 or 1 output operands.
(...skipping 2619 matching lines...) Expand 10 before | Expand all | Expand 10 after
2932 2943
2933 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2944 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2934 }; 2945 };
2935 2946
2936 #undef DECLARE_HYDROGEN_ACCESSOR 2947 #undef DECLARE_HYDROGEN_ACCESSOR
2937 #undef DECLARE_CONCRETE_INSTRUCTION 2948 #undef DECLARE_CONCRETE_INSTRUCTION
2938 2949
2939 } } // namespace v8::internal 2950 } } // namespace v8::internal
2940 2951
2941 #endif // V8_IA32_LITHIUM_IA32_H_ 2952 #endif // V8_IA32_LITHIUM_IA32_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698