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

Side by Side Diff: src/arm/lithium-arm.cc

Issue 24438006: Refactor register allocator a little bit (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: One more ASSERT Created 7 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/arm/lithium-arm.h ('k') | src/ia32/lithium-ia32.h » ('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 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 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 value()->PrintTo(stream); 405 value()->PrintTo(stream);
406 } 406 }
407 407
408 408
409 void LTransitionElementsKind::PrintDataTo(StringStream* stream) { 409 void LTransitionElementsKind::PrintDataTo(StringStream* stream) {
410 object()->PrintTo(stream); 410 object()->PrintTo(stream);
411 stream->Add(" %p -> %p", *original_map(), *transitioned_map()); 411 stream->Add(" %p -> %p", *original_map(), *transitioned_map());
412 } 412 }
413 413
414 414
415 int LPlatformChunk::GetNextSpillIndex(bool is_double) { 415 int LPlatformChunk::GetNextSpillIndex(RegisterKind kind) {
416 // Skip a slot if for a double-width slot. 416 // Skip a slot if for a double-width slot.
417 if (is_double) spill_slot_count_++; 417 if (kind == DOUBLE_REGISTERS) spill_slot_count_++;
418 return spill_slot_count_++; 418 return spill_slot_count_++;
419 } 419 }
420 420
421 421
422 LOperand* LPlatformChunk::GetNextSpillSlot(bool is_double) { 422 LOperand* LPlatformChunk::GetNextSpillSlot(RegisterKind kind) {
423 int index = GetNextSpillIndex(is_double); 423 int index = GetNextSpillIndex(kind);
424 if (is_double) { 424 if (kind == DOUBLE_REGISTERS) {
425 return LDoubleStackSlot::Create(index, zone()); 425 return LDoubleStackSlot::Create(index, zone());
426 } else { 426 } else {
427 ASSERT(kind == GENERAL_REGISTERS);
427 return LStackSlot::Create(index, zone()); 428 return LStackSlot::Create(index, zone());
428 } 429 }
429 } 430 }
430 431
431 432
432 LPlatformChunk* LChunkBuilder::Build() { 433 LPlatformChunk* LChunkBuilder::Build() {
433 ASSERT(is_unused()); 434 ASSERT(is_unused());
434 chunk_ = new(zone()) LPlatformChunk(info(), graph()); 435 chunk_ = new(zone()) LPlatformChunk(info(), graph());
435 LPhase phase("L_Building chunk", chunk_); 436 LPhase phase("L_Building chunk", chunk_);
436 status_ = BUILDING; 437 status_ = BUILDING;
437 438
438 // If compiling for OSR, reserve space for the unoptimized frame, 439 // If compiling for OSR, reserve space for the unoptimized frame,
439 // which will be subsumed into this frame. 440 // which will be subsumed into this frame.
440 if (graph()->has_osr()) { 441 if (graph()->has_osr()) {
441 for (int i = graph()->osr()->UnoptimizedFrameSlots(); i > 0; i--) { 442 for (int i = graph()->osr()->UnoptimizedFrameSlots(); i > 0; i--) {
442 chunk_->GetNextSpillIndex(false); 443 chunk_->GetNextSpillIndex(GENERAL_REGISTERS);
443 } 444 }
444 } 445 }
445 446
446 const ZoneList<HBasicBlock*>* blocks = graph()->blocks(); 447 const ZoneList<HBasicBlock*>* blocks = graph()->blocks();
447 for (int i = 0; i < blocks->length(); i++) { 448 for (int i = 0; i < blocks->length(); i++) {
448 HBasicBlock* next = NULL; 449 HBasicBlock* next = NULL;
449 if (i < blocks->length() - 1) next = blocks->at(i + 1); 450 if (i < blocks->length() - 1) next = blocks->at(i + 1);
450 DoBasicBlock(blocks->at(i), next); 451 DoBasicBlock(blocks->at(i), next);
451 if (is_aborted()) return NULL; 452 if (is_aborted()) return NULL;
452 } 453 }
(...skipping 2148 matching lines...) Expand 10 before | Expand all | Expand 10 after
2601 2602
2602 2603
2603 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2604 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2604 LOperand* object = UseRegister(instr->object()); 2605 LOperand* object = UseRegister(instr->object());
2605 LOperand* index = UseRegister(instr->index()); 2606 LOperand* index = UseRegister(instr->index());
2606 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); 2607 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index));
2607 } 2608 }
2608 2609
2609 2610
2610 } } // namespace v8::internal 2611 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-arm.h ('k') | src/ia32/lithium-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698