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 19 matching lines...) Expand all Loading... |
30 #include "codegen.h" | 30 #include "codegen.h" |
31 #include "compiler.h" | 31 #include "compiler.h" |
32 #include "debug.h" | 32 #include "debug.h" |
33 #include "full-codegen.h" | 33 #include "full-codegen.h" |
34 #include "liveedit.h" | 34 #include "liveedit.h" |
35 #include "macro-assembler.h" | 35 #include "macro-assembler.h" |
36 #include "prettyprinter.h" | 36 #include "prettyprinter.h" |
37 #include "scopes.h" | 37 #include "scopes.h" |
38 #include "scopeinfo.h" | 38 #include "scopeinfo.h" |
39 #include "stub-cache.h" | 39 #include "stub-cache.h" |
| 40 #include "third_party/vtune/vtune-jit.h" |
40 | 41 |
41 namespace v8 { | 42 namespace v8 { |
42 namespace internal { | 43 namespace internal { |
43 | 44 |
44 void BreakableStatementChecker::Check(Statement* stmt) { | 45 void BreakableStatementChecker::Check(Statement* stmt) { |
45 Visit(stmt); | 46 Visit(stmt); |
46 } | 47 } |
47 | 48 |
48 | 49 |
49 void BreakableStatementChecker::Check(Expression* expr) { | 50 void BreakableStatementChecker::Check(Expression* expr) { |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 if (FLAG_trace_codegen) { | 297 if (FLAG_trace_codegen) { |
297 PrintF("Full Compiler - "); | 298 PrintF("Full Compiler - "); |
298 } | 299 } |
299 CodeGenerator::MakeCodePrologue(info); | 300 CodeGenerator::MakeCodePrologue(info); |
300 const int kInitialBufferSize = 4 * KB; | 301 const int kInitialBufferSize = 4 * KB; |
301 MacroAssembler masm(info->isolate(), NULL, kInitialBufferSize); | 302 MacroAssembler masm(info->isolate(), NULL, kInitialBufferSize); |
302 #ifdef ENABLE_GDB_JIT_INTERFACE | 303 #ifdef ENABLE_GDB_JIT_INTERFACE |
303 masm.positions_recorder()->StartGDBJITLineInfoRecording(); | 304 masm.positions_recorder()->StartGDBJITLineInfoRecording(); |
304 #endif | 305 #endif |
305 | 306 |
| 307 #ifdef ENABLE_VTUNE_JIT_INTERFACE |
| 308 masm.positions_recorder()->StartVtuneJITLineInfoRecording(); |
| 309 #endif |
| 310 |
306 FullCodeGenerator cgen(&masm, info); | 311 FullCodeGenerator cgen(&masm, info); |
307 cgen.Generate(); | 312 cgen.Generate(); |
308 if (cgen.HasStackOverflow()) { | 313 if (cgen.HasStackOverflow()) { |
309 ASSERT(!isolate->has_pending_exception()); | 314 ASSERT(!isolate->has_pending_exception()); |
310 return false; | 315 return false; |
311 } | 316 } |
312 unsigned table_offset = cgen.EmitStackCheckTable(); | 317 unsigned table_offset = cgen.EmitStackCheckTable(); |
313 | 318 |
314 Code::Flags flags = Code::ComputeFlags(Code::FUNCTION); | 319 Code::Flags flags = Code::ComputeFlags(Code::FUNCTION); |
315 Handle<Code> code = CodeGenerator::MakeCodeEpilogue(&masm, flags, info); | 320 Handle<Code> code = CodeGenerator::MakeCodeEpilogue(&masm, flags, info); |
(...skipping 16 matching lines...) Expand all Loading... |
332 CodeGenerator::PrintCode(code, info); | 337 CodeGenerator::PrintCode(code, info); |
333 info->SetCode(code); // May be an empty handle. | 338 info->SetCode(code); // May be an empty handle. |
334 #ifdef ENABLE_GDB_JIT_INTERFACE | 339 #ifdef ENABLE_GDB_JIT_INTERFACE |
335 if (FLAG_gdbjit && !code.is_null()) { | 340 if (FLAG_gdbjit && !code.is_null()) { |
336 GDBJITLineInfo* lineinfo = | 341 GDBJITLineInfo* lineinfo = |
337 masm.positions_recorder()->DetachGDBJITLineInfo(); | 342 masm.positions_recorder()->DetachGDBJITLineInfo(); |
338 | 343 |
339 GDBJIT(RegisterDetailedLineInfo(*code, lineinfo)); | 344 GDBJIT(RegisterDetailedLineInfo(*code, lineinfo)); |
340 } | 345 } |
341 #endif | 346 #endif |
| 347 #ifdef ENABLE_VTUNE_JIT_INTERFACE |
| 348 if (VTUNERUNNING) { |
| 349 if (!code.is_null()) { |
| 350 VtuneJITLineInfo* vtunelineinfo = |
| 351 masm.positions_recorder()->DetachVtuneJITLineInfo(); |
| 352 |
| 353 VTUNEJIT(RegisterDetailedLineInfo(*code, vtunelineinfo)); |
| 354 } |
| 355 if (!info->shared_info().is_null()) { |
| 356 Handle<SharedFunctionInfo> shared = info->shared_info(); |
| 357 if (shared->DebugName()->IsString()) |
| 358 VTUNEJIT(AddCode(Handle<String>(shared->DebugName()), code, script)); |
| 359 else |
| 360 VTUNEJIT(AddCode(Handle<String>(), code, script)); |
| 361 } |
| 362 } |
| 363 #endif |
| 364 |
342 return !code.is_null(); | 365 return !code.is_null(); |
343 } | 366 } |
344 | 367 |
345 | 368 |
346 unsigned FullCodeGenerator::EmitStackCheckTable() { | 369 unsigned FullCodeGenerator::EmitStackCheckTable() { |
347 // The stack check table consists of a length (in number of entries) | 370 // The stack check table consists of a length (in number of entries) |
348 // field, and then a sequence of entries. Each entry is a pair of AST id | 371 // field, and then a sequence of entries. Each entry is a pair of AST id |
349 // and code-relative pc offset. | 372 // and code-relative pc offset. |
350 masm()->Align(kIntSize); | 373 masm()->Align(kIntSize); |
351 unsigned offset = masm()->pc_offset(); | 374 unsigned offset = masm()->pc_offset(); |
(...skipping 1054 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1406 } | 1429 } |
1407 | 1430 |
1408 return false; | 1431 return false; |
1409 } | 1432 } |
1410 | 1433 |
1411 | 1434 |
1412 #undef __ | 1435 #undef __ |
1413 | 1436 |
1414 | 1437 |
1415 } } // namespace v8::internal | 1438 } } // namespace v8::internal |
OLD | NEW |