| 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 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 } | 300 } |
| 301 if (FLAG_trace_codegen) { | 301 if (FLAG_trace_codegen) { |
| 302 PrintF("Full Compiler - "); | 302 PrintF("Full Compiler - "); |
| 303 } | 303 } |
| 304 CodeGenerator::MakeCodePrologue(info); | 304 CodeGenerator::MakeCodePrologue(info); |
| 305 const int kInitialBufferSize = 4 * KB; | 305 const int kInitialBufferSize = 4 * KB; |
| 306 MacroAssembler masm(info->isolate(), NULL, kInitialBufferSize); | 306 MacroAssembler masm(info->isolate(), NULL, kInitialBufferSize); |
| 307 #ifdef ENABLE_GDB_JIT_INTERFACE | 307 #ifdef ENABLE_GDB_JIT_INTERFACE |
| 308 masm.positions_recorder()->StartGDBJITLineInfoRecording(); | 308 masm.positions_recorder()->StartGDBJITLineInfoRecording(); |
| 309 #endif | 309 #endif |
| 310 LOG_CODE_EVENT(isolate, |
| 311 CodeStartLinePosInfoRecordEvent(masm.positions_recorder())); |
| 310 | 312 |
| 311 FullCodeGenerator cgen(&masm, info); | 313 FullCodeGenerator cgen(&masm, info); |
| 312 cgen.Generate(); | 314 cgen.Generate(); |
| 313 if (cgen.HasStackOverflow()) { | 315 if (cgen.HasStackOverflow()) { |
| 314 ASSERT(!isolate->has_pending_exception()); | 316 ASSERT(!isolate->has_pending_exception()); |
| 315 return false; | 317 return false; |
| 316 } | 318 } |
| 317 unsigned table_offset = cgen.EmitStackCheckTable(); | 319 unsigned table_offset = cgen.EmitStackCheckTable(); |
| 318 | 320 |
| 319 Code::Flags flags = Code::ComputeFlags(Code::FUNCTION); | 321 Code::Flags flags = Code::ComputeFlags(Code::FUNCTION); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 337 CodeGenerator::PrintCode(code, info); | 339 CodeGenerator::PrintCode(code, info); |
| 338 info->SetCode(code); // May be an empty handle. | 340 info->SetCode(code); // May be an empty handle. |
| 339 #ifdef ENABLE_GDB_JIT_INTERFACE | 341 #ifdef ENABLE_GDB_JIT_INTERFACE |
| 340 if (FLAG_gdbjit && !code.is_null()) { | 342 if (FLAG_gdbjit && !code.is_null()) { |
| 341 GDBJITLineInfo* lineinfo = | 343 GDBJITLineInfo* lineinfo = |
| 342 masm.positions_recorder()->DetachGDBJITLineInfo(); | 344 masm.positions_recorder()->DetachGDBJITLineInfo(); |
| 343 | 345 |
| 344 GDBJIT(RegisterDetailedLineInfo(*code, lineinfo)); | 346 GDBJIT(RegisterDetailedLineInfo(*code, lineinfo)); |
| 345 } | 347 } |
| 346 #endif | 348 #endif |
| 349 if (!code.is_null()) { |
| 350 void* line_info = |
| 351 masm.positions_recorder()->DetachJITHandlerData(); |
| 352 LOG_CODE_EVENT(isolate, CodeEndLinePosInfoRecordEvent(*code, line_info)); |
| 353 } |
| 347 return !code.is_null(); | 354 return !code.is_null(); |
| 348 } | 355 } |
| 349 | 356 |
| 350 | 357 |
| 351 unsigned FullCodeGenerator::EmitStackCheckTable() { | 358 unsigned FullCodeGenerator::EmitStackCheckTable() { |
| 352 // The stack check table consists of a length (in number of entries) | 359 // The stack check table consists of a length (in number of entries) |
| 353 // field, and then a sequence of entries. Each entry is a pair of AST id | 360 // field, and then a sequence of entries. Each entry is a pair of AST id |
| 354 // and code-relative pc offset. | 361 // and code-relative pc offset. |
| 355 masm()->Align(kIntSize); | 362 masm()->Align(kIntSize); |
| 356 unsigned offset = masm()->pc_offset(); | 363 unsigned offset = masm()->pc_offset(); |
| (...skipping 1211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1568 } | 1575 } |
| 1569 | 1576 |
| 1570 return false; | 1577 return false; |
| 1571 } | 1578 } |
| 1572 | 1579 |
| 1573 | 1580 |
| 1574 #undef __ | 1581 #undef __ |
| 1575 | 1582 |
| 1576 | 1583 |
| 1577 } } // namespace v8::internal | 1584 } } // namespace v8::internal |
| OLD | NEW |