// Copyright 2012 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.
#ifndef V8_FRAMES_INL_H_
#define V8_FRAMES_INL_H_
#include "src/frames.h"
#include "src/isolate.h"
#include "src/v8memory.h"
#if V8_TARGET_ARCH_IA32
#include "src/ia32/frames-ia32.h" // NOLINT
#elif V8_TARGET_ARCH_X64
#include "src/x64/frames-x64.h" // NOLINT
#elif V8_TARGET_ARCH_ARM64
#include "src/arm64/frames-arm64.h" // NOLINT
#elif V8_TARGET_ARCH_ARM
#include "src/arm/frames-arm.h" // NOLINT
#elif V8_TARGET_ARCH_MIPS
#include "src/mips/frames-mips.h" // NOLINT
#elif V8_TARGET_ARCH_MIPS64
#include "src/mips64/frames-mips64.h" // NOLINT
#elif V8_TARGET_ARCH_X87
#include "src/x87/frames-x87.h" // NOLINT
#else
#error Unsupported target architecture.
#endif
namespace v8 {
namespace internal {
inline Address StackHandler::address() const {
return reinterpret_cast
(const_cast(this));
}
inline StackHandler* StackHandler::next() const {
const int offset = StackHandlerConstants::kNextOffset;
return FromAddress(Memory::Address_at(address() + offset));
}
inline bool StackHandler::includes(Address address) const {
Address start = this->address();
Address end = start + StackHandlerConstants::kSize;
return start <= address && address <= end;
}
inline void StackHandler::Iterate(ObjectVisitor* v, Code* holder) const {
v->VisitPointer(context_address());
v->VisitPointer(code_address());
}
inline StackHandler* StackHandler::FromAddress(Address address) {
return reinterpret_cast(address);
}
inline bool StackHandler::is_js_entry() const {
return kind() == JS_ENTRY;
}
inline bool StackHandler::is_catch() const {
return kind() == CATCH;
}
inline bool StackHandler::is_finally() const {
return kind() == FINALLY;
}
inline StackHandler::Kind StackHandler::kind() const {
const int offset = StackHandlerConstants::kStateOffset;
return KindField::decode(Memory::unsigned_at(address() + offset));
}
inline unsigned StackHandler::index() const {
const int offset = StackHandlerConstants::kStateOffset;
return IndexField::decode(Memory::unsigned_at(address() + offset));
}
inline Object** StackHandler::context_address() const {
const int offset = StackHandlerConstants::kContextOffset;
return reinterpret_cast