Make LeakSanitizer happy, part 2. Fixed register usage on the way.
authorsvenpanne@chromium.org <svenpanne@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 7 Feb 2014 07:06:13 +0000 (07:06 +0000)
committersvenpanne@chromium.org <svenpanne@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 7 Feb 2014 07:06:13 +0000 (07:06 +0000)
Note that according to the System V ABI for AMD64, rbx must be
preserved across calls. We actually crash with clang in the x64
assembler tests without that fix, we were lucky with GCC.

R=yangguo@chromium.org

Review URL: https://codereview.chromium.org/144313017

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19178 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

test/cctest/test-assembler-x64.cc
test/cctest/test-global-handles.cc
test/cctest/test-heap.cc

index 7d17a33..23c7465 100644 (file)
@@ -179,10 +179,10 @@ TEST(AssemblerX64XchglOperations) {
   Assembler assm(CcTest::i_isolate(), buffer, static_cast<int>(actual_size));
 
   __ movq(rax, Operand(arg1, 0));
-  __ movq(rbx, Operand(arg2, 0));
-  __ xchgl(rax, rbx);
+  __ movq(rdx, Operand(arg2, 0));
+  __ xchgl(rax, rdx);
   __ movq(Operand(arg1, 0), rax);
-  __ movq(Operand(arg2, 0), rbx);
+  __ movq(Operand(arg2, 0), rdx);
   __ ret(0);
 
   CodeDesc desc;
@@ -279,8 +279,8 @@ TEST(AssemblerX64TestlOperations) {
   // Set rax with the ZF flag of the testl instruction.
   Label done;
   __ movq(rax, Immediate(1));
-  __ movq(rbx, Operand(arg2, 0));
-  __ testl(Operand(arg1, 0), rbx);
+  __ movq(rdx, Operand(arg2, 0));
+  __ testl(Operand(arg1, 0), rdx);
   __ j(zero, &done, Label::kNear);
   __ movq(rax, Immediate(0));
   __ bind(&done);
index 2261a5a..48b6655 100644 (file)
@@ -316,6 +316,8 @@ TEST(ImplicitReferences) {
          reinterpret_cast<HeapObject**>(g2s1.location()));
   ASSERT(implicit_refs->at(1)->length == 1);
   ASSERT(implicit_refs->at(1)->children[0] == g2c1.location());
+  global_handles->RemoveObjectGroups();
+  global_handles->RemoveImplicitRefGroups();
 }
 
 
index 1bb89eb..3e8d93b 100644 (file)
@@ -3483,7 +3483,7 @@ TEST(DeferredHandles) {
   DeferredHandleScope deferred(isolate);
   DummyVisitor visitor;
   isolate->handle_scope_implementer()->Iterate(&visitor);
-  deferred.Detach();
+  delete deferred.Detach();
 }