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 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 value()->PrintTo(stream); | 400 value()->PrintTo(stream); |
401 } | 401 } |
402 | 402 |
403 | 403 |
404 void LTransitionElementsKind::PrintDataTo(StringStream* stream) { | 404 void LTransitionElementsKind::PrintDataTo(StringStream* stream) { |
405 object()->PrintTo(stream); | 405 object()->PrintTo(stream); |
406 stream->Add(" %p -> %p", *original_map(), *transitioned_map()); | 406 stream->Add(" %p -> %p", *original_map(), *transitioned_map()); |
407 } | 407 } |
408 | 408 |
409 | 409 |
410 int LChunk::GetNextSpillIndex(bool is_double) { | 410 int LPlatformChunk::GetNextSpillIndex(bool is_double) { |
411 // Skip a slot if for a double-width slot. | 411 // Skip a slot if for a double-width slot. |
412 if (is_double) spill_slot_count_++; | 412 if (is_double) spill_slot_count_++; |
413 return spill_slot_count_++; | 413 return spill_slot_count_++; |
414 } | 414 } |
415 | 415 |
416 | 416 |
417 LOperand* LChunk::GetNextSpillSlot(bool is_double) { | 417 LOperand* LPlatformChunk::GetNextSpillSlot(bool is_double) { |
418 int index = GetNextSpillIndex(is_double); | 418 int index = GetNextSpillIndex(is_double); |
419 if (is_double) { | 419 if (is_double) { |
420 return LDoubleStackSlot::Create(index, zone()); | 420 return LDoubleStackSlot::Create(index, zone()); |
421 } else { | 421 } else { |
422 return LStackSlot::Create(index, zone()); | 422 return LStackSlot::Create(index, zone()); |
423 } | 423 } |
424 } | 424 } |
425 | 425 |
426 | 426 |
427 LChunk* LChunkBuilder::Build() { | 427 LPlatformChunk* LChunkBuilder::Build() { |
428 ASSERT(is_unused()); | 428 ASSERT(is_unused()); |
429 chunk_ = new(zone()) LChunk(info(), graph()); | 429 chunk_ = new(zone()) LPlatformChunk(info(), graph()); |
430 HPhase phase("L_Building chunk", chunk_); | 430 HPhase phase("L_Building chunk", chunk_); |
431 status_ = BUILDING; | 431 status_ = BUILDING; |
432 const ZoneList<HBasicBlock*>* blocks = graph()->blocks(); | 432 const ZoneList<HBasicBlock*>* blocks = graph()->blocks(); |
433 for (int i = 0; i < blocks->length(); i++) { | 433 for (int i = 0; i < blocks->length(); i++) { |
434 HBasicBlock* next = NULL; | 434 HBasicBlock* next = NULL; |
435 if (i < blocks->length() - 1) next = blocks->at(i + 1); | 435 if (i < blocks->length() - 1) next = blocks->at(i + 1); |
436 DoBasicBlock(blocks->at(i), next); | 436 DoBasicBlock(blocks->at(i), next); |
437 if (is_aborted()) return NULL; | 437 if (is_aborted()) return NULL; |
438 } | 438 } |
439 status_ = DONE; | 439 status_ = DONE; |
440 return chunk_; | 440 return chunk_; |
441 } | 441 } |
442 | 442 |
443 | 443 |
444 void LChunkBuilder::Abort(const char* format, ...) { | 444 void LChunkBuilder::Abort(const char* format, ...) { |
445 if (FLAG_trace_bailout) { | 445 if (FLAG_trace_bailout) { |
446 SmartArrayPointer<char> name( | 446 SmartArrayPointer<char> name( |
447 info()->shared_info()->DebugName()->ToCString()); | 447 info()->shared_info()->DebugName()->ToCString()); |
448 PrintF("Aborting LChunk building in @\"%s\": ", *name); | 448 PrintF("Aborting LPlatformChunk building in @\"%s\": ", *name); |
449 va_list arguments; | 449 va_list arguments; |
450 va_start(arguments, format); | 450 va_start(arguments, format); |
451 OS::VPrint(format, arguments); | 451 OS::VPrint(format, arguments); |
452 va_end(arguments); | 452 va_end(arguments); |
453 PrintF("\n"); | 453 PrintF("\n"); |
454 } | 454 } |
455 status_ = ABORTED; | 455 status_ = ABORTED; |
456 } | 456 } |
457 | 457 |
458 | 458 |
(...skipping 1815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2274 | 2274 |
2275 | 2275 |
2276 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2276 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2277 LOperand* object = UseRegister(instr->object()); | 2277 LOperand* object = UseRegister(instr->object()); |
2278 LOperand* index = UseRegister(instr->index()); | 2278 LOperand* index = UseRegister(instr->index()); |
2279 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2279 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
2280 } | 2280 } |
2281 | 2281 |
2282 | 2282 |
2283 } } // namespace v8::internal | 2283 } } // namespace v8::internal |
OLD | NEW |