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/codegen.cc

Issue 5965011: Basic GDB JIT Interface integration. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: minor formatting cleanup Created 9 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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 int len = String::cast(script->source())->length(); 241 int len = String::cast(script->source())->length();
242 Counters::total_old_codegen_source_size.Increment(len); 242 Counters::total_old_codegen_source_size.Increment(len);
243 } 243 }
244 if (FLAG_trace_codegen) { 244 if (FLAG_trace_codegen) {
245 PrintF("Classic Compiler - "); 245 PrintF("Classic Compiler - ");
246 } 246 }
247 MakeCodePrologue(info); 247 MakeCodePrologue(info);
248 // Generate code. 248 // Generate code.
249 const int kInitialBufferSize = 4 * KB; 249 const int kInitialBufferSize = 4 * KB;
250 MacroAssembler masm(NULL, kInitialBufferSize); 250 MacroAssembler masm(NULL, kInitialBufferSize);
251 #ifdef ENABLE_GDBJIT_INTERFACE
252 masm.positions_recorder()->StartGDBJITLineInfoRecording();
253 #endif
251 CodeGenerator cgen(&masm); 254 CodeGenerator cgen(&masm);
252 CodeGeneratorScope scope(&cgen); 255 CodeGeneratorScope scope(&cgen);
253 cgen.Generate(info); 256 cgen.Generate(info);
254 if (cgen.HasStackOverflow()) { 257 if (cgen.HasStackOverflow()) {
255 ASSERT(!Top::has_pending_exception()); 258 ASSERT(!Top::has_pending_exception());
256 return false; 259 return false;
257 } 260 }
258 261
259 InLoopFlag in_loop = info->is_in_loop() ? IN_LOOP : NOT_IN_LOOP; 262 InLoopFlag in_loop = info->is_in_loop() ? IN_LOOP : NOT_IN_LOOP;
260 Code::Flags flags = Code::ComputeFlags(Code::FUNCTION, in_loop); 263 Code::Flags flags = Code::ComputeFlags(Code::FUNCTION, in_loop);
261 Handle<Code> code = MakeCodeEpilogue(cgen.masm(), flags, info); 264 Handle<Code> code = MakeCodeEpilogue(cgen.masm(), flags, info);
262 // There is no stack check table in code generated by the classic backend. 265 // There is no stack check table in code generated by the classic backend.
263 code->SetNoStackCheckTable(); 266 code->SetNoStackCheckTable();
264 CodeGenerator::PrintCode(code, info); 267 CodeGenerator::PrintCode(code, info);
265 info->SetCode(code); // May be an empty handle. 268 info->SetCode(code); // May be an empty handle.
269 #ifdef ENABLE_GDBJIT_INTERFACE
270 if (!code.is_null()) {
271 GDBJITLineInfo* lineinfo =
272 masm.positions_recorder()->DetachGDBJITLineInfo();
273
274 GDBJIT(RegisterDetailedLineInfo(*code, lineinfo));
275 }
276 #endif
266 return !code.is_null(); 277 return !code.is_null();
267 } 278 }
268 279
269 280
270 #ifdef ENABLE_LOGGING_AND_PROFILING 281 #ifdef ENABLE_LOGGING_AND_PROFILING
271 282
272 bool CodeGenerator::ShouldGenerateLog(Expression* type) { 283 bool CodeGenerator::ShouldGenerateLog(Expression* type) {
273 ASSERT(type != NULL); 284 ASSERT(type != NULL);
274 if (!Logger::is_logging() && !CpuProfiler::is_profiling()) return false; 285 if (!Logger::is_logging() && !CpuProfiler::is_profiling()) return false;
275 Handle<String> name = Handle<String>::cast(type->AsLiteral()->handle()); 286 Handle<String> name = Handle<String>::cast(type->AsLiteral()->handle());
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 int result = save_doubles_ ? 1 : 0; 487 int result = save_doubles_ ? 1 : 0;
477 #ifdef _WIN64 488 #ifdef _WIN64
478 return result | ((result_size_ == 1) ? 0 : 2); 489 return result | ((result_size_ == 1) ? 0 : 2);
479 #else 490 #else
480 return result; 491 return result;
481 #endif 492 #endif
482 } 493 }
483 494
484 495
485 } } // namespace v8::internal 496 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698