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 1249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1260 __ Abort(kShouldNotDirectlyEnterOsrFunction); | 1260 __ Abort(kShouldNotDirectlyEnterOsrFunction); |
1261 | 1261 |
1262 // Unoptimized code jumps directly to this entrypoint while the unoptimized | 1262 // Unoptimized code jumps directly to this entrypoint while the unoptimized |
1263 // frame is still on the stack. Optimized code uses OSR values directly from | 1263 // frame is still on the stack. Optimized code uses OSR values directly from |
1264 // the unoptimized frame. Thus, all that needs to be done is to allocate the | 1264 // the unoptimized frame. Thus, all that needs to be done is to allocate the |
1265 // remaining stack slots. | 1265 // remaining stack slots. |
1266 if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --"); | 1266 if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --"); |
1267 osr_pc_offset_ = __ pc_offset(); | 1267 osr_pc_offset_ = __ pc_offset(); |
1268 // TODO(titzer): cannot address target function == local #-1 | 1268 // TODO(titzer): cannot address target function == local #-1 |
1269 __ movq(rdi, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); | 1269 __ movq(rdi, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); |
1270 DCHECK(stack_slots >= frame()->GetOsrStackSlotCount()); | 1270 int osr_stack_slot_count = frame()->GetOsrStackSlotCount(); |
1271 stack_slots -= frame()->GetOsrStackSlotCount(); | 1271 DCHECK(stack_slots >= osr_stack_slot_count); |
| 1272 stack_slots -= osr_stack_slot_count; |
| 1273 |
| 1274 // Full-code javascript functions have a type feedback vector in the frame. |
| 1275 // Shift any locals down one slot, and adjust the stack pointer. |
| 1276 __ AdaptUnoptimizedFrameForOsrEntry(osr_stack_slot_count, rbx, rax); |
1272 } | 1277 } |
1273 | 1278 |
1274 if (stack_slots > 0) { | 1279 if (stack_slots > 0) { |
1275 __ subq(rsp, Immediate(stack_slots * kPointerSize)); | 1280 __ subq(rsp, Immediate(stack_slots * kPointerSize)); |
1276 } | 1281 } |
1277 } | 1282 } |
1278 | 1283 |
1279 | 1284 |
1280 void CodeGenerator::AssembleReturn() { | 1285 void CodeGenerator::AssembleReturn() { |
1281 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); | 1286 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1502 } | 1507 } |
1503 } | 1508 } |
1504 MarkLazyDeoptSite(); | 1509 MarkLazyDeoptSite(); |
1505 } | 1510 } |
1506 | 1511 |
1507 #undef __ | 1512 #undef __ |
1508 | 1513 |
1509 } // namespace internal | 1514 } // namespace internal |
1510 } // namespace compiler | 1515 } // namespace compiler |
1511 } // namespace v8 | 1516 } // namespace v8 |
OLD | NEW |