Author: [email protected]
Date: Wed Jun 24 06:48:09 2009
New Revision: 2265

Modified:
    branches/bleeding_edge/src/bootstrapper.cc
    branches/bleeding_edge/src/x64/assembler-x64.cc
    branches/bleeding_edge/src/x64/assembler-x64.h
    branches/bleeding_edge/src/x64/codegen-x64.cc
    branches/bleeding_edge/src/x64/macro-assembler-x64.cc

Log:
X64 implementation: Start compiling native functions.
Review URL: http://codereview.chromium.org/146083

Modified: branches/bleeding_edge/src/bootstrapper.cc
==============================================================================
--- branches/bleeding_edge/src/bootstrapper.cc  (original)
+++ branches/bleeding_edge/src/bootstrapper.cc  Wed Jun 24 06:48:09 2009
@@ -1113,11 +1113,8 @@
    }

  #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



Modified: branches/bleeding_edge/src/x64/assembler-x64.cc
==============================================================================
--- branches/bleeding_edge/src/x64/assembler-x64.cc     (original)
+++ branches/bleeding_edge/src/x64/assembler-x64.cc     Wed Jun 24 06:48:09 2009
@@ -1110,6 +1110,15 @@
  }


+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_;

Modified: branches/bleeding_edge/src/x64/assembler-x64.h
==============================================================================
--- branches/bleeding_edge/src/x64/assembler-x64.h      (original)
+++ branches/bleeding_edge/src/x64/assembler-x64.h      Wed Jun 24 06:48:09 2009
@@ -495,6 +495,7 @@
    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.

Modified: branches/bleeding_edge/src/x64/codegen-x64.cc
==============================================================================
--- branches/bleeding_edge/src/x64/codegen-x64.cc       (original)
+++ branches/bleeding_edge/src/x64/codegen-x64.cc       Wed Jun 24 06:48:09 2009
@@ -206,8 +206,10 @@
                        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
  }



Modified: branches/bleeding_edge/src/x64/macro-assembler-x64.cc
==============================================================================
--- branches/bleeding_edge/src/x64/macro-assembler-x64.cc       (original)
+++ branches/bleeding_edge/src/x64/macro-assembler-x64.cc       Wed Jun 24  
06:48:09 2009
@@ -694,7 +694,8 @@
    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.

--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to