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

Unified Diff: src/compiler/arm64/code-generator-arm64.cc

Issue 809333002: [turbofan] Implement OSR for outer loops. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years 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
Index: src/compiler/arm64/code-generator-arm64.cc
diff --git a/src/compiler/arm64/code-generator-arm64.cc b/src/compiler/arm64/code-generator-arm64.cc
index cc46fd677e13bf7d76fd87f2f96a9178b20df04d..34c50aa48abaab8cdd5550c8432fa6b66b08e16b 100644
--- a/src/compiler/arm64/code-generator-arm64.cc
+++ b/src/compiler/arm64/code-generator-arm64.cc
@@ -9,6 +9,7 @@
#include "src/compiler/gap-resolver.h"
#include "src/compiler/node-matchers.h"
#include "src/compiler/node-properties-inl.h"
+#include "src/compiler/osr.h"
#include "src/scopes.h"
namespace v8 {
@@ -970,6 +971,22 @@ void CodeGenerator::AssemblePrologue() {
StandardFrameConstants::kFixedFrameSizeFromFp);
}
int stack_slots = frame()->GetSpillSlotCount();
+
+ if (info()->is_osr()) {
+ // TurboFan OSR-compiled functions cannot be entered directly.
+ // TODO(titzer): put an abort into the header of OSR functions on arm64.
Benedikt Meurer 2014/12/18 11:21:22 MacroAssembler::Abort()
+
+ // Unoptimized code jumps directly to this entrypoint while the unoptimized
+ // frame is still on the stack. Optimized code uses OSR values directly from
+ // the unoptimized frame. Thus, all that needs to be done is to allocate the
+ // remaining stack slots.
+ if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --");
+ osr_pc_offset_ = __ pc_offset();
+ size_t unoptimized_slots = OsrHelper(info()).UnoptimizedFrameSlots();
+ DCHECK(stack_slots >= static_cast<int>(unoptimized_slots));
+ stack_slots -= unoptimized_slots;
+ }
+
if (stack_slots > 0) {
Register sp = __ StackPointer();
if (!sp.Is(csp)) {

Powered by Google App Engine
This is Rietveld 408576698