| Index: src/ia32/full-codegen-ia32.cc
|
| diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc
|
| index 469ead9510d061c2c94d931746c7805a8f50c2bf..afb8a7f8b0abaacba8953d647ddff8eff465b196 100644
|
| --- a/src/ia32/full-codegen-ia32.cc
|
| +++ b/src/ia32/full-codegen-ia32.cc
|
| @@ -100,6 +100,11 @@ class JumpPatchSite BASE_EMBEDDED {
|
| };
|
|
|
|
|
| +int FullCodeGenerator::self_optimization_header_size() {
|
| + return 13;
|
| +}
|
| +
|
| +
|
| // Generate code for a JS function. On entry to the function the receiver
|
| // and arguments have been pushed on the stack left to right, with the
|
| // return address on top of them. The actual argument count matches the
|
| @@ -122,13 +127,6 @@ void FullCodeGenerator::Generate() {
|
| SetFunctionPosition(function());
|
| Comment cmnt(masm_, "[ function compiled by full code generator");
|
|
|
| -#ifdef DEBUG
|
| - if (strlen(FLAG_stop_at) > 0 &&
|
| - info->function()->name()->IsEqualTo(CStrVector(FLAG_stop_at))) {
|
| - __ int3();
|
| - }
|
| -#endif
|
| -
|
| // We can optionally optimize based on counters rather than statistical
|
| // sampling.
|
| if (info->ShouldSelfOptimize()) {
|
| @@ -136,6 +134,7 @@ void FullCodeGenerator::Generate() {
|
| PrintF("[adding self-optimization header to %s]\n",
|
| *info->function()->debug_name()->ToCString());
|
| }
|
| + has_self_optimization_header_ = true;
|
| MaybeObject* maybe_cell = isolate()->heap()->AllocateJSGlobalPropertyCell(
|
| Smi::FromInt(Compiler::kCallsUntilPrimitiveOpt));
|
| JSGlobalPropertyCell* cell;
|
| @@ -146,9 +145,17 @@ void FullCodeGenerator::Generate() {
|
| isolate()->builtins()->builtin(Builtins::kLazyRecompile));
|
| STATIC_ASSERT(kSmiTag == 0);
|
| __ j(zero, compile_stub);
|
| + ASSERT(masm_->pc_offset() == self_optimization_header_size());
|
| }
|
| }
|
|
|
| +#ifdef DEBUG
|
| + if (strlen(FLAG_stop_at) > 0 &&
|
| + info->function()->name()->IsEqualTo(CStrVector(FLAG_stop_at))) {
|
| + __ int3();
|
| + }
|
| +#endif
|
| +
|
| // 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
|
|
|