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

Side by Side Diff: src/lithium.cc

Issue 8139027: Version 3.6.5 (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: '' Created 9 years, 2 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
« no previous file with comments | « src/lithium.h ('k') | src/lithium-allocator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
169 int ElementsKindToShiftSize(ElementsKind elements_kind) { 190 int ElementsKindToShiftSize(ElementsKind elements_kind) {
170 switch (elements_kind) { 191 switch (elements_kind) {
171 case EXTERNAL_BYTE_ELEMENTS: 192 case EXTERNAL_BYTE_ELEMENTS:
172 case EXTERNAL_PIXEL_ELEMENTS: 193 case EXTERNAL_PIXEL_ELEMENTS:
173 case EXTERNAL_UNSIGNED_BYTE_ELEMENTS: 194 case EXTERNAL_UNSIGNED_BYTE_ELEMENTS:
174 return 0; 195 return 0;
175 case EXTERNAL_SHORT_ELEMENTS: 196 case EXTERNAL_SHORT_ELEMENTS:
176 case EXTERNAL_UNSIGNED_SHORT_ELEMENTS: 197 case EXTERNAL_UNSIGNED_SHORT_ELEMENTS:
177 return 1; 198 return 1;
178 case EXTERNAL_INT_ELEMENTS: 199 case EXTERNAL_INT_ELEMENTS:
179 case EXTERNAL_UNSIGNED_INT_ELEMENTS: 200 case EXTERNAL_UNSIGNED_INT_ELEMENTS:
180 case EXTERNAL_FLOAT_ELEMENTS: 201 case EXTERNAL_FLOAT_ELEMENTS:
181 return 2; 202 return 2;
182 case EXTERNAL_DOUBLE_ELEMENTS: 203 case EXTERNAL_DOUBLE_ELEMENTS:
183 case FAST_DOUBLE_ELEMENTS: 204 case FAST_DOUBLE_ELEMENTS:
184 return 3; 205 return 3;
206 case FAST_SMI_ONLY_ELEMENTS:
185 case FAST_ELEMENTS: 207 case FAST_ELEMENTS:
186 case DICTIONARY_ELEMENTS: 208 case DICTIONARY_ELEMENTS:
187 case NON_STRICT_ARGUMENTS_ELEMENTS: 209 case NON_STRICT_ARGUMENTS_ELEMENTS:
188 return kPointerSizeLog2; 210 return kPointerSizeLog2;
189 } 211 }
190 UNREACHABLE(); 212 UNREACHABLE();
191 return 0; 213 return 0;
192 } 214 }
193 215
194 216
195 } } // namespace v8::internal 217 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/lithium.h ('k') | src/lithium-allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698