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

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

Issue 16381006: Change PC for OSR entries to point to something more sensible (i.e. the first UnknownOsrValue), rem… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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
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 1075 matching lines...) Expand 10 before | Expand all | Expand 10 after
1086 assigned_double_registers_->Clear(); 1086 assigned_double_registers_->Clear();
1087 MeetRegisterConstraints(); 1087 MeetRegisterConstraints();
1088 if (!AllocationOk()) return false; 1088 if (!AllocationOk()) return false;
1089 ResolvePhis(); 1089 ResolvePhis();
1090 BuildLiveRanges(); 1090 BuildLiveRanges();
1091 AllocateGeneralRegisters(); 1091 AllocateGeneralRegisters();
1092 if (!AllocationOk()) return false; 1092 if (!AllocationOk()) return false;
1093 AllocateDoubleRegisters(); 1093 AllocateDoubleRegisters();
1094 if (!AllocationOk()) return false; 1094 if (!AllocationOk()) return false;
1095 PopulatePointerMaps(); 1095 PopulatePointerMaps();
1096 if (has_osr_entry_) ProcessOsrEntry();
1097 ConnectRanges(); 1096 ConnectRanges();
1098 ResolveControlFlow(); 1097 ResolveControlFlow();
1099 return true; 1098 return true;
1100 } 1099 }
1101 1100
1102 1101
1103 void LAllocator::MeetRegisterConstraints() { 1102 void LAllocator::MeetRegisterConstraints() {
1104 HPhase phase("L_Register constraints", chunk_); 1103 HPhase phase("L_Register constraints", chunk_);
1105 first_artificial_register_ = next_virtual_register_; 1104 first_artificial_register_ = next_virtual_register_;
1106 const ZoneList<HBasicBlock*>* blocks = graph_->blocks(); 1105 const ZoneList<HBasicBlock*>* blocks = graph_->blocks();
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
1457 cur->id(), cur->Start().Value(), safe_point); 1456 cur->id(), cur->Start().Value(), safe_point);
1458 LOperand* operand = cur->CreateAssignedOperand(zone_); 1457 LOperand* operand = cur->CreateAssignedOperand(zone_);
1459 ASSERT(!operand->IsStackSlot()); 1458 ASSERT(!operand->IsStackSlot());
1460 map->RecordPointer(operand, zone()); 1459 map->RecordPointer(operand, zone());
1461 } 1460 }
1462 } 1461 }
1463 } 1462 }
1464 } 1463 }
1465 1464
1466 1465
1467 void LAllocator::ProcessOsrEntry() {
Michael Starzinger 2013/06/11 17:24:07 Also remove the declaration of this method in the
titzer 2013/06/12 09:30:04 Done.
1468 const ZoneList<LInstruction*>* instrs = chunk_->instructions();
1469
1470 // Linear search for the OSR entry instruction in the chunk.
1471 int index = -1;
1472 while (++index < instrs->length() &&
1473 !instrs->at(index)->IsOsrEntry()) {
1474 }
1475 ASSERT(index < instrs->length());
1476 LOsrEntry* instruction = LOsrEntry::cast(instrs->at(index));
1477
1478 LifetimePosition position = LifetimePosition::FromInstructionIndex(index);
1479 for (int i = 0; i < live_ranges()->length(); ++i) {
1480 LiveRange* range = live_ranges()->at(i);
1481 if (range != NULL) {
1482 if (range->Covers(position) &&
1483 range->HasRegisterAssigned() &&
1484 range->TopLevel()->HasAllocatedSpillOperand()) {
1485 int reg_index = range->assigned_register();
1486 LOperand* spill_operand = range->TopLevel()->GetSpillOperand();
1487 if (range->IsDouble()) {
1488 instruction->MarkSpilledDoubleRegister(reg_index, spill_operand);
1489 } else {
1490 instruction->MarkSpilledRegister(reg_index, spill_operand);
1491 }
1492 }
1493 }
1494 }
1495 }
1496
1497
1498 void LAllocator::AllocateGeneralRegisters() { 1466 void LAllocator::AllocateGeneralRegisters() {
1499 HPhase phase("L_Allocate general registers", this); 1467 HPhase phase("L_Allocate general registers", this);
1500 num_registers_ = Register::NumAllocatableRegisters(); 1468 num_registers_ = Register::NumAllocatableRegisters();
1501 AllocateRegisters(); 1469 AllocateRegisters();
1502 } 1470 }
1503 1471
1504 1472
1505 void LAllocator::AllocateDoubleRegisters() { 1473 void LAllocator::AllocateDoubleRegisters() {
1506 HPhase phase("L_Allocate double registers", this); 1474 HPhase phase("L_Allocate double registers", this);
1507 num_registers_ = DoubleRegister::NumAllocatableRegisters(); 1475 num_registers_ = DoubleRegister::NumAllocatableRegisters();
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after
2186 LiveRange* current = live_ranges()->at(i); 2154 LiveRange* current = live_ranges()->at(i);
2187 if (current != NULL) current->Verify(); 2155 if (current != NULL) current->Verify();
2188 } 2156 }
2189 } 2157 }
2190 2158
2191 2159
2192 #endif 2160 #endif
2193 2161
2194 2162
2195 } } // namespace v8::internal 2163 } } // namespace v8::internal
OLDNEW
« src/deoptimizer.cc ('K') | « src/lithium.h ('k') | src/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698