X64 implementation: Start compiling native functions.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2265 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
whesse@chromium.org 2009-06-24 13:48:09 +00:00
parent a367522a1a
commit cc271fe751
5 changed files with 17 additions and 7 deletions

View File

@ -1113,11 +1113,8 @@ bool Genesis::InstallNatives() {
}
#ifdef V8_HOST_ARCH_64_BIT
// TODO(X64): Remove these tests when code generation works and is stable.
MacroAssembler::ConstructAndTestJSFunction();
// TODO(X64): Remove this test when code generation works and is stable.
CodeGenerator::TestCodeGenerator();
// TODO(X64): Reenable remaining initialization when code generation works.
return true;
#endif // V8_HOST_ARCH_64_BIT

View File

@ -1110,6 +1110,15 @@ void Assembler::movsxlq(Register dst, Register src) {
}
void Assembler::movsxlq(Register dst, const Operand& src) {
EnsureSpace ensure_space(this);
last_pc_ = pc_;
emit_rex_64(dst, src);
emit(0x63);
emit_operand(dst, src);
}
void Assembler::movzxbq(Register dst, const Operand& src) {
EnsureSpace ensure_space(this);
last_pc_ = pc_;

View File

@ -495,6 +495,7 @@ class Assembler : public Malloced {
void movq(Register dst, Handle<Object> handle, RelocInfo::Mode rmode);
void movsxlq(Register dst, Register src);
void movsxlq(Register dst, const Operand& src);
void movzxbq(Register dst, const Operand& src);
// New x64 instruction to load from an immediate 64-bit pointer into RAX.

View File

@ -206,8 +206,10 @@ void CodeGenerator::TestCodeGenerator() {
NULL,
&pending_exceptions);
// Function compiles and runs, but returns a JSFunction object.
CHECK(result->IsSmi());
CHECK_EQ(47, Smi::cast(*result)->value());
#ifdef DEBUG
PrintF("Result of test function: ");
result->Print();
#endif
}

View File

@ -694,7 +694,8 @@ void MacroAssembler::InvokeFunction(Register function,
ASSERT(function.is(rdi));
movq(rdx, FieldOperand(function, JSFunction::kSharedFunctionInfoOffset));
movq(rsi, FieldOperand(function, JSFunction::kContextOffset));
movl(rbx, FieldOperand(rdx, SharedFunctionInfo::kFormalParameterCountOffset));
movsxlq(rbx,
FieldOperand(rdx, SharedFunctionInfo::kFormalParameterCountOffset));
movq(rdx, FieldOperand(rdx, SharedFunctionInfo::kCodeOffset));
// Advances rdx to the end of the Code object header, to the start of
// the executable code.