| 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 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1036 if (info()->is_osr()) { | 1036 if (info()->is_osr()) { |
| 1037 // TurboFan OSR-compiled functions cannot be entered directly. | 1037 // TurboFan OSR-compiled functions cannot be entered directly. |
| 1038 __ Abort(kShouldNotDirectlyEnterOsrFunction); | 1038 __ Abort(kShouldNotDirectlyEnterOsrFunction); |
| 1039 | 1039 |
| 1040 // Unoptimized code jumps directly to this entrypoint while the unoptimized | 1040 // Unoptimized code jumps directly to this entrypoint while the unoptimized |
| 1041 // frame is still on the stack. Optimized code uses OSR values directly from | 1041 // frame is still on the stack. Optimized code uses OSR values directly from |
| 1042 // the unoptimized frame. Thus, all that needs to be done is to allocate the | 1042 // the unoptimized frame. Thus, all that needs to be done is to allocate the |
| 1043 // remaining stack slots. | 1043 // remaining stack slots. |
| 1044 if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --"); | 1044 if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --"); |
| 1045 osr_pc_offset_ = __ pc_offset(); | 1045 osr_pc_offset_ = __ pc_offset(); |
| 1046 DCHECK(stack_slots >= frame()->GetOsrStackSlotCount()); | 1046 int osr_stack_slot_count = frame()->GetOsrStackSlotCount(); |
| 1047 stack_slots -= frame()->GetOsrStackSlotCount(); | 1047 DCHECK(stack_slots >= osr_stack_slot_count); |
| 1048 stack_slots -= osr_stack_slot_count; |
| 1049 |
| 1050 // Full-code javascript functions have a type feedback vector in the frame. |
| 1051 // Shift any locals down one slot, and adjust the stack pointer. |
| 1052 __ OSRDropVectorFromStack(osr_stack_slot_count, ebx, eax); |
| 1048 } | 1053 } |
| 1049 | 1054 |
| 1050 if (stack_slots > 0) { | 1055 if (stack_slots > 0) { |
| 1051 // Allocate the stack slots used by this frame. | 1056 // Allocate the stack slots used by this frame. |
| 1052 __ sub(esp, Immediate(stack_slots * kPointerSize)); | 1057 __ sub(esp, Immediate(stack_slots * kPointerSize)); |
| 1053 } | 1058 } |
| 1054 } | 1059 } |
| 1055 | 1060 |
| 1056 | 1061 |
| 1057 void CodeGenerator::AssembleReturn() { | 1062 void CodeGenerator::AssembleReturn() { |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1270 } | 1275 } |
| 1271 } | 1276 } |
| 1272 MarkLazyDeoptSite(); | 1277 MarkLazyDeoptSite(); |
| 1273 } | 1278 } |
| 1274 | 1279 |
| 1275 #undef __ | 1280 #undef __ |
| 1276 | 1281 |
| 1277 } // namespace compiler | 1282 } // namespace compiler |
| 1278 } // namespace internal | 1283 } // namespace internal |
| 1279 } // namespace v8 | 1284 } // namespace v8 |
| OLD | NEW |