Index: src/full-codegen.h |
diff --git a/src/full-codegen.h b/src/full-codegen.h |
index adfa1c14716d6240c98c2abbbd9dcb07de987535..93a25280c1df807d8774fa8064d86d72cdfca546 100644 |
--- a/src/full-codegen.h |
+++ b/src/full-codegen.h |
@@ -912,7 +912,8 @@ class BackEdgeTable { |
enum BackEdgeState { |
INTERRUPT, |
- ON_STACK_REPLACEMENT |
+ ON_STACK_REPLACEMENT, |
+ OSR_AFTER_STACK_CHECK |
}; |
// Patch all interrupts with allowed loop depth in the unoptimized code to |
@@ -920,28 +921,29 @@ class BackEdgeTable { |
static void Patch(Isolate* isolate, |
Code* unoptimized_code); |
- // Patch the interrupt at the instruction before pc_after in |
- // the unoptimized code to unconditionally call replacement_code. |
+ // Patch the back edge to the target state, provided the correct callee. |
static void PatchAt(Code* unoptimized_code, |
- Address pc_after, |
+ Address pc, |
+ BackEdgeState target_state, |
Code* replacement_code); |
- // Change all patched interrupts patched in the unoptimized code |
- // back to normal interrupts. |
+ // Change all patched back edges back to normal interrupts. |
static void Revert(Isolate* isolate, |
Code* unoptimized_code); |
- // Change patched interrupt in the unoptimized code |
- // back to a normal interrupt. |
- static void RevertAt(Code* unoptimized_code, |
- Address pc_after, |
- Code* interrupt_code); |
+ // Change a back edge patched for on-stack replacement to perform a |
+ // stack check first. |
+ static void AddStackCheck(CompilationInfo* info); |
-#ifdef DEBUG |
+ // Remove the stack check, if available, and replace by on-stack replacement. |
+ static void RemoveStackCheck(CompilationInfo* info); |
+ |
+ // Return the current patch state of the back edge. |
static BackEdgeState GetBackEdgeState(Isolate* isolate, |
Code* unoptimized_code, |
Address pc_after); |
+#ifdef DEBUG |
// Verify that all back edges of a certain loop depth are patched. |
static bool Verify(Isolate* isolate, |
Code* unoptimized_code, |