| 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/compiler/osr.h" | |
| 11 #include "src/scopes.h" | 10 #include "src/scopes.h" |
| 12 #include "src/x64/assembler-x64.h" | 11 #include "src/x64/assembler-x64.h" |
| 13 #include "src/x64/macro-assembler-x64.h" | 12 #include "src/x64/macro-assembler-x64.h" |
| 14 | 13 |
| 15 namespace v8 { | 14 namespace v8 { |
| 16 namespace internal { | 15 namespace internal { |
| 17 namespace compiler { | 16 namespace compiler { |
| 18 | 17 |
| 19 #define __ masm()-> | 18 #define __ masm()-> |
| 20 | 19 |
| (...skipping 1151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1172 if (info()->is_osr()) { | 1171 if (info()->is_osr()) { |
| 1173 // TurboFan OSR-compiled functions cannot be entered directly. | 1172 // TurboFan OSR-compiled functions cannot be entered directly. |
| 1174 __ Abort(kShouldNotDirectlyEnterOsrFunction); | 1173 __ Abort(kShouldNotDirectlyEnterOsrFunction); |
| 1175 | 1174 |
| 1176 // Unoptimized code jumps directly to this entrypoint while the unoptimized | 1175 // Unoptimized code jumps directly to this entrypoint while the unoptimized |
| 1177 // frame is still on the stack. Optimized code uses OSR values directly from | 1176 // frame is still on the stack. Optimized code uses OSR values directly from |
| 1178 // the unoptimized frame. Thus, all that needs to be done is to allocate the | 1177 // the unoptimized frame. Thus, all that needs to be done is to allocate the |
| 1179 // remaining stack slots. | 1178 // remaining stack slots. |
| 1180 if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --"); | 1179 if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --"); |
| 1181 osr_pc_offset_ = __ pc_offset(); | 1180 osr_pc_offset_ = __ pc_offset(); |
| 1182 int unoptimized_slots = | 1181 DCHECK(stack_slots >= frame()->GetOsrStackSlotCount()); |
| 1183 static_cast<int>(OsrHelper(info()).UnoptimizedFrameSlots()); | 1182 stack_slots -= frame()->GetOsrStackSlotCount(); |
| 1184 DCHECK(stack_slots >= unoptimized_slots); | |
| 1185 stack_slots -= unoptimized_slots; | |
| 1186 } | 1183 } |
| 1187 | 1184 |
| 1188 if (stack_slots > 0) { | 1185 if (stack_slots > 0) { |
| 1189 __ subq(rsp, Immediate(stack_slots * kPointerSize)); | 1186 __ subq(rsp, Immediate(stack_slots * kPointerSize)); |
| 1190 } | 1187 } |
| 1191 } | 1188 } |
| 1192 | 1189 |
| 1193 | 1190 |
| 1194 void CodeGenerator::AssembleReturn() { | 1191 void CodeGenerator::AssembleReturn() { |
| 1195 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); | 1192 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1398 } | 1395 } |
| 1399 } | 1396 } |
| 1400 MarkLazyDeoptSite(); | 1397 MarkLazyDeoptSite(); |
| 1401 } | 1398 } |
| 1402 | 1399 |
| 1403 #undef __ | 1400 #undef __ |
| 1404 | 1401 |
| 1405 } // namespace internal | 1402 } // namespace internal |
| 1406 } // namespace compiler | 1403 } // namespace compiler |
| 1407 } // namespace v8 | 1404 } // namespace v8 |
| OLD | NEW |