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

Unified Diff: src/compiler.cc

Issue 40290: Experimental: Merge 1395:1441 from bleeding_edge branch to the... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/global/
Patch Set: Created 11 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compilation-cache.cc ('k') | src/d8.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.cc
===================================================================
--- src/compiler.cc (revision 1441)
+++ src/compiler.cc (working copy)
@@ -35,6 +35,7 @@
#include "scopes.h"
#include "rewriter.h"
#include "usage-analyzer.h"
+#include "oprofile-agent.h"
namespace v8 { namespace internal {
@@ -123,16 +124,20 @@
return Handle<JSFunction>::null();
}
-#ifdef ENABLE_LOGGING_AND_PROFILING
+#if defined ENABLE_LOGGING_AND_PROFILING || defined ENABLE_OPROFILE_AGENT
// Log the code generation for the script. Check explicit whether logging is
// to avoid allocating when not required.
- if (Logger::is_enabled()) {
+ if (Logger::is_enabled() || OProfileAgent::is_enabled()) {
if (script->name()->IsString()) {
SmartPointer<char> data =
String::cast(script->name())->ToCString(DISALLOW_NULLS);
LOG(CodeCreateEvent(is_eval ? "Eval" : "Script", *code, *data));
+ OProfileAgent::CreateNativeCodeRegion(*data, code->address(),
+ code->ExecutableSize());
} else {
LOG(CodeCreateEvent(is_eval ? "Eval" : "Script", *code, ""));
+ OProfileAgent::CreateNativeCodeRegion(is_eval ? "Eval" : "Script",
+ code->address(), code->ExecutableSize());
}
}
#endif
@@ -210,7 +215,7 @@
extension,
pre_data);
if (extension == NULL && !result.is_null()) {
- CompilationCache::PutFunction(source, CompilationCache::SCRIPT, result);
+ CompilationCache::PutScript(source, CompilationCache::SCRIPT, result);
}
// Get rid of the pre-parsing data (if necessary).
@@ -220,7 +225,6 @@
}
if (result.is_null()) Top::ReportPendingMessages();
-
return result;
}
@@ -249,7 +253,7 @@
script->set_line_offset(Smi::FromInt(line_offset));
result = MakeFunction(is_global, true, script, context, NULL, NULL);
if (!result.is_null()) {
- CompilationCache::PutEvalFunction(source, context, entry, result);
+ CompilationCache::PutEval(source, context, entry, result);
}
}
@@ -307,11 +311,11 @@
return false;
}
-#ifdef ENABLE_LOGGING_AND_PROFILING
+#if defined ENABLE_LOGGING_AND_PROFILING || defined ENABLE_OPROFILE_AGENT
// Log the code generation. If source information is available include script
// name and line number. Check explicit whether logging is enabled as finding
// the line number is not for free.
- if (Logger::is_enabled()) {
+ if (Logger::is_enabled() || OProfileAgent::is_enabled()) {
if (script->name()->IsString()) {
int line_num = script->GetLineNumber(start_position);
if (line_num > 0) {
@@ -319,8 +323,14 @@
}
LOG(CodeCreateEvent("LazyCompile", *code, *lit->name(),
String::cast(script->name()), line_num));
+ OProfileAgent::CreateNativeCodeRegion(*lit->name(),
+ String::cast(script->name()),
+ line_num, code->address(),
+ code->ExecutableSize());
} else {
LOG(CodeCreateEvent("LazyCompile", *code, *lit->name()));
+ OProfileAgent::CreateNativeCodeRegion(*lit->name(), code->address(),
+ code->ExecutableSize());
}
}
#endif
« no previous file with comments | « src/compilation-cache.cc ('k') | src/d8.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698