OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/compiler/code-generator.h" | 5 #include "src/compiler/code-generator.h" |
6 | 6 |
7 #include "src/arm64/macro-assembler-arm64.h" | 7 #include "src/arm64/macro-assembler-arm64.h" |
8 #include "src/compiler/code-generator-impl.h" | 8 #include "src/compiler/code-generator-impl.h" |
9 #include "src/compiler/gap-resolver.h" | 9 #include "src/compiler/gap-resolver.h" |
10 #include "src/compiler/node-matchers.h" | 10 #include "src/compiler/node-matchers.h" |
(...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
996 __ Abort(kShouldNotDirectlyEnterOsrFunction); | 996 __ Abort(kShouldNotDirectlyEnterOsrFunction); |
997 | 997 |
998 // Unoptimized code jumps directly to this entrypoint while the unoptimized | 998 // Unoptimized code jumps directly to this entrypoint while the unoptimized |
999 // frame is still on the stack. Optimized code uses OSR values directly from | 999 // frame is still on the stack. Optimized code uses OSR values directly from |
1000 // the unoptimized frame. Thus, all that needs to be done is to allocate the | 1000 // the unoptimized frame. Thus, all that needs to be done is to allocate the |
1001 // remaining stack slots. | 1001 // remaining stack slots. |
1002 if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --"); | 1002 if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --"); |
1003 osr_pc_offset_ = __ pc_offset(); | 1003 osr_pc_offset_ = __ pc_offset(); |
1004 // TODO(titzer): cannot address target function == local #-1 | 1004 // TODO(titzer): cannot address target function == local #-1 |
1005 __ ldr(x1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 1005 __ ldr(x1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
1006 DCHECK(stack_slots >= frame()->GetOsrStackSlotCount()); | 1006 int osr_stack_slot_count = frame()->GetOsrStackSlotCount(); |
1007 stack_slots -= frame()->GetOsrStackSlotCount(); | 1007 DCHECK(stack_slots >= osr_stack_slot_count); |
| 1008 stack_slots -= osr_stack_slot_count; |
| 1009 |
| 1010 // Full-code javascript functions have a type feedback vector in the frame. |
| 1011 // Shift any locals down one slot, and adjust the stack pointer. |
| 1012 __ AdaptUnoptimizedFrameForOsrEntry(osr_stack_slot_count, x2, x0); |
1008 } | 1013 } |
1009 | 1014 |
1010 if (stack_slots > 0) { | 1015 if (stack_slots > 0) { |
1011 Register sp = __ StackPointer(); | 1016 Register sp = __ StackPointer(); |
1012 if (!sp.Is(csp)) { | 1017 if (!sp.Is(csp)) { |
1013 __ Sub(sp, sp, stack_slots * kPointerSize); | 1018 __ Sub(sp, sp, stack_slots * kPointerSize); |
1014 } | 1019 } |
1015 __ Sub(csp, csp, AlignedStackSlots(stack_slots) * kPointerSize); | 1020 __ Sub(csp, csp, AlignedStackSlots(stack_slots) * kPointerSize); |
1016 } | 1021 } |
1017 } | 1022 } |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1219 } | 1224 } |
1220 } | 1225 } |
1221 MarkLazyDeoptSite(); | 1226 MarkLazyDeoptSite(); |
1222 } | 1227 } |
1223 | 1228 |
1224 #undef __ | 1229 #undef __ |
1225 | 1230 |
1226 } // namespace compiler | 1231 } // namespace compiler |
1227 } // namespace internal | 1232 } // namespace internal |
1228 } // namespace v8 | 1233 } // namespace v8 |
OLD | NEW |