osr.cc 1.05 KB
Newer Older
1 2 3 4
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

5
#include "src/compiler/osr.h"
6

7
#include "src/codegen/optimized-compilation-info.h"
8
#include "src/compiler/frame.h"
9 10
#include "src/objects/objects-inl.h"
#include "src/objects/objects.h"
11
#include "src/objects/shared-function-info.h"
12 13 14 15 16

namespace v8 {
namespace internal {
namespace compiler {

17
OsrHelper::OsrHelper(OptimizedCompilationInfo* info)
18 19 20 21
    : parameter_count_(info->bytecode_array()->parameter_count()),
      stack_slot_count_(InterpreterFrameConstants::RegisterStackSlotCount(
                            info->bytecode_array()->register_count()) +
                        InterpreterFrameConstants::kExtraSlotCount) {}
22 23 24 25 26 27 28 29 30 31

void OsrHelper::SetupFrame(Frame* frame) {
  // The optimized frame will subsume the unoptimized frame. Do so by reserving
  // the first spill slots.
  frame->ReserveSpillSlots(UnoptimizedFrameSlots());
}

}  // namespace compiler
}  // namespace internal
}  // namespace v8