| Index: src/compiler.cc
|
| ===================================================================
|
| --- src/compiler.cc (revision 6955)
|
| +++ src/compiler.cc (working copy)
|
| @@ -35,8 +35,9 @@
|
| #include "data-flow.h"
|
| #include "debug.h"
|
| #include "full-codegen.h"
|
| +#include "gdb-jit.h"
|
| #include "hydrogen.h"
|
| -#include "lithium-allocator.h"
|
| +#include "lithium.h"
|
| #include "liveedit.h"
|
| #include "oprofile-agent.h"
|
| #include "parser.h"
|
| @@ -95,6 +96,25 @@
|
| }
|
|
|
|
|
| +void CompilationInfo::DisableOptimization() {
|
| + if (FLAG_optimize_closures) {
|
| + // If we allow closures optimizations and it's an optimizable closure
|
| + // mark it correspondingly.
|
| + bool is_closure = closure_.is_null() && !scope_->HasTrivialOuterContext();
|
| + if (is_closure) {
|
| + bool is_optimizable_closure =
|
| + !scope_->outer_scope_calls_eval() && !scope_->inside_with();
|
| + if (is_optimizable_closure) {
|
| + SetMode(BASE);
|
| + return;
|
| + }
|
| + }
|
| + }
|
| +
|
| + SetMode(NONOPT);
|
| +}
|
| +
|
| +
|
| // Determine whether to use the full compiler for all code. If the flag
|
| // --always-full-compiler is specified this is the case. For the virtual frame
|
| // based compiler the full compiler is also used if a debugger is connected, as
|
| @@ -192,7 +212,8 @@
|
|
|
| // Limit the number of times we re-compile a functions with
|
| // the optimizing compiler.
|
| - const int kMaxOptCount = FLAG_deopt_every_n_times == 0 ? 10 : 1000;
|
| + const int kMaxOptCount =
|
| + FLAG_deopt_every_n_times == 0 ? Compiler::kDefaultMaxOptCount : 1000;
|
| if (info->shared_info()->opt_count() > kMaxOptCount) {
|
| AbortAndDisable(info);
|
| // True indicates the compilation pipeline is still going, not
|
| @@ -407,6 +428,9 @@
|
| OPROFILE(CreateNativeCodeRegion(String::cast(script->name()),
|
| info->code()->instruction_start(),
|
| info->code()->instruction_size()));
|
| + GDBJIT(AddCode(Handle<String>(String::cast(script->name())),
|
| + script,
|
| + info->code()));
|
| } else {
|
| PROFILE(CodeCreateEvent(
|
| info->is_eval()
|
| @@ -417,6 +441,7 @@
|
| OPROFILE(CreateNativeCodeRegion(info->is_eval() ? "Eval" : "Script",
|
| info->code()->instruction_start(),
|
| info->code()->instruction_size()));
|
| + GDBJIT(AddCode(Handle<String>(), script, info->code()));
|
| }
|
|
|
| // Allocate function.
|
| @@ -791,6 +816,10 @@
|
| code->instruction_size()));
|
| }
|
| }
|
| +
|
| + GDBJIT(AddCode(name,
|
| + Handle<Script>(info->script()),
|
| + Handle<Code>(info->code())));
|
| }
|
|
|
| } } // namespace v8::internal
|
|
|