Push version 1.2.7 to trunk.

Improved debugger and profiler support.

Reduced compilation time by improving the handling of deferred code.

Optimized interceptor accesses where the property is on the object on which the interceptors is attached.

Fixed compilation problem on GCC 4.4 by changing the stack alignment to 16 bytes.

Fixed handle creation to follow stric aliasing rules.

Fixed compilation on FreeBSD.

Introduced API for forcing the deletion of a property ignoring interceptors and attributes.


git-svn-id: http://v8.googlecode.com/svn/trunk@2121 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc
index 5e6dd3d..54c299d 100644
--- a/src/x64/macro-assembler-x64.cc
+++ b/src/x64/macro-assembler-x64.cc
@@ -29,6 +29,7 @@
 
 #include "bootstrapper.h"
 #include "codegen-inl.h"
+#include "macro-assembler-x64.h"
 
 namespace v8 {
 namespace internal {
@@ -41,8 +42,75 @@
     code_object_(Heap::undefined_value()) {
 }
 
+
 void MacroAssembler::TailCallRuntime(ExternalReference const& a, int b) {
   UNIMPLEMENTED();
 }
 
+
+void MacroAssembler::Set(Register dst, int64_t x) {
+  if (is_int32(x)) {
+    movq(dst, Immediate(x));
+  } else if (is_uint32(x)) {
+    movl(dst, Immediate(x));
+  } else {
+    movq(dst, x, RelocInfo::NONE);
+  }
+}
+
+
+void MacroAssembler::Set(const Operand& dst, int64_t x) {
+  if (is_int32(x)) {
+    movq(kScratchRegister, Immediate(x));
+  } else if (is_uint32(x)) {
+    movl(kScratchRegister, Immediate(x));
+  } else {
+    movq(kScratchRegister, x, RelocInfo::NONE);
+  }
+  movq(dst, kScratchRegister);
+}
+
+
+void MacroAssembler::PushTryHandler(CodeLocation try_location,
+                                    HandlerType type) {
+  // The pc (return address) is already on TOS.
+  // This code pushes state, code, frame pointer and parameter pointer.
+  // Check that they are expected next on the stack, int that order.
+  ASSERT_EQ(StackHandlerConstants::kStateOffset,
+            StackHandlerConstants::kPCOffset - kPointerSize);
+  ASSERT_EQ(StackHandlerConstants::kCodeOffset,
+            StackHandlerConstants::kStateOffset - kPointerSize);
+  ASSERT_EQ(StackHandlerConstants::kFPOffset,
+            StackHandlerConstants::kCodeOffset - kPointerSize);
+  ASSERT_EQ(StackHandlerConstants::kPPOffset,
+            StackHandlerConstants::kFPOffset - kPointerSize);
+
+  if (try_location == IN_JAVASCRIPT) {
+    if (type == TRY_CATCH_HANDLER) {
+      push(Immediate(StackHandler::TRY_CATCH));
+    } else {
+      push(Immediate(StackHandler::TRY_FINALLY));
+    }
+    push(Immediate(Smi::FromInt(StackHandler::kCodeNotPresent)));
+    push(rbp);
+    push(rdi);
+  } else {
+    ASSERT(try_location == IN_JS_ENTRY);
+    // The parameter pointer is meaningless here and ebp does not
+    // point to a JS frame. So we save NULL for both pp and ebp. We
+    // expect the code throwing an exception to check ebp before
+    // dereferencing it to restore the context.
+    push(Immediate(StackHandler::ENTRY));
+    push(Immediate(Smi::FromInt(StackHandler::kCodeNotPresent)));
+    push(Immediate(0));  // NULL frame pointer
+    push(Immediate(0));  // NULL parameter pointer
+  }
+  movq(kScratchRegister, ExternalReference(Top::k_handler_address));
+  // Cached TOS.
+  movq(rax, Operand(kScratchRegister, 0));
+  // Link this handler.
+  movq(Operand(kScratchRegister, 0), rsp);
+}
+
+
 } }  // namespace v8::internal