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

Side by Side Diff: src/arm/builtins-arm.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: addressed comments. 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/compiler.h » ('j') | src/runtime-profiler.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 948 matching lines...) Expand 10 before | Expand all | Expand 10 after
959 { 959 {
960 FrameScope scope(masm, StackFrame::INTERNAL); 960 FrameScope scope(masm, StackFrame::INTERNAL);
961 __ CallRuntime(Runtime::kNotifyOSR, 0); 961 __ CallRuntime(Runtime::kNotifyOSR, 0);
962 } 962 }
963 __ ldm(ia_w, sp, kJSCallerSaved | kCalleeSaved | lr.bit() | fp.bit()); 963 __ ldm(ia_w, sp, kJSCallerSaved | kCalleeSaved | lr.bit() | fp.bit());
964 __ Ret(); 964 __ Ret();
965 } 965 }
966 966
967 967
968 void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) { 968 void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) {
969 // Lookup the function in the JavaScript frame and push it as an 969 // Lookup the function in the JavaScript frame.
970 // argument to the on-stack replacement function.
971 __ ldr(r0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); 970 __ ldr(r0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
972 { 971 {
973 FrameScope scope(masm, StackFrame::INTERNAL); 972 FrameScope scope(masm, StackFrame::INTERNAL);
973 // Lookup and calculate pc offset.
974 __ ldr(r1, MemOperand(fp, StandardFrameConstants::kCallerPCOffset));
975 __ ldr(r2, FieldMemOperand(r0, JSFunction::kSharedFunctionInfoOffset));
976 __ ldr(r2, FieldMemOperand(r2, SharedFunctionInfo::kCodeOffset));
977 __ sub(r1, r1, Operand(Code::kHeaderSize - kHeapObjectTag));
978 __ sub(r1, r1, r2);
979 __ SmiTag(r1);
980
981 // Pass both function and pc offset as arguments.
974 __ push(r0); 982 __ push(r0);
975 __ CallRuntime(Runtime::kCompileForOnStackReplacement, 1); 983 __ push(r1);
984 __ CallRuntime(Runtime::kCompileForOnStackReplacement, 2);
976 } 985 }
977 986
978 // If the code object is null, just return to the unoptimized code. 987 // If the code object is null, just return to the unoptimized code.
979 Label skip; 988 Label skip;
980 __ cmp(r0, Operand(Smi::FromInt(0))); 989 __ cmp(r0, Operand(Smi::FromInt(0)));
981 __ b(ne, &skip); 990 __ b(ne, &skip);
982 __ Ret(); 991 __ Ret();
983 992
984 __ bind(&skip); 993 __ bind(&skip);
985 994
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
1483 __ bind(&dont_adapt_arguments); 1492 __ bind(&dont_adapt_arguments);
1484 __ Jump(r3); 1493 __ Jump(r3);
1485 } 1494 }
1486 1495
1487 1496
1488 #undef __ 1497 #undef __
1489 1498
1490 } } // namespace v8::internal 1499 } } // namespace v8::internal
1491 1500
1492 #endif // V8_TARGET_ARCH_ARM 1501 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/compiler.h » ('j') | src/runtime-profiler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698