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/ia32/assembler-ia32.h" | 10 #include "src/ia32/assembler-ia32.h" |
(...skipping 1075 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1086 __ Abort(kShouldNotDirectlyEnterOsrFunction); | 1086 __ Abort(kShouldNotDirectlyEnterOsrFunction); |
1087 | 1087 |
1088 // Unoptimized code jumps directly to this entrypoint while the unoptimized | 1088 // Unoptimized code jumps directly to this entrypoint while the unoptimized |
1089 // frame is still on the stack. Optimized code uses OSR values directly from | 1089 // frame is still on the stack. Optimized code uses OSR values directly from |
1090 // the unoptimized frame. Thus, all that needs to be done is to allocate the | 1090 // the unoptimized frame. Thus, all that needs to be done is to allocate the |
1091 // remaining stack slots. | 1091 // remaining stack slots. |
1092 if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --"); | 1092 if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --"); |
1093 osr_pc_offset_ = __ pc_offset(); | 1093 osr_pc_offset_ = __ pc_offset(); |
1094 // TODO(titzer): cannot address target function == local #-1 | 1094 // TODO(titzer): cannot address target function == local #-1 |
1095 __ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); | 1095 __ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); |
1096 DCHECK(stack_slots >= frame()->GetOsrStackSlotCount()); | 1096 int osr_stack_slot_count = frame()->GetOsrStackSlotCount(); |
1097 stack_slots -= frame()->GetOsrStackSlotCount(); | 1097 DCHECK(stack_slots >= osr_stack_slot_count); |
| 1098 stack_slots -= osr_stack_slot_count; |
| 1099 |
| 1100 // Full-code javascript functions have a type feedback vector in the frame. |
| 1101 // Shift any locals down one slot, and adjust the stack pointer. |
| 1102 __ AdaptUnoptimizedFrameForOsrEntry(osr_stack_slot_count, ebx, eax); |
1098 } | 1103 } |
1099 | 1104 |
1100 if (stack_slots > 0) { | 1105 if (stack_slots > 0) { |
1101 // Allocate the stack slots used by this frame. | 1106 // Allocate the stack slots used by this frame. |
1102 __ sub(esp, Immediate(stack_slots * kPointerSize)); | 1107 __ sub(esp, Immediate(stack_slots * kPointerSize)); |
1103 } | 1108 } |
1104 } | 1109 } |
1105 | 1110 |
1106 | 1111 |
1107 void CodeGenerator::AssembleReturn() { | 1112 void CodeGenerator::AssembleReturn() { |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1332 } | 1337 } |
1333 } | 1338 } |
1334 MarkLazyDeoptSite(); | 1339 MarkLazyDeoptSite(); |
1335 } | 1340 } |
1336 | 1341 |
1337 #undef __ | 1342 #undef __ |
1338 | 1343 |
1339 } // namespace compiler | 1344 } // namespace compiler |
1340 } // namespace internal | 1345 } // namespace internal |
1341 } // namespace v8 | 1346 } // namespace v8 |
OLD | NEW |