| Index: src/ia32/full-codegen-ia32.cc
|
| diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc
|
| index 6e2391110b2346903d53b6d365fbe3d405afe3c1..7718714e88789038a2c2ae7212a87b3d00921780 100644
|
| --- a/src/ia32/full-codegen-ia32.cc
|
| +++ b/src/ia32/full-codegen-ia32.cc
|
| @@ -129,6 +129,23 @@ void FullCodeGenerator::Generate(CompilationInfo* info) {
|
| }
|
| #endif
|
|
|
| + // Primitive functions are unlikely to be picked up by the stack-walking
|
| + // profiler, so they trigger their own optimization when they're called
|
| + // for the SharedFunctionInfo::kCallsUntilPrimitiveOptimization-th time.
|
| + if (FLAG_crankshaft &&
|
| + !info->shared_info().is_null() &&
|
| + info->function()->is_primitive()) {
|
| + info->shared_info()->set_call_counter(
|
| + SharedFunctionInfo::kCallsUntilPrimitiveOptimization);
|
| + __ mov(eax, Immediate(info->shared_info()));
|
| + // eax: shared function info
|
| + __ sub(FieldOperand(eax, SharedFunctionInfo::kCallCounterOffset),
|
| + Immediate(Smi::FromInt(1)));
|
| + Handle<Code> compile_stub(
|
| + isolate()->builtins()->builtin(Builtins::kLazyRecompile));
|
| + __ j(zero, compile_stub);
|
| + }
|
| +
|
| // Strict mode functions and builtins need to replace the receiver
|
| // with undefined when called as functions (without an explicit
|
| // receiver object). ecx is zero for method calls and non-zero for
|
|
|