| Index: src/x64/full-codegen-x64.cc
|
| diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc
|
| index 24df20ba767bd76df3fe06cbae9109d56afe6512..2fa8065931645e8724845f402e9b47ecba1699dd 100644
|
| --- a/src/x64/full-codegen-x64.cc
|
| +++ b/src/x64/full-codegen-x64.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);
|
| + __ movq(rax, info->shared_info(), RelocInfo::EMBEDDED_OBJECT);
|
| + // rax: shared function info
|
| + __ SmiAddConstant(FieldOperand(rax, SharedFunctionInfo::kCallCounterOffset),
|
| + Smi::FromInt(-1));
|
| + Handle<Code> compile_stub(
|
| + isolate()->builtins()->builtin(Builtins::kLazyRecompile));
|
| + __ j(zero, compile_stub, RelocInfo::CODE_TARGET);
|
| + }
|
| +
|
| // Strict mode functions and builtins need to replace the receiver
|
| // with undefined when called as functions (without an explicit
|
| // receiver object). rcx is zero for method calls and non-zero for
|
|
|