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/arm/macro-assembler-arm.h" | 7 #include "src/arm/macro-assembler-arm.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 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
867 __ Abort(kShouldNotDirectlyEnterOsrFunction); | 867 __ Abort(kShouldNotDirectlyEnterOsrFunction); |
868 | 868 |
869 // Unoptimized code jumps directly to this entrypoint while the unoptimized | 869 // Unoptimized code jumps directly to this entrypoint while the unoptimized |
870 // frame is still on the stack. Optimized code uses OSR values directly from | 870 // frame is still on the stack. Optimized code uses OSR values directly from |
871 // the unoptimized frame. Thus, all that needs to be done is to allocate the | 871 // the unoptimized frame. Thus, all that needs to be done is to allocate the |
872 // remaining stack slots. | 872 // remaining stack slots. |
873 if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --"); | 873 if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --"); |
874 osr_pc_offset_ = __ pc_offset(); | 874 osr_pc_offset_ = __ pc_offset(); |
875 // TODO(titzer): cannot address target function == local #-1 | 875 // TODO(titzer): cannot address target function == local #-1 |
876 __ ldr(r1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 876 __ ldr(r1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
877 DCHECK(stack_slots >= frame()->GetOsrStackSlotCount()); | 877 int osr_stack_slot_count = frame()->GetOsrStackSlotCount(); |
878 stack_slots -= frame()->GetOsrStackSlotCount(); | 878 DCHECK(stack_slots >= osr_stack_slot_count); |
| 879 stack_slots -= osr_stack_slot_count; |
| 880 |
| 881 // Full-code javascript functions have a type feedback vector in the frame. |
| 882 // Shift any locals down one slot, and adjust the stack pointer. |
| 883 __ AdaptUnoptimizedFrameForOsrEntry(osr_stack_slot_count, r2, r0); |
879 } | 884 } |
880 | 885 |
881 if (stack_slots > 0) { | 886 if (stack_slots > 0) { |
882 __ sub(sp, sp, Operand(stack_slots * kPointerSize)); | 887 __ sub(sp, sp, Operand(stack_slots * kPointerSize)); |
883 } | 888 } |
884 } | 889 } |
885 | 890 |
886 | 891 |
887 void CodeGenerator::AssembleReturn() { | 892 void CodeGenerator::AssembleReturn() { |
888 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); | 893 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1108 } | 1113 } |
1109 } | 1114 } |
1110 MarkLazyDeoptSite(); | 1115 MarkLazyDeoptSite(); |
1111 } | 1116 } |
1112 | 1117 |
1113 #undef __ | 1118 #undef __ |
1114 | 1119 |
1115 } // namespace compiler | 1120 } // namespace compiler |
1116 } // namespace internal | 1121 } // namespace internal |
1117 } // namespace v8 | 1122 } // namespace v8 |
OLD | NEW |