| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/compiler/code-generator-impl.h" | 7 #include "src/compiler/code-generator-impl.h" |
| 8 #include "src/compiler/gap-resolver.h" | 8 #include "src/compiler/gap-resolver.h" |
| 9 #include "src/compiler/node-matchers.h" | 9 #include "src/compiler/node-matchers.h" |
| 10 #include "src/scopes.h" | 10 #include "src/scopes.h" |
| (...skipping 1189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1200 if (info()->is_osr()) { | 1200 if (info()->is_osr()) { |
| 1201 // TurboFan OSR-compiled functions cannot be entered directly. | 1201 // TurboFan OSR-compiled functions cannot be entered directly. |
| 1202 __ Abort(kShouldNotDirectlyEnterOsrFunction); | 1202 __ Abort(kShouldNotDirectlyEnterOsrFunction); |
| 1203 | 1203 |
| 1204 // Unoptimized code jumps directly to this entrypoint while the unoptimized | 1204 // Unoptimized code jumps directly to this entrypoint while the unoptimized |
| 1205 // frame is still on the stack. Optimized code uses OSR values directly from | 1205 // frame is still on the stack. Optimized code uses OSR values directly from |
| 1206 // the unoptimized frame. Thus, all that needs to be done is to allocate the | 1206 // the unoptimized frame. Thus, all that needs to be done is to allocate the |
| 1207 // remaining stack slots. | 1207 // remaining stack slots. |
| 1208 if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --"); | 1208 if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --"); |
| 1209 osr_pc_offset_ = __ pc_offset(); | 1209 osr_pc_offset_ = __ pc_offset(); |
| 1210 DCHECK(stack_slots >= frame()->GetOsrStackSlotCount()); | 1210 int osr_stack_slot_count = frame()->GetOsrStackSlotCount(); |
| 1211 stack_slots -= frame()->GetOsrStackSlotCount(); | 1211 DCHECK(stack_slots >= osr_stack_slot_count); |
| 1212 stack_slots -= osr_stack_slot_count; |
| 1213 |
| 1214 // Full-code javascript functions have a type feedback vector in the frame. |
| 1215 // Shift any locals down one slot, and adjust the stack pointer. |
| 1216 __ OSRDropVectorFromStack(osr_stack_slot_count, rbx, rax); |
| 1212 } | 1217 } |
| 1213 | 1218 |
| 1214 if (stack_slots > 0) { | 1219 if (stack_slots > 0) { |
| 1215 __ subq(rsp, Immediate(stack_slots * kPointerSize)); | 1220 __ subq(rsp, Immediate(stack_slots * kPointerSize)); |
| 1216 } | 1221 } |
| 1217 } | 1222 } |
| 1218 | 1223 |
| 1219 | 1224 |
| 1220 void CodeGenerator::AssembleReturn() { | 1225 void CodeGenerator::AssembleReturn() { |
| 1221 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); | 1226 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1433 } | 1438 } |
| 1434 } | 1439 } |
| 1435 MarkLazyDeoptSite(); | 1440 MarkLazyDeoptSite(); |
| 1436 } | 1441 } |
| 1437 | 1442 |
| 1438 #undef __ | 1443 #undef __ |
| 1439 | 1444 |
| 1440 } // namespace internal | 1445 } // namespace internal |
| 1441 } // namespace compiler | 1446 } // namespace compiler |
| 1442 } // namespace v8 | 1447 } // namespace v8 |
| OLD | NEW |