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

Side by Side Diff: src/runtime-profiler.cc

Issue 7812023: Allow OSR for closures that reference context slots. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 // See AlwaysFullCompiler (in compiler.cc) comment on why we need 108 // See AlwaysFullCompiler (in compiler.cc) comment on why we need
109 // Debug::has_break_points(). 109 // Debug::has_break_points().
110 ASSERT(function->IsMarkedForLazyRecompilation()); 110 ASSERT(function->IsMarkedForLazyRecompilation());
111 if (!FLAG_use_osr || 111 if (!FLAG_use_osr ||
112 isolate_->DebuggerHasBreakPoints() || 112 isolate_->DebuggerHasBreakPoints() ||
113 function->IsBuiltin()) { 113 function->IsBuiltin()) {
114 return; 114 return;
115 } 115 }
116 116
117 SharedFunctionInfo* shared = function->shared(); 117 SharedFunctionInfo* shared = function->shared();
118 // If the code is not optimizable or references context slots, don't try OSR. 118 // If the code is not optimizable, don't try OSR.
119 if (!shared->code()->optimizable() || !shared->allows_lazy_compilation()) { 119 if (!shared->code()->optimizable()) return;
120 return;
121 }
122 120
123 // We are not prepared to do OSR for a function that already has an 121 // We are not prepared to do OSR for a function that already has an
124 // allocated arguments object. The optimized code would bypass it for 122 // allocated arguments object. The optimized code would bypass it for
125 // arguments accesses, which is unsound. Don't try OSR. 123 // arguments accesses, which is unsound. Don't try OSR.
126 if (shared->uses_arguments()) return; 124 if (shared->uses_arguments()) return;
127 125
128 // We're using on-stack replacement: patch the unoptimized code so that 126 // We're using on-stack replacement: patch the unoptimized code so that
129 // any back edge in any unoptimized frame will trigger on-stack 127 // any back edge in any unoptimized frame will trigger on-stack
130 // replacement for that frame. 128 // replacement for that frame.
131 if (FLAG_trace_osr) { 129 if (FLAG_trace_osr) {
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 354
357 bool RuntimeProfilerRateLimiter::SuspendIfNecessary() { 355 bool RuntimeProfilerRateLimiter::SuspendIfNecessary() {
358 if (!RuntimeProfiler::IsSomeIsolateInJS()) { 356 if (!RuntimeProfiler::IsSomeIsolateInJS()) {
359 return RuntimeProfiler::WaitForSomeIsolateToEnterJS(); 357 return RuntimeProfiler::WaitForSomeIsolateToEnterJS();
360 } 358 }
361 return false; 359 return false;
362 } 360 }
363 361
364 362
365 } } // namespace v8::internal 363 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698