| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 1 | // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| Ben Murdoch | f3b273f | 2017-01-17 12:11:28 +0000 | [diff] [blame] | 5 | #include "src/compiler/osr.h" |
| Rubin Xu | 7bc1b61 | 2021-02-16 09:38:50 +0000 | [diff] [blame^] | 6 | |
| 7 | #include "src/codegen/optimized-compilation-info.h" |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 8 | #include "src/compiler/frame.h" |
| Rubin Xu | 7bc1b61 | 2021-02-16 09:38:50 +0000 | [diff] [blame^] | 9 | #include "src/objects/objects-inl.h" |
| 10 | #include "src/objects/objects.h" |
| 11 | #include "src/objects/shared-function-info.h" |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 12 | |
| 13 | namespace v8 { |
| 14 | namespace internal { |
| 15 | namespace compiler { |
| 16 | |
| Rubin Xu | 7bc1b61 | 2021-02-16 09:38:50 +0000 | [diff] [blame^] | 17 | OsrHelper::OsrHelper(OptimizedCompilationInfo* info) |
| 18 | : parameter_count_(info->bytecode_array()->parameter_count()), |
| 19 | stack_slot_count_(InterpreterFrameConstants::RegisterStackSlotCount( |
| 20 | info->bytecode_array()->register_count()) + |
| 21 | InterpreterFrameConstants::kExtraSlotCount) {} |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 22 | |
| 23 | void OsrHelper::SetupFrame(Frame* frame) { |
| 24 | // The optimized frame will subsume the unoptimized frame. Do so by reserving |
| 25 | // the first spill slots. |
| 26 | frame->ReserveSpillSlots(UnoptimizedFrameSlots()); |
| 27 | } |
| 28 | |
| 29 | } // namespace compiler |
| 30 | } // namespace internal |
| 31 | } // namespace v8 |