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

Side by Side Diff: src/lithium.cc

Issue 110573004: Merge bleeding_edge 17696:18016. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 7 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 | Annotate | Revision Log
OLDNEW
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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 void LPointerMap::PrintTo(StringStream* stream) { 226 void LPointerMap::PrintTo(StringStream* stream) {
227 stream->Add("{"); 227 stream->Add("{");
228 for (int i = 0; i < pointer_operands_.length(); ++i) { 228 for (int i = 0; i < pointer_operands_.length(); ++i) {
229 if (i != 0) stream->Add(";"); 229 if (i != 0) stream->Add(";");
230 pointer_operands_[i]->PrintTo(stream); 230 pointer_operands_[i]->PrintTo(stream);
231 } 231 }
232 stream->Add("}"); 232 stream->Add("}");
233 } 233 }
234 234
235 235
236 int ElementsKindToShiftSize(ElementsKind elements_kind) {
237 switch (elements_kind) {
238 case EXTERNAL_BYTE_ELEMENTS:
239 case EXTERNAL_PIXEL_ELEMENTS:
240 case EXTERNAL_UNSIGNED_BYTE_ELEMENTS:
241 return 0;
242 case EXTERNAL_SHORT_ELEMENTS:
243 case EXTERNAL_UNSIGNED_SHORT_ELEMENTS:
244 return 1;
245 case EXTERNAL_INT_ELEMENTS:
246 case EXTERNAL_UNSIGNED_INT_ELEMENTS:
247 case EXTERNAL_FLOAT_ELEMENTS:
248 return 2;
249 case EXTERNAL_DOUBLE_ELEMENTS:
250 case FAST_DOUBLE_ELEMENTS:
251 case FAST_HOLEY_DOUBLE_ELEMENTS:
252 return 3;
253 case FAST_SMI_ELEMENTS:
254 case FAST_ELEMENTS:
255 case FAST_HOLEY_SMI_ELEMENTS:
256 case FAST_HOLEY_ELEMENTS:
257 case DICTIONARY_ELEMENTS:
258 case NON_STRICT_ARGUMENTS_ELEMENTS:
259 return kPointerSizeLog2;
260 }
261 UNREACHABLE();
262 return 0;
263 }
264
265
266 int StackSlotOffset(int index) { 236 int StackSlotOffset(int index) {
267 if (index >= 0) { 237 if (index >= 0) {
268 // Local or spill slot. Skip the frame pointer, function, and 238 // Local or spill slot. Skip the frame pointer, function, and
269 // context in the fixed part of the frame. 239 // context in the fixed part of the frame.
270 return -(index + 3) * kPointerSize; 240 return -(index + 1) * kPointerSize -
241 StandardFrameConstants::kFixedFrameSizeFromFp;
271 } else { 242 } else {
272 // Incoming parameter. Skip the return address. 243 // Incoming parameter. Skip the return address.
273 return -(index + 1) * kPointerSize + kFPOnStackSize + kPCOnStackSize; 244 return -(index + 1) * kPointerSize + kFPOnStackSize + kPCOnStackSize;
274 } 245 }
275 } 246 }
276 247
277 248
278 LChunk::LChunk(CompilationInfo* info, HGraph* graph) 249 LChunk::LChunk(CompilationInfo* info, HGraph* graph)
279 : spill_slot_count_(0), 250 : spill_slot_count_(0),
280 info_(info), 251 info_(info),
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 LConstantOperand* LChunk::DefineConstantOperand(HConstant* constant) { 336 LConstantOperand* LChunk::DefineConstantOperand(HConstant* constant) {
366 return LConstantOperand::Create(constant->id(), zone()); 337 return LConstantOperand::Create(constant->id(), zone());
367 } 338 }
368 339
369 340
370 int LChunk::GetParameterStackSlot(int index) const { 341 int LChunk::GetParameterStackSlot(int index) const {
371 // The receiver is at index 0, the first parameter at index 1, so we 342 // The receiver is at index 0, the first parameter at index 1, so we
372 // shift all parameter indexes down by the number of parameters, and 343 // shift all parameter indexes down by the number of parameters, and
373 // make sure they end up negative so they are distinguishable from 344 // make sure they end up negative so they are distinguishable from
374 // spill slots. 345 // spill slots.
375 int result = index - info()->scope()->num_parameters() - 1; 346 int result = index - info()->num_parameters() - 1;
347
376 ASSERT(result < 0); 348 ASSERT(result < 0);
377 return result; 349 return result;
378 } 350 }
379 351
380 352
381 // A parameter relative to ebp in the arguments stub. 353 // A parameter relative to ebp in the arguments stub.
382 int LChunk::ParameterAt(int index) { 354 int LChunk::ParameterAt(int index) {
383 ASSERT(-1 <= index); // -1 is the receiver. 355 ASSERT(-1 <= index); // -1 is the receiver.
384 return (1 + info()->scope()->num_parameters() - index) * 356 return (1 + info()->scope()->num_parameters() - index) *
385 kPointerSize; 357 kPointerSize;
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 472
501 473
502 LPhase::~LPhase() { 474 LPhase::~LPhase() {
503 if (ShouldProduceTraceOutput()) { 475 if (ShouldProduceTraceOutput()) {
504 isolate()->GetHTracer()->TraceLithium(name(), chunk_); 476 isolate()->GetHTracer()->TraceLithium(name(), chunk_);
505 } 477 }
506 } 478 }
507 479
508 480
509 } } // namespace v8::internal 481 } } // namespace v8::internal
OLDNEW
« include/v8-platform.h ('K') | « src/lithium.h ('k') | src/mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698