OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_ | 5 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_ |
6 #define V8_HYDROGEN_INSTRUCTIONS_H_ | 6 #define V8_HYDROGEN_INSTRUCTIONS_H_ |
7 | 7 |
8 #include <cstring> | 8 #include <cstring> |
9 #include <iosfwd> | 9 #include <iosfwd> |
10 | 10 |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 // inlined function. | 419 // inlined function. |
420 // When the flag is not set we simply track absolute offset from the | 420 // When the flag is not set we simply track absolute offset from the |
421 // script start. | 421 // script start. |
422 class HSourcePosition { | 422 class HSourcePosition { |
423 public: | 423 public: |
424 HSourcePosition(const HSourcePosition& other) : value_(other.value_) { } | 424 HSourcePosition(const HSourcePosition& other) : value_(other.value_) { } |
425 | 425 |
426 static HSourcePosition Unknown() { | 426 static HSourcePosition Unknown() { |
427 return HSourcePosition(RelocInfo::kNoPosition); | 427 return HSourcePosition(RelocInfo::kNoPosition); |
428 } | 428 } |
| 429 static HSourcePosition FromRaw(int raw_value) { |
| 430 return HSourcePosition(raw_value); |
| 431 } |
429 | 432 |
430 bool IsUnknown() const { return value_ == RelocInfo::kNoPosition; } | 433 bool IsUnknown() const { return value_ == RelocInfo::kNoPosition; } |
431 | 434 |
432 int position() const { return PositionField::decode(value_); } | 435 int position() const { return PositionField::decode(value_); } |
433 void set_position(int position) { | 436 void set_position(int position) { |
434 if (FLAG_hydrogen_track_positions) { | 437 if (FLAG_hydrogen_track_positions) { |
435 value_ = static_cast<int>(PositionField::update(value_, position)); | 438 value_ = static_cast<int>(PositionField::update(value_, position)); |
436 } else { | 439 } else { |
437 value_ = position; | 440 value_ = position; |
438 } | 441 } |
(...skipping 7559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7998 }; | 8001 }; |
7999 | 8002 |
8000 | 8003 |
8001 | 8004 |
8002 #undef DECLARE_INSTRUCTION | 8005 #undef DECLARE_INSTRUCTION |
8003 #undef DECLARE_CONCRETE_INSTRUCTION | 8006 #undef DECLARE_CONCRETE_INSTRUCTION |
8004 | 8007 |
8005 } } // namespace v8::internal | 8008 } } // namespace v8::internal |
8006 | 8009 |
8007 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 8010 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |