Commit f454b45d authored by olivf@chromium.org's avatar olivf@chromium.org

Add a flag to print the time it takes to compile HydrogenCodeStubs.

BUG=
R=yangguo@chromium.org

Review URL: https://codereview.chromium.org/25693003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17071 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 4b9a9f7a
......@@ -301,9 +301,18 @@ static Handle<Code> DoGenerateCode(Isolate* isolate, Stub* stub) {
ASSERT(descriptor->stack_parameter_count_ == NULL);
return stub->GenerateLightweightMissCode(isolate);
}
ElapsedTimer timer;
if (FLAG_profile_hydrogen_code_stub_compilation) {
timer.Start();
}
CodeStubGraphBuilder<Stub> builder(isolate, stub);
LChunk* chunk = OptimizeGraph(builder.CreateGraph());
return chunk->Codegen();
Handle<Code> code = chunk->Codegen();
if (FLAG_profile_hydrogen_code_stub_compilation) {
double ms = timer.Elapsed().InMillisecondsF();
PrintF("[Lazy compilation of %s took %0.3f ms]\n", *stub->GetName(), ms);
}
return code;
}
......
......@@ -200,6 +200,9 @@ class CodeStub BASE_EMBEDDED {
virtual void PrintName(StringStream* stream);
// Returns a name for logging/debugging purposes.
SmartArrayPointer<const char> GetName();
protected:
static bool CanUseFPRegisters();
......@@ -211,8 +214,6 @@ class CodeStub BASE_EMBEDDED {
// a fixed (non-moveable) code object.
virtual bool NeedsImmovableCode() { return false; }
// Returns a name for logging/debugging purposes.
SmartArrayPointer<const char> GetName();
virtual void PrintBaseName(StringStream* stream);
virtual void PrintState(StringStream* stream) { }
......
......@@ -621,6 +621,11 @@ DEFINE_string(testing_serialization_file, "/tmp/serdes",
DEFINE_string(extra_code, NULL, "A filename with extra code to be included in"
" the snapshot (mksnapshot only)")
// code-stubs-hydrogen.cc
DEFINE_bool(profile_hydrogen_code_stub_compilation,
false,
"Print the time it takes to lazily compile hydrogen code stubs.")
//
// Dev shell flags
//
......@@ -801,6 +806,7 @@ DEFINE_bool(test_primary_stub_cache,
false,
"test primary stub cache by disabling the secondary one")
// codegen-ia32.cc / codegen-arm.cc
DEFINE_bool(print_code, false, "print generated code")
DEFINE_bool(print_opt_code, false, "print optimized code")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment