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 | 310 if (FLAG_jit_profile) { |
danno
2012/12/20 16:27:20
See comment in flags-definition.h
| |
311 JITCodeLineInfo* lineinfo = masm.positions_recorder()-> | |
312 InitializeJITLineInfo(); | |
danno
2012/12/20 16:27:20
nit: indentation should be 4 chars. Better yet, br
| |
313 LOG_CODE_EVENT(isolate, CodeStartLinePosInfoRecordEvent(lineinfo)); | |
314 } | |
311 FullCodeGenerator cgen(&masm, info); | 315 FullCodeGenerator cgen(&masm, info); |
312 cgen.Generate(); | 316 cgen.Generate(); |
313 if (cgen.HasStackOverflow()) { | 317 if (cgen.HasStackOverflow()) { |
314 ASSERT(!isolate->has_pending_exception()); | 318 ASSERT(!isolate->has_pending_exception()); |
315 return false; | 319 return false; |
316 } | 320 } |
317 unsigned table_offset = cgen.EmitStackCheckTable(); | 321 unsigned table_offset = cgen.EmitStackCheckTable(); |
318 | 322 |
319 Code::Flags flags = Code::ComputeFlags(Code::FUNCTION); | 323 Code::Flags flags = Code::ComputeFlags(Code::FUNCTION); |
320 Handle<Code> code = CodeGenerator::MakeCodeEpilogue(&masm, flags, info); | 324 Handle<Code> code = CodeGenerator::MakeCodeEpilogue(&masm, flags, info); |
(...skipping 16 matching lines...) Expand all Loading... | |
337 CodeGenerator::PrintCode(code, info); | 341 CodeGenerator::PrintCode(code, info); |
338 info->SetCode(code); // May be an empty handle. | 342 info->SetCode(code); // May be an empty handle. |
339 #ifdef ENABLE_GDB_JIT_INTERFACE | 343 #ifdef ENABLE_GDB_JIT_INTERFACE |
340 if (FLAG_gdbjit && !code.is_null()) { | 344 if (FLAG_gdbjit && !code.is_null()) { |
341 GDBJITLineInfo* lineinfo = | 345 GDBJITLineInfo* lineinfo = |
342 masm.positions_recorder()->DetachGDBJITLineInfo(); | 346 masm.positions_recorder()->DetachGDBJITLineInfo(); |
343 | 347 |
344 GDBJIT(RegisterDetailedLineInfo(*code, lineinfo)); | 348 GDBJIT(RegisterDetailedLineInfo(*code, lineinfo)); |
345 } | 349 } |
346 #endif | 350 #endif |
351 if (FLAG_jit_profile) { | |
352 if (!code.is_null()) { | |
353 void* lineinfo = masm.positions_recorder()->DetachJITLineInfo(); | |
354 LOG_CODE_EVENT(isolate, CodeEndLinePosInfoRecordEvent(*code, lineinfo)); | |
355 } | |
356 } | |
347 return !code.is_null(); | 357 return !code.is_null(); |
348 } | 358 } |
349 | 359 |
350 | 360 |
351 unsigned FullCodeGenerator::EmitStackCheckTable() { | 361 unsigned FullCodeGenerator::EmitStackCheckTable() { |
352 // The stack check table consists of a length (in number of entries) | 362 // 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 | 363 // field, and then a sequence of entries. Each entry is a pair of AST id |
354 // and code-relative pc offset. | 364 // and code-relative pc offset. |
355 masm()->Align(kIntSize); | 365 masm()->Align(kIntSize); |
356 unsigned offset = masm()->pc_offset(); | 366 unsigned offset = masm()->pc_offset(); |
(...skipping 1220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1577 } | 1587 } |
1578 | 1588 |
1579 return false; | 1589 return false; |
1580 } | 1590 } |
1581 | 1591 |
1582 | 1592 |
1583 #undef __ | 1593 #undef __ |
1584 | 1594 |
1585 | 1595 |
1586 } } // namespace v8::internal | 1596 } } // namespace v8::internal |
OLD | NEW |