Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Unified Diff: src/compiler.cc

Issue 6597029: [Isolates] Merge r 6300:6500 from bleeding_edge to isolates. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler.h ('k') | src/debug-debugger.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « src/compiler.h ('k') | src/debug-debugger.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698