| Index: src/arm/full-codegen-arm.cc
|
| diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc
|
| index 17289e8f0ac54c9b166f04b4abefbf4eae3f22ae..d787c79ba3e34d201f79099a4c2459a113e66cc3 100644
|
| --- a/src/arm/full-codegen-arm.cc
|
| +++ b/src/arm/full-codegen-arm.cc
|
| @@ -139,6 +139,24 @@ 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 (info->function()->is_primitive() &&
|
| + !info->shared_info().is_null() &&
|
| + FLAG_crankshaft) {
|
| + info->shared_info()->set_call_counter(
|
| + SharedFunctionInfo::kCallsUntilPrimitiveOptimization);
|
| + __ mov(r2, Operand(info->shared_info()));
|
| + // r2: shared function info
|
| + __ ldr(r3, FieldMemOperand(r2, SharedFunctionInfo::kCallCounterOffset));
|
| + __ sub(r3, r3, Operand(Smi::FromInt(1)), SetCC);
|
| + __ str(r3, FieldMemOperand(r2, SharedFunctionInfo::kCallCounterOffset));
|
| + Handle<Code> compile_stub(
|
| + isolate()->builtins()->builtin(Builtins::kLazyRecompile));
|
| + __ Jump(compile_stub, RelocInfo::CODE_TARGET, eq);
|
| + }
|
| +
|
| // Strict mode functions and builtins need to replace the receiver
|
| // with undefined when called as functions (without an explicit
|
| // receiver object). r5 is zero for method calls and non-zero for
|
|
|