Commit e9b13d9c authored by lrn@chromium.org's avatar lrn@chromium.org

X64: Implementation of a bunch of stubs, and some new opcodes.

Review URL: http://codereview.chromium.org/125185


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2203 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent a7c970c5
......@@ -120,8 +120,10 @@ const int kIntptrSize = sizeof(intptr_t); // NOLINT
#if V8_HOST_ARCH_64_BIT
const int kPointerSizeLog2 = 3;
const intptr_t kIntptrSignBit = V8_INT64_C(0x8000000000000000);
#else
const int kPointerSizeLog2 = 2;
const intptr_t kIntptrSignBit = 0x80000000;
#endif
const int kObjectAlignmentBits = kPointerSizeLog2;
......
......@@ -1815,7 +1815,7 @@ void Assembler::fcompp() {
void Assembler::fnstsw_ax() {
EnsureSpace ensure_space(this);
last_pc_ = pc_;
EMIT(0xdF);
EMIT(0xDF);
EMIT(0xE0);
}
......
This diff is collapsed.
......@@ -115,6 +115,35 @@ extern Register r14;
extern Register r15;
extern Register no_reg;
struct MMXRegister {
bool is_valid() const { return 0 <= code_ && code_ < 2; }
int code() const {
ASSERT(is_valid());
return code_;
}
int code_;
};
extern MMXRegister mm0;
extern MMXRegister mm1;
extern MMXRegister mm2;
extern MMXRegister mm3;
extern MMXRegister mm4;
extern MMXRegister mm5;
extern MMXRegister mm6;
extern MMXRegister mm7;
extern MMXRegister mm8;
extern MMXRegister mm9;
extern MMXRegister mm10;
extern MMXRegister mm11;
extern MMXRegister mm12;
extern MMXRegister mm13;
extern MMXRegister mm14;
extern MMXRegister mm15;
struct XMMRegister {
bool is_valid() const { return 0 <= code_ && code_ < 2; }
int code() const {
......@@ -446,6 +475,9 @@ class Assembler : public Malloced {
void movq(Register dst, ExternalReference ext);
void movq(Register dst, Handle<Object> handle, RelocInfo::Mode rmode);
void movsxlq(Register dst, Register src);
void movzxbq(Register dst, const Operand& src);
// New x64 instruction to load from an immediate 64-bit pointer into RAX.
void load_rax(void* ptr, RelocInfo::Mode rmode);
void load_rax(ExternalReference ext);
......@@ -461,6 +493,10 @@ class Assembler : public Malloced {
arithmetic_op(0x03, dst, src);
}
void addl(Register dst, Register src) {
arithmetic_op_32(0x03, dst, src);
}
void addq(Register dst, const Operand& src) {
arithmetic_op(0x03, dst, src);
}
......@@ -502,6 +538,10 @@ class Assembler : public Malloced {
immediate_arithmetic_op(0x7, dst, src);
}
void cmpl(Register dst, Immediate src) {
immediate_arithmetic_op_32(0x7, dst, src);
}
void cmpq(const Operand& dst, Immediate src) {
immediate_arithmetic_op(0x7, dst, src);
}
......@@ -540,6 +580,8 @@ class Assembler : public Malloced {
void imul(Register dst, const Operand& src);
// Performs the operation dst = src * imm.
void imul(Register dst, Register src, Immediate imm);
// Multiply 32 bit registers
void imull(Register dst, Register src);
void incq(Register dst);
void incq(const Operand& dst);
......@@ -604,6 +646,10 @@ class Assembler : public Malloced {
shift(dst, 0x4);
}
void shll(Register dst) {
shift_32(dst, 0x4);
}
void shr(Register dst, Immediate shift_amount) {
shift(dst, shift_amount, 0x5);
}
......@@ -612,6 +658,10 @@ class Assembler : public Malloced {
shift(dst, 0x5);
}
void shrl(Register dst) {
shift_32(dst, 0x5);
}
void store_rax(void* dst, RelocInfo::Mode mode);
void store_rax(ExternalReference ref);
......@@ -635,6 +685,10 @@ class Assembler : public Malloced {
immediate_arithmetic_op(0x5, dst, src);
}
void subl(Register dst, Register src) {
arithmetic_op_32(0x2B, dst, src);
}
void subl(const Operand& dst, Immediate src) {
immediate_arithmetic_op_32(0x5, dst, src);
}
......@@ -770,9 +824,12 @@ class Assembler : public Malloced {
void fwait();
void fnclex();
void fsin();
void fcos();
void frndint();
// SSE2 instructions
// SSE2 instructions
void cvttss2si(Register dst, const Operand& src);
void cvttsd2si(Register dst, const Operand& src);
......@@ -954,13 +1011,17 @@ class Assembler : public Malloced {
// similar, differing just in the opcode or in the reg field of the
// ModR/M byte.
void arithmetic_op(byte opcode, Register dst, Register src);
void arithmetic_op_32(byte opcode, Register dst, Register src);
void arithmetic_op(byte opcode, Register reg, const Operand& op);
void immediate_arithmetic_op(byte subcode, Register dst, Immediate src);
void immediate_arithmetic_op(byte subcode, const Operand& dst, Immediate src);
// Operate on a 32-bit word in memory.
// Operate on a 32-bit word in memory or register.
void immediate_arithmetic_op_32(byte subcode,
const Operand& dst,
Immediate src);
void immediate_arithmetic_op_32(byte subcode,
Register dst,
Immediate src);
// Operate on a byte in memory.
void immediate_arithmetic_op_8(byte subcode,
const Operand& dst,
......@@ -969,8 +1030,9 @@ class Assembler : public Malloced {
void shift(Register dst, Immediate shift_amount, int subcode);
// Shift dst by cl % 64 bits.
void shift(Register dst, int subcode);
void shift_32(Register dst, int subcode);
// void emit_farith(int b1, int b2, int i);
void emit_farith(int b1, int b2, int i);
// labels
// void print(Label* L);
......
This diff is collapsed.
......@@ -59,6 +59,18 @@ void MacroAssembler::Check(Condition cc, const char* msg) {
}
void MacroAssembler::NegativeZeroTest(Register result,
Register op,
Label* then_label) {
Label ok;
testq(result, result);
j(not_zero, &ok);
testq(op, op);
j(sign, then_label);
bind(&ok);
}
void MacroAssembler::ConstructAndTestJSFunction() {
const int initial_buffer_size = 4 * KB;
char* buffer = new char[initial_buffer_size];
......
......@@ -25,3 +25,107 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "v8.h"
#include "ic-inl.h"
#include "codegen-inl.h"
#include "stub-cache.h"
namespace v8 {
namespace internal {
Object* CallStubCompiler::CompileCallConstant(Object* a,
JSObject* b,
JSFunction* c,
StubCompiler::CheckType d,
Code::Flags flags) {
UNIMPLEMENTED();
return NULL;
}
Object* CallStubCompiler::CompileCallField(Object* a,
JSObject* b,
int c,
String* d,
Code::Flags flags) {
UNIMPLEMENTED();
return NULL;
}
Object* CallStubCompiler::CompileCallInterceptor(Object* a,
JSObject* b,
String* c) {
UNIMPLEMENTED();
return NULL;
}
Object* LoadStubCompiler::CompileLoadCallback(JSObject* a,
JSObject* b,
AccessorInfo* c,
String* d) {
UNIMPLEMENTED();
return NULL;
}
Object* LoadStubCompiler::CompileLoadConstant(JSObject* a,
JSObject* b,
Object* c,
String* d) {
UNIMPLEMENTED();
return NULL;
}
Object* LoadStubCompiler::CompileLoadField(JSObject* a,
JSObject* b,
int c,
String* d) {
UNIMPLEMENTED();
return NULL;
}
Object* LoadStubCompiler::CompileLoadInterceptor(JSObject* a,
JSObject* b,
String* c) {
UNIMPLEMENTED();
return NULL;
}
Object* StoreStubCompiler::CompileStoreCallback(JSObject* a,
AccessorInfo* b,
String* c) {
UNIMPLEMENTED();
return NULL;
}
Object* StoreStubCompiler::CompileStoreField(JSObject* a,
int b,
Map* c,
String* d) {
UNIMPLEMENTED();
return NULL;
}
Object* StoreStubCompiler::CompileStoreInterceptor(JSObject* a, String* b) {
UNIMPLEMENTED();
return NULL;
}
Object* StubCompiler::CompileLazyCompile(Code::Flags a) {
UNIMPLEMENTED();
return NULL;
}
} } // namespace v8::internal
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment