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

Side by Side Diff: src/safepoint-table.h

Issue 5699002: RFC: Switch to ast ids (instead of positions) for type feedback. (Closed)
Patch Set: Cleanup Created 10 years 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
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 return kHeaderSize + 45 return kHeaderSize +
46 (length_ * (kPcAndDeoptimizationIndexSize + entry_size_)); } 46 (length_ * (kPcAndDeoptimizationIndexSize + entry_size_)); }
47 unsigned length() const { return length_; } 47 unsigned length() const { return length_; }
48 unsigned entry_size() const { return entry_size_; } 48 unsigned entry_size() const { return entry_size_; }
49 49
50 unsigned GetPcOffset(unsigned index) const { 50 unsigned GetPcOffset(unsigned index) const {
51 ASSERT(index < length_); 51 ASSERT(index < length_);
52 return Memory::uint32_at(GetPcOffsetLocation(index)); 52 return Memory::uint32_at(GetPcOffsetLocation(index));
53 } 53 }
54 54
55 int GetDeoptimizationIndex(unsigned index) const { 55 AstId GetDeoptimizationIndex(unsigned index) const {
56 ASSERT(index < length_); 56 ASSERT(index < length_);
57 unsigned value = Memory::uint32_at(GetDeoptimizationLocation(index)); 57 unsigned value = Memory::uint32_at(GetDeoptimizationLocation(index));
58 return DeoptimizationIndexField::decode(value); 58 return static_cast<AstId>(DeoptimizationIndexField::decode(value));
59 } 59 }
60 60
61 unsigned GetGapCodeSize(unsigned index) const { 61 unsigned GetGapCodeSize(unsigned index) const {
62 ASSERT(index < length_); 62 ASSERT(index < length_);
63 unsigned value = Memory::uint32_at(GetDeoptimizationLocation(index)); 63 unsigned value = Memory::uint32_at(GetDeoptimizationLocation(index));
64 return GapCodeSizeField::decode(value); 64 return GapCodeSizeField::decode(value);
65 } 65 }
66 66
67 uint8_t* GetEntry(unsigned index) const { 67 uint8_t* GetEntry(unsigned index) const {
68 ASSERT(index < length_); 68 ASSERT(index < length_);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 107
108 Address pc_and_deoptimization_indexes_; 108 Address pc_and_deoptimization_indexes_;
109 Address entries_; 109 Address entries_;
110 110
111 friend class SafepointTableBuilder; 111 friend class SafepointTableBuilder;
112 }; 112 };
113 113
114 114
115 class Safepoint BASE_EMBEDDED { 115 class Safepoint BASE_EMBEDDED {
116 public: 116 public:
117 static const int kNoDeoptimizationIndex = 0x00ffffff; 117 static const AstId kNoDeoptimizationIndex = 0x00ffffff;
118 118
119 void DefinePointerSlot(int index) { indexes_->Add(index); } 119 void DefinePointerSlot(int index) { indexes_->Add(index); }
120 void DefinePointerRegister(Register reg) { registers_->Add(reg.code()); } 120 void DefinePointerRegister(Register reg) { registers_->Add(reg.code()); }
121 121
122 private: 122 private:
123 Safepoint(ZoneList<int>* indexes, ZoneList<int>* registers) : 123 Safepoint(ZoneList<int>* indexes, ZoneList<int>* registers) :
124 indexes_(indexes), registers_(registers) { } 124 indexes_(indexes), registers_(registers) { }
125 ZoneList<int>* indexes_; 125 ZoneList<int>* indexes_;
126 ZoneList<int>* registers_; 126 ZoneList<int>* registers_;
127 127
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 180
181 bool emitted_; 181 bool emitted_;
182 unsigned offset_; 182 unsigned offset_;
183 183
184 DISALLOW_COPY_AND_ASSIGN(SafepointTableBuilder); 184 DISALLOW_COPY_AND_ASSIGN(SafepointTableBuilder);
185 }; 185 };
186 186
187 } } // namespace v8::internal 187 } } // namespace v8::internal
188 188
189 #endif // V8_SAFEPOINT_TABLE_H_ 189 #endif // V8_SAFEPOINT_TABLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698