Chromium Code Reviews| Index: src/arm/full-codegen-arm.cc |
| diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc |
| index a4fabe2ac1a06fd032d52ad8330a02f3cb99a462..8e44660ac506b9d85e07451ece50548210135d93 100644 |
| --- a/src/arm/full-codegen-arm.cc |
| +++ b/src/arm/full-codegen-arm.cc |
| @@ -1,4 +1,4 @@ |
| -// Copyright 2011 the V8 project authors. All rights reserved. |
| +// Copyright 2012 the V8 project authors. All rights reserved. |
| // Redistribution and use in source and binary forms, with or without |
| // modification, are permitted provided that the following conditions are |
| // met: |
| @@ -139,6 +139,28 @@ 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. |
|
Erik Corry
2012/02/09 09:43:33
I think this comment should be moved into ShouldSe
Jakob Kummerow
2012/02/09 10:13:20
Done.
|
| + if (info->ShouldSelfOptimize()) { |
| + if (FLAG_trace_opt) { |
|
Erik Corry
2012/02/09 09:43:33
I think this might be annoyingly verbose, but we c
Jakob Kummerow
2012/02/09 10:13:20
As discussed, let's leave it for now. We can alway
|
| + PrintF("[adding self-optimization header to %s]\n", |
| + *info->function()->debug_name()->ToCString()); |
| + } |
| + MaybeObject* maybe_cell = isolate()->heap()->AllocateJSGlobalPropertyCell( |
| + Smi::FromInt(Compiler::kCallsUntilPrimitiveOpt)); |
| + JSGlobalPropertyCell* cell; |
| + if (maybe_cell->To(&cell)) { |
| + __ mov(r2, Operand(Handle<JSGlobalPropertyCell>(cell))); |
| + __ ldr(r3, FieldMemOperand(r2, JSGlobalPropertyCell::kValueOffset)); |
| + __ sub(r3, r3, Operand(Smi::FromInt(1)), SetCC); |
| + __ str(r3, FieldMemOperand(r2, JSGlobalPropertyCell::kValueOffset)); |
| + 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 |