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

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: Add --always-osr flag. 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
« no previous file with comments | « src/lithium-allocator.h ('k') | src/mips/lithium-codegen-mips.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 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 LAllocatorPhase phase("L_Register constraints", this); 1103 LAllocatorPhase phase("L_Register constraints", this);
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() {
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 LAllocatorPhase phase("L_Allocate general registers", this); 1467 LAllocatorPhase 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 LAllocatorPhase phase("L_Allocate double registers", this); 1474 LAllocatorPhase phase("L_Allocate double registers", this);
1507 num_registers_ = DoubleRegister::NumAllocatableRegisters(); 1475 num_registers_ = DoubleRegister::NumAllocatableRegisters();
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after
2198 isolate()->GetHTracer()->TraceLiveRanges(name(), allocator_); 2166 isolate()->GetHTracer()->TraceLiveRanges(name(), allocator_);
2199 } 2167 }
2200 2168
2201 #ifdef DEBUG 2169 #ifdef DEBUG
2202 if (allocator_ != NULL) allocator_->Verify(); 2170 if (allocator_ != NULL) allocator_->Verify();
2203 #endif 2171 #endif
2204 } 2172 }
2205 2173
2206 2174
2207 } } // namespace v8::internal 2175 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/lithium-allocator.h ('k') | src/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698