| OLD | NEW |
| 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 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 info->set_bailout_reason("not enough virtual registers (regalloc)"); | 409 info->set_bailout_reason("not enough virtual registers (regalloc)"); |
| 410 return NULL; | 410 return NULL; |
| 411 } | 411 } |
| 412 | 412 |
| 413 return chunk; | 413 return chunk; |
| 414 } | 414 } |
| 415 | 415 |
| 416 | 416 |
| 417 Handle<Code> LChunk::Codegen(Code::Kind kind) { | 417 Handle<Code> LChunk::Codegen(Code::Kind kind) { |
| 418 MacroAssembler assembler(info()->isolate(), NULL, 0); | 418 MacroAssembler assembler(info()->isolate(), NULL, 0); |
| 419 LOG_CODE_EVENT(info()->isolate(), |
| 420 CodeStartLinePosInfoRecordEvent( |
| 421 assembler.positions_recorder())); |
| 419 LCodeGen generator(this, &assembler, info()); | 422 LCodeGen generator(this, &assembler, info()); |
| 420 | 423 |
| 421 MarkEmptyBlocks(); | 424 MarkEmptyBlocks(); |
| 422 | 425 |
| 423 if (generator.GenerateCode()) { | 426 if (generator.GenerateCode()) { |
| 424 if (FLAG_trace_codegen) { | 427 if (FLAG_trace_codegen) { |
| 425 PrintF("Crankshaft Compiler - "); | 428 PrintF("Crankshaft Compiler - "); |
| 426 } | 429 } |
| 427 CodeGenerator::MakeCodePrologue(info()); | 430 CodeGenerator::MakeCodePrologue(info()); |
| 428 Code::Flags flags = Code::ComputeFlags(kind); | 431 Code::Flags flags = Code::ComputeFlags(kind); |
| 429 Handle<Code> code = | 432 Handle<Code> code = |
| 430 CodeGenerator::MakeCodeEpilogue(&assembler, flags, info()); | 433 CodeGenerator::MakeCodeEpilogue(&assembler, flags, info()); |
| 431 generator.FinishCode(code); | 434 generator.FinishCode(code); |
| 435 |
| 436 if (!code.is_null()) { |
| 437 void* jit_handler_data = |
| 438 assembler.positions_recorder()->DetachJITHandlerData(); |
| 439 LOG_CODE_EVENT(info()->isolate(), |
| 440 CodeEndLinePosInfoRecordEvent(*code, jit_handler_data)); |
| 441 } |
| 442 |
| 432 if (FLAG_weak_embedded_maps_in_optimized_code) { | 443 if (FLAG_weak_embedded_maps_in_optimized_code) { |
| 433 RegisterDependentCodeForEmbeddedMaps(code); | 444 RegisterDependentCodeForEmbeddedMaps(code); |
| 434 } | 445 } |
| 446 |
| 435 CodeGenerator::PrintCode(code, info()); | 447 CodeGenerator::PrintCode(code, info()); |
| 436 return code; | 448 return code; |
| 437 } | 449 } |
| 438 return Handle<Code>::null(); | 450 return Handle<Code>::null(); |
| 439 } | 451 } |
| 440 | 452 |
| 441 | 453 |
| 442 void LChunk::RegisterDependentCodeForEmbeddedMaps(Handle<Code> code) { | 454 void LChunk::RegisterDependentCodeForEmbeddedMaps(Handle<Code> code) { |
| 443 ZoneList<Handle<Map> > maps(1, zone()); | 455 ZoneList<Handle<Map> > maps(1, zone()); |
| 444 int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); | 456 int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 457 // AddDependentCode can cause a GC, which would observe the state where | 469 // AddDependentCode can cause a GC, which would observe the state where |
| 458 // this code is not yet in the depended code lists of the embedded maps. | 470 // this code is not yet in the depended code lists of the embedded maps. |
| 459 NoWeakEmbeddedMapsVerificationScope disable_verification_of_embedded_maps; | 471 NoWeakEmbeddedMapsVerificationScope disable_verification_of_embedded_maps; |
| 460 #endif | 472 #endif |
| 461 for (int i = 0; i < maps.length(); i++) { | 473 for (int i = 0; i < maps.length(); i++) { |
| 462 maps.at(i)->AddDependentCode(code); | 474 maps.at(i)->AddDependentCode(code); |
| 463 } | 475 } |
| 464 } | 476 } |
| 465 | 477 |
| 466 } } // namespace v8::internal | 478 } } // namespace v8::internal |
| OLD | NEW |