7c91e88e6e
When we detect ARMv6, instead of using movw and movt, this change loads each individual byte. Although this is not the best way to achieve this, a modification to store large constants in the object pool would be more invasive. Further, this change will be easier to back-out once ARMv6 is obsolete. R=regis@google.com Review URL: https://codereview.chromium.org//183803024 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33442 260f80e4-7a28-3924-810f-c04153c831b5
102 lines
3.2 KiB
C++
102 lines
3.2 KiB
C++
// 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.
|
|
|
|
#ifndef VM_INSTRUCTIONS_ARM_H_
|
|
#define VM_INSTRUCTIONS_ARM_H_
|
|
|
|
#ifndef VM_INSTRUCTIONS_H_
|
|
#error Do not include instructions_arm.h directly; use instructions.h instead.
|
|
#endif
|
|
|
|
#include "vm/constants_arm.h"
|
|
#include "vm/object.h"
|
|
|
|
namespace dart {
|
|
|
|
class InstructionPattern : public AllStatic {
|
|
public:
|
|
// Decodes a load sequence ending at 'end' (the last instruction of the
|
|
// load sequence is the instruction before the one at end). Returns the
|
|
// address of the first instruction in the sequence. Returns the register
|
|
// being loaded and the loaded object in the output parameters 'reg' and
|
|
// 'obj' respectively.
|
|
static uword DecodeLoadObject(uword end,
|
|
const Array& object_pool,
|
|
Register* reg,
|
|
Object* obj);
|
|
|
|
// Decodes a load sequence ending at 'end' (the last instruction of the
|
|
// load sequence is the instruction before the one at end). Returns the
|
|
// address of the first instruction in the sequence. Returns the register
|
|
// being loaded and the loaded immediate value in the output parameters
|
|
// 'reg' and 'value' respectively.
|
|
static uword DecodeLoadWordImmediate(uword end,
|
|
Register* reg,
|
|
intptr_t* value);
|
|
|
|
// Decodes a load sequence ending at 'end' (the last instruction of the
|
|
// load sequence is the instruction before the one at end). Returns the
|
|
// address of the first instruction in the sequence. Returns the register
|
|
// being loaded and the index in the pool being read from in the output
|
|
// parameters 'reg' and 'index' respectively.
|
|
static uword DecodeLoadWordFromPool(uword end,
|
|
Register* reg,
|
|
intptr_t* index);
|
|
};
|
|
|
|
|
|
class CallPattern : public ValueObject {
|
|
public:
|
|
CallPattern(uword pc, const Code& code);
|
|
|
|
RawICData* IcData();
|
|
RawArray* ClosureArgumentsDescriptor();
|
|
|
|
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 int LengthInBytes();
|
|
|
|
static void InsertAt(uword pc, uword target_address);
|
|
|
|
private:
|
|
const Array& object_pool_;
|
|
|
|
uword end_;
|
|
uword args_desc_load_end_;
|
|
uword ic_data_load_end_;
|
|
|
|
intptr_t target_address_pool_index_;
|
|
Array& args_desc_;
|
|
ICData& ic_data_;
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(CallPattern);
|
|
};
|
|
|
|
|
|
class JumpPattern : public ValueObject {
|
|
public:
|
|
JumpPattern(uword pc, const Code& code);
|
|
|
|
static const int kLengthInBytes = 3 * Instr::kInstrSize;
|
|
|
|
static int pattern_length_in_bytes();
|
|
|
|
bool IsValid() const;
|
|
uword TargetAddress() const;
|
|
void SetTargetAddress(uword target_address) const;
|
|
|
|
private:
|
|
const uword pc_;
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(JumpPattern);
|
|
};
|
|
|
|
} // namespace dart
|
|
|
|
#endif // VM_INSTRUCTIONS_ARM_H_
|