OLD | NEW |
---|---|
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 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
726 DOUBLE, | 726 DOUBLE, |
727 LITERAL | 727 LITERAL |
728 }; | 728 }; |
729 | 729 |
730 SlotRef() | 730 SlotRef() |
731 : addr_(NULL), representation_(UNKNOWN) { } | 731 : addr_(NULL), representation_(UNKNOWN) { } |
732 | 732 |
733 SlotRef(Address addr, SlotRepresentation representation) | 733 SlotRef(Address addr, SlotRepresentation representation) |
734 : addr_(addr), representation_(representation) { } | 734 : addr_(addr), representation_(representation) { } |
735 | 735 |
736 explicit SlotRef(Object* literal) | 736 explicit SlotRef(Isolate* isolate, Object* literal) |
Michael Starzinger
2013/02/25 10:50:58
No longer needs to be marked as "explicit" as it h
Sven Panne
2013/02/25 14:44:43
Done.
| |
737 : literal_(literal), representation_(LITERAL) { } | 737 : literal_(literal, isolate), representation_(LITERAL) { } |
738 | 738 |
739 Handle<Object> GetValue() { | 739 Handle<Object> GetValue(Isolate* isolate) { |
740 switch (representation_) { | 740 switch (representation_) { |
741 case TAGGED: | 741 case TAGGED: |
742 return Handle<Object>(Memory::Object_at(addr_)); | 742 return Handle<Object>(Memory::Object_at(addr_), isolate); |
743 | 743 |
744 case INT32: { | 744 case INT32: { |
745 int value = Memory::int32_at(addr_); | 745 int value = Memory::int32_at(addr_); |
746 if (Smi::IsValid(value)) { | 746 if (Smi::IsValid(value)) { |
747 return Handle<Object>(Smi::FromInt(value)); | 747 return Handle<Object>(Smi::FromInt(value), isolate); |
748 } else { | 748 } else { |
749 return Isolate::Current()->factory()->NewNumberFromInt(value); | 749 return isolate->factory()->NewNumberFromInt(value); |
750 } | 750 } |
751 } | 751 } |
752 | 752 |
753 case UINT32: { | 753 case UINT32: { |
754 uint32_t value = Memory::uint32_at(addr_); | 754 uint32_t value = Memory::uint32_at(addr_); |
755 if (value <= static_cast<uint32_t>(Smi::kMaxValue)) { | 755 if (value <= static_cast<uint32_t>(Smi::kMaxValue)) { |
756 return Handle<Object>(Smi::FromInt(static_cast<int>(value))); | 756 return Handle<Object>(Smi::FromInt(static_cast<int>(value)), isolate); |
757 } else { | 757 } else { |
758 return Isolate::Current()->factory()->NewNumber( | 758 return isolate->factory()->NewNumber(static_cast<double>(value)); |
759 static_cast<double>(value)); | |
760 } | 759 } |
761 } | 760 } |
762 | 761 |
763 case DOUBLE: { | 762 case DOUBLE: { |
764 double value = Memory::double_at(addr_); | 763 double value = Memory::double_at(addr_); |
765 return Isolate::Current()->factory()->NewNumber(value); | 764 return isolate->factory()->NewNumber(value); |
766 } | 765 } |
767 | 766 |
768 case LITERAL: | 767 case LITERAL: |
769 return literal_; | 768 return literal_; |
770 | 769 |
771 default: | 770 default: |
772 UNREACHABLE(); | 771 UNREACHABLE(); |
773 return Handle<Object>::null(); | 772 return Handle<Object>::null(); |
774 } | 773 } |
775 } | 774 } |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
878 Object** expression_stack_; | 877 Object** expression_stack_; |
879 int source_position_; | 878 int source_position_; |
880 | 879 |
881 friend class Deoptimizer; | 880 friend class Deoptimizer; |
882 }; | 881 }; |
883 #endif | 882 #endif |
884 | 883 |
885 } } // namespace v8::internal | 884 } } // namespace v8::internal |
886 | 885 |
887 #endif // V8_DEOPTIMIZER_H_ | 886 #endif // V8_DEOPTIMIZER_H_ |
OLD | NEW |