| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "v8.h" | 5 #include "v8.h" |
| 6 #include "lithium.h" | 6 #include "lithium.h" |
| 7 #include "scopes.h" | 7 #include "scopes.h" |
| 8 #include "serialize.h" | 8 #include "serialize.h" |
| 9 | 9 |
| 10 #if V8_TARGET_ARCH_IA32 | 10 #if V8_TARGET_ARCH_IA32 |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 } | 231 } |
| 232 | 232 |
| 233 | 233 |
| 234 LChunk::LChunk(CompilationInfo* info, HGraph* graph) | 234 LChunk::LChunk(CompilationInfo* info, HGraph* graph) |
| 235 : spill_slot_count_(0), | 235 : spill_slot_count_(0), |
| 236 info_(info), | 236 info_(info), |
| 237 graph_(graph), | 237 graph_(graph), |
| 238 instructions_(32, graph->zone()), | 238 instructions_(32, graph->zone()), |
| 239 pointer_maps_(8, graph->zone()), | 239 pointer_maps_(8, graph->zone()), |
| 240 inlined_closures_(1, graph->zone()), | 240 inlined_closures_(1, graph->zone()), |
| 241 deprecation_dependencies_(MapLess(), MapAllocator(graph->zone())), | |
| 242 stability_dependencies_(MapLess(), MapAllocator(graph->zone())) { | 241 stability_dependencies_(MapLess(), MapAllocator(graph->zone())) { |
| 243 } | 242 } |
| 244 | 243 |
| 245 | 244 |
| 246 LLabel* LChunk::GetLabel(int block_id) const { | 245 LLabel* LChunk::GetLabel(int block_id) const { |
| 247 HBasicBlock* block = graph_->blocks()->at(block_id); | 246 HBasicBlock* block = graph_->blocks()->at(block_id); |
| 248 int first_instruction = block->first_instruction_index(); | 247 int first_instruction = block->first_instruction_index(); |
| 249 return LLabel::cast(instructions_[first_instruction]); | 248 return LLabel::cast(instructions_[first_instruction]); |
| 250 } | 249 } |
| 251 | 250 |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 } | 371 } |
| 373 | 372 |
| 374 | 373 |
| 375 Representation LChunk::LookupLiteralRepresentation( | 374 Representation LChunk::LookupLiteralRepresentation( |
| 376 LConstantOperand* operand) const { | 375 LConstantOperand* operand) const { |
| 377 return graph_->LookupValue(operand->index())->representation(); | 376 return graph_->LookupValue(operand->index())->representation(); |
| 378 } | 377 } |
| 379 | 378 |
| 380 | 379 |
| 381 void LChunk::CommitDependencies(Handle<Code> code) const { | 380 void LChunk::CommitDependencies(Handle<Code> code) const { |
| 382 for (MapSet::const_iterator it = deprecation_dependencies_.begin(), | |
| 383 iend = deprecation_dependencies_.end(); it != iend; ++it) { | |
| 384 Handle<Map> map = *it; | |
| 385 ASSERT(!map->is_deprecated()); | |
| 386 ASSERT(map->CanBeDeprecated()); | |
| 387 Map::AddDependentCode(map, DependentCode::kTransitionGroup, code); | |
| 388 } | |
| 389 | |
| 390 for (MapSet::const_iterator it = stability_dependencies_.begin(), | 381 for (MapSet::const_iterator it = stability_dependencies_.begin(), |
| 391 iend = stability_dependencies_.end(); it != iend; ++it) { | 382 iend = stability_dependencies_.end(); it != iend; ++it) { |
| 392 Handle<Map> map = *it; | 383 Handle<Map> map = *it; |
| 393 ASSERT(map->is_stable()); | 384 ASSERT(map->is_stable()); |
| 394 ASSERT(map->CanTransition()); | 385 ASSERT(map->CanTransition()); |
| 395 Map::AddDependentCode(map, DependentCode::kPrototypeCheckGroup, code); | 386 Map::AddDependentCode(map, DependentCode::kPrototypeCheckGroup, code); |
| 396 } | 387 } |
| 397 | 388 |
| 398 info_->CommitDependencies(code); | 389 info_->CommitDependencies(code); |
| 399 } | 390 } |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 618 | 609 |
| 619 | 610 |
| 620 LPhase::~LPhase() { | 611 LPhase::~LPhase() { |
| 621 if (ShouldProduceTraceOutput()) { | 612 if (ShouldProduceTraceOutput()) { |
| 622 isolate()->GetHTracer()->TraceLithium(name(), chunk_); | 613 isolate()->GetHTracer()->TraceLithium(name(), chunk_); |
| 623 } | 614 } |
| 624 } | 615 } |
| 625 | 616 |
| 626 | 617 |
| 627 } } // namespace v8::internal | 618 } } // namespace v8::internal |
| OLD | NEW |