fix include-what-you-use violations in x86 assembler

This commit is contained in:
Joshua Warner 2013-02-23 22:00:15 -07:00
parent 900b447e27
commit 3d1ae1d517
18 changed files with 123 additions and 61 deletions

View File

@ -60,11 +60,9 @@ const unsigned StackAlignmentInBytes = 8;
const unsigned StackAlignmentInWords
= StackAlignmentInBytes / TargetBytesPerWord;
void
resolve(MyBlock*);
void resolve(MyBlock*);
unsigned
padding(MyBlock*, unsigned);
unsigned padding(MyBlock*, unsigned);
class ConstantPoolEntry;

View File

@ -178,12 +178,6 @@ resolve(MyBlock* b)
using namespace isa;
inline void
write4(uint8_t* dst, uint32_t v)
{
memcpy(dst, &v, 4);
}
// END OPERATION COMPILERS
unsigned

View File

@ -21,7 +21,7 @@ using namespace isa;
unsigned padding(MyBlock*, unsigned);
inline int ha16(int32_t i);
int ha16(int32_t i);
bool bounded(int right, int left, int32_t v) {
return ((v << left) >> left) == v and ((v >> right) << right) == v;

View File

@ -8,25 +8,36 @@
There is NO WARRANTY for this software. See license.txt for
details. */
#include <stdarg.h>
#include <stdint.h>
#include <string.h>
#include "environment.h"
#include "target.h"
#include "alloc-vector.h"
#include <avian/vm/codegen/assembler.h>
#include <avian/vm/codegen/registers.h>
#include "codegen/x86/context.h"
#include "codegen/x86/block.h"
#include "codegen/x86/fixup.h"
#include "codegen/x86/padding.h"
#include "codegen/x86/registers.h"
#include "codegen/x86/encode.h"
#include "codegen/x86/operations.h"
#include "codegen/x86/detect.h"
#include "codegen/x86/multimethod.h"
#include "common.h"
#include "allocator.h"
#include "zone.h"
#include <avian/util/runtime-array.h>
#include <avian/util/abort.h>
#include <avian/util/math.h>
#include <avian/vm/codegen/assembler.h>
#include <avian/vm/codegen/registers.h>
#include <avian/vm/codegen/lir.h>
#include <avian/vm/codegen/promise.h>
#include <avian/vm/system/system.h>
#include "context.h"
#include "block.h"
#include "fixup.h"
#include "padding.h"
#include "registers.h"
#include "operations.h"
#include "detect.h"
#include "multimethod.h"
#define CAST1(x) reinterpret_cast<UnaryOperationType>(x)
#define CAST2(x) reinterpret_cast<BinaryOperationType>(x)

View File

@ -8,8 +8,9 @@
There is NO WARRANTY for this software. See license.txt for
details. */
#include "codegen/x86/block.h"
#include "common.h"
#include "block.h"
#include <avian/vm/codegen/assembler.h>
namespace avian {
namespace codegen {

View File

@ -8,8 +8,11 @@
There is NO WARRANTY for this software. See license.txt for
details. */
#include "codegen/x86/context.h"
#include "codegen/x86/block.h"
#include "allocator.h"
#include "zone.h"
#include "context.h"
#include "block.h"
namespace avian {
namespace codegen {

View File

@ -15,9 +15,14 @@
#define CAST2(x) reinterpret_cast<BinaryOperationType>(x)
#define CAST_BRANCH(x) reinterpret_cast<BranchOperationType>(x)
#include <stdint.h>
#include "alloc-vector.h"
#include <avian/vm/codegen/lir.h>
#include <avian/vm/codegen/assembler.h>
#include "alloc-vector.h"
#include <avian/vm/system/system.h>
namespace vm {
class System;

View File

@ -9,8 +9,9 @@
There is NO WARRANTY for this software. See license.txt for
details. */
#include "codegen/x86/context.h"
#include "codegen/x86/block.h"
#include "target.h"
#include "context.h"
namespace avian {
namespace codegen {

View File

@ -9,11 +9,18 @@
details. */
#include "target.h"
#include "alloc-vector.h"
#include "codegen/x86/context.h"
#include "codegen/x86/encode.h"
#include "codegen/x86/registers.h"
#include "codegen/x86/fixup.h"
#include <avian/util/abort.h>
#include <avian/util/math.h>
#include <avian/vm/codegen/assembler.h>
#include <avian/vm/codegen/promise.h>
#include "context.h"
#include "encode.h"
#include "registers.h"
#include "fixup.h"
using namespace avian::util;

View File

@ -11,12 +11,20 @@
#ifndef AVIAN_CODEGEN_ASSEMBLER_X86_ENCODE_H
#define AVIAN_CODEGEN_ASSEMBLER_X86_ENCODE_H
#include <avian/vm/codegen/assembler.h>
#include "codegen/x86/registers.h"
#include <stdint.h>
#include "common.h"
#include <avian/vm/codegen/lir.h>
#include "registers.h"
namespace avian {
namespace codegen {
namespace x86 {
class Context;
void maybeRex(Context* c, unsigned size, int a, int index, int base, bool always);
void maybeRex(Context* c, unsigned size, lir::Register* a, lir::Register* b);

View File

@ -8,12 +8,20 @@
There is NO WARRANTY for this software. See license.txt for
details. */
#include <avian/vm/codegen/assembler.h>
#include "codegen/x86/context.h"
#include "codegen/x86/fixup.h"
#include "codegen/x86/padding.h"
#include "codegen/x86/block.h"
#include <string.h>
#include "allocator.h"
#include "alloc-vector.h"
#include "common.h"
#include "zone.h"
#include <avian/util/abort.h>
#include <avian/vm/system/system.h>
#include "context.h"
#include "fixup.h"
#include "padding.h"
#include "block.h"
namespace avian {
namespace codegen {

View File

@ -11,17 +11,19 @@
#ifndef AVIAN_CODEGEN_ASSEMBLER_X86_FIXUP_H
#define AVIAN_CODEGEN_ASSEMBLER_X86_FIXUP_H
#include <stdint.h>
#include <avian/vm/codegen/promise.h>
namespace vm {
class System;
}
namespace avian {
namespace codegen {
class Promise;
namespace x86 {
class Context;
class MyBlock;
class AlignmentPadding;

View File

@ -10,11 +10,13 @@
#include "common.h"
#include <avian/util/abort.h>
#include <avian/vm/codegen/lir.h>
#include "codegen/x86/context.h"
#include "codegen/x86/multimethod.h"
#include "codegen/x86/operations.h"
#include "context.h"
#include "multimethod.h"
#include "operations.h"
namespace avian {
namespace codegen {

View File

@ -11,6 +11,10 @@
#ifndef AVIAN_CODEGEN_ASSEMBLER_X86_MULTIMETHOD_H
#define AVIAN_CODEGEN_ASSEMBLER_X86_MULTIMETHOD_H
#include "common.h"
#include <avian/vm/codegen/lir.h>
namespace avian {
namespace codegen {
namespace x86 {

View File

@ -8,13 +8,25 @@
There is NO WARRANTY for this software. See license.txt for
details. */
#include "codegen/x86/context.h"
#include "codegen/x86/encode.h"
#include "codegen/x86/registers.h"
#include "codegen/x86/detect.h"
#include "codegen/x86/operations.h"
#include "codegen/x86/padding.h"
#include "codegen/x86/fixup.h"
#include <stdint.h>
#include "target.h"
#include "alloc-vector.h"
#include "allocator.h"
#include "zone.h"
#include <avian/util/abort.h>
#include <avian/vm/codegen/assembler.h>
#include <avian/vm/codegen/promise.h>
#include "context.h"
#include "encode.h"
#include "registers.h"
#include "detect.h"
#include "operations.h"
#include "padding.h"
#include "fixup.h"
using namespace avian::util;

View File

@ -11,6 +11,12 @@
#ifndef AVIAN_CODEGEN_ASSEMBLER_X86_OPERATIONS_H
#define AVIAN_CODEGEN_ASSEMBLER_X86_OPERATIONS_H
#include "common.h"
#include <avian/vm/codegen/lir.h>
#include "context.h"
namespace avian {
namespace codegen {
namespace x86 {

View File

@ -8,12 +8,11 @@
There is NO WARRANTY for this software. See license.txt for
details. */
#include <avian/vm/codegen/assembler.h>
#include "alloc-vector.h"
#include "codegen/x86/context.h"
#include "codegen/x86/fixup.h"
#include "codegen/x86/padding.h"
#include "codegen/x86/block.h"
#include "context.h"
#include "padding.h"
#include "block.h"
namespace avian {
namespace codegen {

View File

@ -15,6 +15,7 @@ namespace avian {
namespace codegen {
namespace x86 {
class Context;
class AlignmentPadding {
public: