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

Unified Diff: src/handles.cc

Issue 3120006: Put direct code pointers into JSFunction objects. This is a first step... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 4 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/factory.cc ('k') | src/heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/handles.cc
===================================================================
--- src/handles.cc (revision 5232)
+++ src/handles.cc (working copy)
@@ -771,20 +771,30 @@
bool CompileLazy(Handle<JSFunction> function,
Handle<Object> receiver,
ClearExceptionFlag flag) {
- CompilationInfo info(function, 0, receiver);
- bool result = CompileLazyHelper(&info, flag);
- PROFILE(FunctionCreateEvent(*function));
- return result;
+ if (function->shared()->is_compiled()) {
+ function->set_code(function->shared()->code());
+ return true;
+ } else {
+ CompilationInfo info(function, 0, receiver);
+ bool result = CompileLazyHelper(&info, flag);
+ PROFILE(FunctionCreateEvent(*function));
+ return result;
+ }
}
bool CompileLazyInLoop(Handle<JSFunction> function,
Handle<Object> receiver,
ClearExceptionFlag flag) {
- CompilationInfo info(function, 1, receiver);
- bool result = CompileLazyHelper(&info, flag);
- PROFILE(FunctionCreateEvent(*function));
- return result;
+ if (function->shared()->is_compiled()) {
+ function->set_code(function->shared()->code());
+ return true;
+ } else {
+ CompilationInfo info(function, 1, receiver);
+ bool result = CompileLazyHelper(&info, flag);
+ PROFILE(FunctionCreateEvent(*function));
+ return result;
+ }
}
« no previous file with comments | « src/factory.cc ('k') | src/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698