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 "src/crankshaft/lithium.h" | 5 #include "src/crankshaft/lithium.h" |
6 | 6 |
7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 | 8 |
9 #if V8_TARGET_ARCH_IA32 | 9 #if V8_TARGET_ARCH_IA32 |
10 #include "src/crankshaft/ia32/lithium-ia32.h" // NOLINT | 10 #include "src/crankshaft/ia32/lithium-ia32.h" // NOLINT |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 chunk->set_allocated_double_registers( | 441 chunk->set_allocated_double_registers( |
442 allocator.assigned_double_registers()); | 442 allocator.assigned_double_registers()); |
443 | 443 |
444 return chunk; | 444 return chunk; |
445 } | 445 } |
446 | 446 |
447 | 447 |
448 Handle<Code> LChunk::Codegen() { | 448 Handle<Code> LChunk::Codegen() { |
449 MacroAssembler assembler(info()->isolate(), NULL, 0, | 449 MacroAssembler assembler(info()->isolate(), NULL, 0, |
450 CodeObjectRequired::kYes); | 450 CodeObjectRequired::kYes); |
451 LOG_CODE_EVENT(info()->isolate(), | |
452 CodeStartLinePosInfoRecordEvent( | |
453 assembler.positions_recorder())); | |
454 // Code serializer only takes unoptimized code. | 451 // Code serializer only takes unoptimized code. |
455 DCHECK(!info()->will_serialize()); | 452 DCHECK(!info()->will_serialize()); |
456 LCodeGen generator(this, &assembler, info()); | 453 LCodeGen generator(this, &assembler, info()); |
457 | 454 |
| 455 LOG_CODE_EVENT(info()->isolate(), |
| 456 CodeStartLinePosInfoRecordEvent( |
| 457 generator.source_position_table_builder())); |
| 458 |
458 MarkEmptyBlocks(); | 459 MarkEmptyBlocks(); |
459 | 460 |
460 if (generator.GenerateCode()) { | 461 if (generator.GenerateCode()) { |
461 generator.CheckEnvironmentUsage(); | 462 generator.CheckEnvironmentUsage(); |
462 CodeGenerator::MakeCodePrologue(info(), "optimized"); | 463 CodeGenerator::MakeCodePrologue(info(), "optimized"); |
463 Handle<Code> code = CodeGenerator::MakeCodeEpilogue(&assembler, info()); | 464 Handle<Code> code = CodeGenerator::MakeCodeEpilogue(&assembler, info()); |
464 generator.FinishCode(code); | 465 generator.FinishCode(code); |
465 CommitDependencies(code); | 466 CommitDependencies(code); |
466 code->set_is_crankshafted(true); | 467 code->set_is_crankshafted(true); |
467 void* jit_handler_data = | 468 void* jit_handler_data = |
468 assembler.positions_recorder()->DetachJITHandlerData(); | 469 generator.source_position_table_builder()->DetachJITHandlerData(); |
469 LOG_CODE_EVENT(info()->isolate(), | 470 LOG_CODE_EVENT(info()->isolate(), |
470 CodeEndLinePosInfoRecordEvent(AbstractCode::cast(*code), | 471 CodeEndLinePosInfoRecordEvent(AbstractCode::cast(*code), |
471 jit_handler_data)); | 472 jit_handler_data)); |
472 | 473 |
473 CodeGenerator::PrintCode(code, info()); | 474 CodeGenerator::PrintCode(code, info()); |
474 DCHECK(!(info()->GetMustNotHaveEagerFrame() && | 475 DCHECK(!(info()->GetMustNotHaveEagerFrame() && |
475 generator.NeedsEagerFrame())); | 476 generator.NeedsEagerFrame())); |
476 return code; | 477 return code; |
477 } | 478 } |
478 assembler.AbortedCodeGeneration(); | 479 assembler.AbortedCodeGeneration(); |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
725 | 726 |
726 LPhase::~LPhase() { | 727 LPhase::~LPhase() { |
727 if (ShouldProduceTraceOutput()) { | 728 if (ShouldProduceTraceOutput()) { |
728 isolate()->GetHTracer()->TraceLithium(name(), chunk_); | 729 isolate()->GetHTracer()->TraceLithium(name(), chunk_); |
729 } | 730 } |
730 } | 731 } |
731 | 732 |
732 | 733 |
733 } // namespace internal | 734 } // namespace internal |
734 } // namespace v8 | 735 } // namespace v8 |
OLD | NEW |