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

Unified Diff: src/handles.cc

Issue 6529055: [Isolates] Merge crankshaft (r5922 from bleeding_edge). (Closed)
Patch Set: Win32 port 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/handles.h ('k') | src/heap.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/handles.cc
diff --git a/src/handles.cc b/src/handles.cc
index 1cec5f616c50ef1c6ee42d936c57f3f29d7d1943..b61a675bdb25000487398446bd49ceb1abcf9020 100644
--- a/src/handles.cc
+++ b/src/handles.cc
@@ -39,6 +39,7 @@
#include "runtime.h"
#include "string-search.h"
#include "stub-cache.h"
+#include "vm-state-inl.h"
namespace v8 {
namespace internal {
@@ -867,7 +868,7 @@ bool EnsureCompiled(Handle<SharedFunctionInfo> shared,
static bool CompileLazyHelper(CompilationInfo* info,
ClearExceptionFlag flag) {
// Compile the source information to a code object.
- ASSERT(!info->shared_info()->is_compiled());
+ ASSERT(info->IsOptimizing() || !info->shared_info()->is_compiled());
bool result = Compiler::CompileLazy(info);
ASSERT(result != Isolate::Current()->has_pending_exception());
if (!result && flag == CLEAR_EXCEPTION) {
@@ -886,36 +887,47 @@ bool CompileLazyShared(Handle<SharedFunctionInfo> shared,
bool CompileLazy(Handle<JSFunction> function,
ClearExceptionFlag flag) {
+ bool result = true;
if (function->shared()->is_compiled()) {
- function->set_code(function->shared()->code());
- PROFILE(FunctionCreateEvent(*function));
+ function->ReplaceCode(function->shared()->code());
function->shared()->set_code_age(0);
- return true;
} else {
CompilationInfo info(function);
- bool result = CompileLazyHelper(&info, flag);
+ result = CompileLazyHelper(&info, flag);
ASSERT(!result || function->is_compiled());
+ }
+ if (result && function->is_compiled()) {
PROFILE(FunctionCreateEvent(*function));
- return result;
}
+ return result;
}
bool CompileLazyInLoop(Handle<JSFunction> function,
ClearExceptionFlag flag) {
+ bool result = true;
if (function->shared()->is_compiled()) {
- function->set_code(function->shared()->code());
- PROFILE(FunctionCreateEvent(*function));
+ function->ReplaceCode(function->shared()->code());
function->shared()->set_code_age(0);
- return true;
} else {
CompilationInfo info(function);
info.MarkAsInLoop();
- bool result = CompileLazyHelper(&info, flag);
+ result = CompileLazyHelper(&info, flag);
ASSERT(!result || function->is_compiled());
+ }
+ if (result && function->is_compiled()) {
PROFILE(FunctionCreateEvent(*function));
- return result;
}
+ return result;
+}
+
+
+bool CompileOptimized(Handle<JSFunction> function, int osr_ast_id) {
+ CompilationInfo info(function);
+ info.SetOptimizing(osr_ast_id);
+ bool result = CompileLazyHelper(&info, KEEP_EXCEPTION);
+ if (result) PROFILE(FunctionCreateEvent(*function));
+ return result;
}
« no previous file with comments | « src/handles.h ('k') | src/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698