blob: f9d7908c9e255e42a96a6a5c891138e05d6164aa [file] [log] [blame]
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Classes that describe assembly patterns as used by inline caches.
#error Do not include instructions_mips.h directly; use instructions.h instead.
#include "vm/constants_mips.h"
#include "vm/object.h"
namespace dart {
class CallPattern : public ValueObject {
CallPattern(uword pc, const Code& code);
RawICData* IcData();
RawArray* ArgumentsDescriptor();
uword TargetAddress() const;
void SetTargetAddress(uword target_address) const;
// This constant length is only valid for inserted call patterns used for
// lazy deoptimization. Regular call pattern may vary in length.
static const int kFixedLengthInBytes = 4 * Instr::kInstrSize;
static void InsertAt(uword pc, uword target_address);
uword Back(int n) const;
int DecodeLoadObject(int end, Register* reg, Object* obj);
int DecodeLoadWordImmediate(int end, Register* reg, int* value);
int DecodeLoadWordFromPool(int end, Register* reg, int* index);
const uword* end_;
int target_address_pool_index_;
int args_desc_load_end_;
Array& args_desc_;
int ic_data_load_end_;
ICData& ic_data_;
const Array& object_pool_;
class JumpPattern : public ValueObject {
explicit JumpPattern(uword pc);
// lui; ori; jr; nop (in delay slot) = 4.
static const int kLengthInBytes = 4*Instr::kInstrSize;
int pattern_length_in_bytes() const {
return kLengthInBytes;
bool IsValid() const;
uword TargetAddress() const;
void SetTargetAddress(uword target_address) const;
const uword pc_;
} // namespace dart