Index: src/full-codegen.cc |
diff --git a/src/full-codegen.cc b/src/full-codegen.cc |
index 483d1e378d49307d84cf1be57a66de7c82fc1da0..740d0997d5cc09c140e211ced42b40680c15170f 100644 |
--- a/src/full-codegen.cc |
+++ b/src/full-codegen.cc |
@@ -1697,8 +1697,10 @@ void BackEdgeTable::Revert(Isolate* isolate, |
void BackEdgeTable::AddStackCheck(CompilationInfo* info) { |
DisallowHeapAllocation no_gc; |
Isolate* isolate = info->isolate(); |
- Code* code = info->shared_info()->code(); |
+ Code* code = *info->osr_patched_code(); |
Address pc = code->instruction_start() + info->osr_pc_offset(); |
+ ASSERT_EQ(info->osr_ast_id().ToInt(), |
+ code->TranslatePcOffsetToAstId(info->osr_pc_offset()).ToInt()); |
ASSERT_EQ(ON_STACK_REPLACEMENT, GetBackEdgeState(isolate, code, pc)); |
Code* patch = isolate->builtins()->builtin(Builtins::kOsrAfterStackCheck); |
PatchAt(code, pc, OSR_AFTER_STACK_CHECK, patch); |
@@ -1708,8 +1710,10 @@ void BackEdgeTable::AddStackCheck(CompilationInfo* info) { |
void BackEdgeTable::RemoveStackCheck(CompilationInfo* info) { |
DisallowHeapAllocation no_gc; |
Isolate* isolate = info->isolate(); |
- Code* code = info->shared_info()->code(); |
+ Code* code = *info->osr_patched_code(); |
Address pc = code->instruction_start() + info->osr_pc_offset(); |
+ ASSERT_EQ(info->osr_ast_id().ToInt(), |
+ code->TranslatePcOffsetToAstId(info->osr_pc_offset()).ToInt()); |
if (GetBackEdgeState(isolate, code, pc) == OSR_AFTER_STACK_CHECK) { |
Code* patch = isolate->builtins()->builtin(Builtins::kOnStackReplacement); |
PatchAt(code, pc, ON_STACK_REPLACEMENT, patch); |