Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/full-codegen.cc

Issue 11552033: This patch is the propagation version of https://codereview.chromium.org/10824032 patch (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 (isolate->logger()->is_code_event_handler_enabled()) {
311 JITCodeLineInfo* lineinfo =
312 masm.positions_recorder()->InitializeJITLineInfo();
313 LOG_CODE_EVENT(isolate, CodeStartLinePosInfoRecordEvent(lineinfo));
danno 2013/01/10 16:47:33 nit: here and elsewhere: line_info
chunyang.dai 2013/01/18 10:22:44 Done.
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
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 (isolate->logger()->is_code_event_handler_enabled()) {
352 if (!code.is_null()) {
353 JITCodeLineInfo* lineinfo =
354 masm.positions_recorder()->DetachJITLineInfo();
355 LOG_CODE_EVENT(isolate, CodeEndLinePosInfoRecordEvent(*code, lineinfo));
356 }
357 }
347 return !code.is_null(); 358 return !code.is_null();
348 } 359 }
349 360
350 361
351 unsigned FullCodeGenerator::EmitStackCheckTable() { 362 unsigned FullCodeGenerator::EmitStackCheckTable() {
352 // The stack check table consists of a length (in number of entries) 363 // 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 364 // field, and then a sequence of entries. Each entry is a pair of AST id
354 // and code-relative pc offset. 365 // and code-relative pc offset.
355 masm()->Align(kIntSize); 366 masm()->Align(kIntSize);
356 unsigned offset = masm()->pc_offset(); 367 unsigned offset = masm()->pc_offset();
(...skipping 1221 matching lines...) Expand 10 before | Expand all | Expand 10 after
1578 } 1589 }
1579 1590
1580 return false; 1591 return false;
1581 } 1592 }
1582 1593
1583 1594
1584 #undef __ 1595 #undef __
1585 1596
1586 1597
1587 } } // namespace v8::internal 1598 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698