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

Unified Diff: src/runtime.cc

Issue 23842004: Pass PC offset into runtime when compiling for OSR. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebased Created 7 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 side-by-side diff with in-line comments
Download patch
« src/compiler.cc ('K') | « src/runtime.h ('k') | src/x64/builtins-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index 2c0cab0ce9f9a4aa5ed4be8cd60544d210d012ac..6a4cbd6ac76c702342fc9e1254b198e9df1604b5 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -8583,8 +8583,21 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GetOptimizationCount) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_CompileForOnStackReplacement) {
HandleScope scope(isolate);
- ASSERT(args.length() == 1);
+ ASSERT(args.length() == 2);
CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
+ CONVERT_NUMBER_CHECKED(uint32_t, pc_offset, Uint32, args[1]);
+
+#ifdef DEBUG
+ JavaScriptFrameIterator it(isolate);
+ JavaScriptFrame* frame = it.frame();
+ Handle<Code> unoptimized(function->shared()->code(), isolate);
+ ASSERT_EQ(frame->function(), *function);
+ ASSERT_EQ(frame->LookupCode(), *unoptimized);
+ ASSERT(unoptimized->contains(frame->pc()));
+
+ ASSERT(pc_offset ==
+ static_cast<uint32_t>(frame->pc() - unoptimized->instruction_start()));
+#endif // DEBUG
// We're not prepared to handle a function with arguments object.
ASSERT(!function->shared()->uses_arguments());
@@ -8593,8 +8606,8 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_CompileForOnStackReplacement) {
// the unoptimized code can jump into.
Handle<Code> code =
(FLAG_concurrent_recompilation && FLAG_concurrent_osr)
- ? Compiler::CompileForConcurrentOSR(function)
- : Compiler::CompileForOnStackReplacement(function);
+ ? Compiler::CompileForConcurrentOSR(function, pc_offset)
+ : Compiler::CompileForOnStackReplacement(function, pc_offset);
if (!code.is_null()) {
#if DEBUG
ASSERT(code->kind() == Code::OPTIMIZED_FUNCTION);
« src/compiler.cc ('K') | « src/runtime.h ('k') | src/x64/builtins-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698