code->set_stack_check_table_offset(table_offset);
CodeGenerator::PrintCode(code, info);
info->SetCode(code); // May be an empty handle.
- if (!code.is_null()) {
- isolate->runtime_profiler()->NotifyCodeGenerated(code->instruction_size());
- }
#ifdef ENABLE_GDB_JIT_INTERFACE
if (FLAG_gdbjit && !code.is_null()) {
GDBJITLineInfo* lineinfo =
// If no IC was patched since the last tick and this function is very
// small, optimistically optimize it now.
Optimize(function, "small function");
- } else if (!code_generated_ &&
- !any_ic_changed_ &&
- total_code_generated_ > 0 &&
- total_code_generated_ < 2000) {
- // If no code was generated and no IC was patched since the last tick,
- // but a little code has already been generated since last Reset(),
- // then type info might already be stable and we can optimize now.
- Optimize(function, "stable on startup");
} else {
shared_code->set_profiler_ticks(ticks + 1);
}
}
if (FLAG_watch_ic_patching) {
any_ic_changed_ = false;
- code_generated_ = false;
} else { // !FLAG_watch_ic_patching
// Add the collected functions as samples. It's important not to do
// this as part of collecting them because this will interfere with
void RuntimeProfiler::Reset() {
- if (FLAG_watch_ic_patching) {
- total_code_generated_ = 0;
- } else { // !FLAG_watch_ic_patching
+ if (!FLAG_watch_ic_patching) {
sampler_threshold_ = kSamplerThresholdInit;
sampler_threshold_size_factor_ = kSamplerThresholdSizeFactorInit;
sampler_ticks_until_threshold_adjustment_ =
void NotifyICChanged() { any_ic_changed_ = true; }
- void NotifyCodeGenerated(int generated_code_size) {
- if (FLAG_watch_ic_patching) {
- code_generated_ = true;
- total_code_generated_ += generated_code_size;
- }
- }
-
// Rate limiting support.
// VM thread interface.
bool any_ic_changed_;
bool code_generated_;
- int total_code_generated_;
// Possible state values:
// -1 => the profiler thread is waiting on the semaphore