Index: src/compiler.cc |
diff --git a/src/compiler.cc b/src/compiler.cc |
index dce817129c0d339b686b1423015e6525dbb94fc4..2126325e9350fec38631cb7d100a5bed79ccfd74 100644 |
--- a/src/compiler.cc |
+++ b/src/compiler.cc |
@@ -103,6 +103,8 @@ void CompilationInfo::Initialize(Isolate* isolate, Mode mode, Zone* zone) { |
code_stub_ = NULL; |
prologue_offset_ = kPrologueOffsetNotSet; |
opt_count_ = shared_info().is_null() ? 0 : shared_info()->opt_count(); |
+ no_frame_ranges_ = isolate->cpu_profiler()->is_profiling() ? |
Jakob Kummerow
2013/05/14 12:38:51
nit: putting the '?' on the second line is prefera
yurys
2013/05/14 22:51:19
Done.
|
+ new List<OffsetRange>(2) : NULL; |
if (mode == STUB) { |
mode_ = STUB; |
return; |
@@ -121,6 +123,7 @@ void CompilationInfo::Initialize(Isolate* isolate, Mode mode, Zone* zone) { |
CompilationInfo::~CompilationInfo() { |
delete deferred_handles_; |
+ delete no_frame_ranges_; |
} |
@@ -573,6 +576,7 @@ static Handle<SharedFunctionInfo> MakeFunctionInfo(CompilationInfo* info) { |
: Logger::ToNativeByScript(Logger::SCRIPT_TAG, *script), |
*info->code(), |
*result, |
+ info, |
String::cast(script->name()))); |
GDBJIT(AddCode(Handle<String>(String::cast(script->name())), |
script, |
@@ -585,6 +589,7 @@ static Handle<SharedFunctionInfo> MakeFunctionInfo(CompilationInfo* info) { |
: Logger::ToNativeByScript(Logger::SCRIPT_TAG, *script), |
*info->code(), |
*result, |
+ info, |
isolate->heap()->empty_string())); |
GDBJIT(AddCode(Handle<String>(), script, info->code(), info)); |
} |
@@ -812,6 +817,10 @@ static void InstallCodeCommon(CompilationInfo* info) { |
// reset this bit when lazy compiling the code again. |
if (shared->optimization_disabled()) code->set_optimizable(false); |
+ if (shared->code() == *code) { |
+ // Do not send compilation event for the same code twice. |
+ return; |
+ } |
Compiler::RecordFunctionCompilation(Logger::LAZY_COMPILE_TAG, info, shared); |
} |
@@ -1156,6 +1165,7 @@ void Compiler::RecordFunctionCompilation(Logger::LogEventsAndTags tag, |
CodeCreateEvent(Logger::ToNativeByScript(tag, *script), |
*code, |
*shared, |
+ info, |
String::cast(script->name()), |
line_num)); |
} else { |
@@ -1163,6 +1173,7 @@ void Compiler::RecordFunctionCompilation(Logger::LogEventsAndTags tag, |
CodeCreateEvent(Logger::ToNativeByScript(tag, *script), |
*code, |
*shared, |
+ info, |
shared->DebugName())); |
} |
} |