OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 | 149 |
150 | 150 |
151 void LPointerMap::RecordPointer(LOperand* op) { | 151 void LPointerMap::RecordPointer(LOperand* op) { |
152 // Do not record arguments as pointers. | 152 // Do not record arguments as pointers. |
153 if (op->IsStackSlot() && op->index() < 0) return; | 153 if (op->IsStackSlot() && op->index() < 0) return; |
154 ASSERT(!op->IsDoubleRegister() && !op->IsDoubleStackSlot()); | 154 ASSERT(!op->IsDoubleRegister() && !op->IsDoubleStackSlot()); |
155 pointer_operands_.Add(op); | 155 pointer_operands_.Add(op); |
156 } | 156 } |
157 | 157 |
158 | 158 |
| 159 void LPointerMap::RemovePointer(LOperand* op) { |
| 160 // Do not record arguments as pointers. |
| 161 if (op->IsStackSlot() && op->index() < 0) return; |
| 162 ASSERT(!op->IsDoubleRegister() && !op->IsDoubleStackSlot()); |
| 163 for (int i = 0; i < pointer_operands_.length(); ++i) { |
| 164 if (pointer_operands_[i]->Equals(op)) { |
| 165 pointer_operands_.Remove(i); |
| 166 --i; |
| 167 } |
| 168 } |
| 169 } |
| 170 |
| 171 |
| 172 void LPointerMap::RecordUntagged(LOperand* op) { |
| 173 // Do not record arguments as pointers. |
| 174 if (op->IsStackSlot() && op->index() < 0) return; |
| 175 ASSERT(!op->IsDoubleRegister() && !op->IsDoubleStackSlot()); |
| 176 untagged_operands_.Add(op); |
| 177 } |
| 178 |
| 179 |
159 void LPointerMap::PrintTo(StringStream* stream) { | 180 void LPointerMap::PrintTo(StringStream* stream) { |
160 stream->Add("{"); | 181 stream->Add("{"); |
161 for (int i = 0; i < pointer_operands_.length(); ++i) { | 182 for (int i = 0; i < pointer_operands_.length(); ++i) { |
162 if (i != 0) stream->Add(";"); | 183 if (i != 0) stream->Add(";"); |
163 pointer_operands_[i]->PrintTo(stream); | 184 pointer_operands_[i]->PrintTo(stream); |
164 } | 185 } |
165 stream->Add("} @%d", position()); | 186 stream->Add("} @%d", position()); |
166 } | 187 } |
167 | 188 |
168 | 189 |
(...skipping 17 matching lines...) Expand all Loading... |
186 case DICTIONARY_ELEMENTS: | 207 case DICTIONARY_ELEMENTS: |
187 case NON_STRICT_ARGUMENTS_ELEMENTS: | 208 case NON_STRICT_ARGUMENTS_ELEMENTS: |
188 return kPointerSizeLog2; | 209 return kPointerSizeLog2; |
189 } | 210 } |
190 UNREACHABLE(); | 211 UNREACHABLE(); |
191 return 0; | 212 return 0; |
192 } | 213 } |
193 | 214 |
194 | 215 |
195 } } // namespace v8::internal | 216 } } // namespace v8::internal |
OLD | NEW |