• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
5 #include "src/compiler/osr.h"
6 
7 #include "src/compiler/frame.h"
8 #include "src/objects-inl.h"
9 #include "src/objects.h"
10 #include "src/objects/shared-function-info.h"
11 #include "src/optimized-compilation-info.h"
12 
13 namespace v8 {
14 namespace internal {
15 namespace compiler {
16 
OsrHelper(OptimizedCompilationInfo * info)17 OsrHelper::OsrHelper(OptimizedCompilationInfo* info)
18     : parameter_count_(
19           info->shared_info()->GetBytecodeArray()->parameter_count()),
20       stack_slot_count_(
21           InterpreterFrameConstants::RegisterStackSlotCount(
22               info->shared_info()->GetBytecodeArray()->register_count()) +
23           InterpreterFrameConstants::kExtraSlotCount) {}
24 
SetupFrame(Frame * frame)25 void OsrHelper::SetupFrame(Frame* frame) {
26   // The optimized frame will subsume the unoptimized frame. Do so by reserving
27   // the first spill slots.
28   frame->ReserveSpillSlots(UnoptimizedFrameSlots());
29 }
30 
31 }  // namespace compiler
32 }  // namespace internal
33 }  // namespace v8
34