Author: [email protected]
Date: Mon Apr 27 00:03:10 2009
New Revision: 1794

Modified:
    branches/bleeding_edge/src/arm/assembler-arm.h
    branches/bleeding_edge/src/arm/builtins-arm.cc
    branches/bleeding_edge/src/arm/codegen-arm.cc
    branches/bleeding_edge/test/cctest/cctest.status
    branches/bleeding_edge/test/cctest/test-api.cc
    branches/bleeding_edge/test/cctest/test-hashmap.cc
    branches/bleeding_edge/test/cctest/test-list.cc

Log:
Fix bugs 145 and 323, preemption and apply on ARM.
Review URL: http://codereview.chromium.org/93121

Modified: branches/bleeding_edge/src/arm/assembler-arm.h
==============================================================================
--- branches/bleeding_edge/src/arm/assembler-arm.h      (original)
+++ branches/bleeding_edge/src/arm/assembler-arm.h      Mon Apr 27 00:03:10 2009
@@ -164,23 +164,23 @@

  // Condition field in instructions
  enum Condition {
-  eq =  0 << 28,
-  ne =  1 << 28,
-  cs =  2 << 28,
-  hs =  2 << 28,
-  cc =  3 << 28,
-  lo =  3 << 28,
-  mi =  4 << 28,
-  pl =  5 << 28,
-  vs =  6 << 28,
-  vc =  7 << 28,
-  hi =  8 << 28,
-  ls =  9 << 28,
-  ge = 10 << 28,
-  lt = 11 << 28,
-  gt = 12 << 28,
-  le = 13 << 28,
-  al = 14 << 28
+  eq =  0 << 28,  // Z set            equal.
+  ne =  1 << 28,  // Z clear          not equal.
+  cs =  2 << 28,  // C set            unsigned higher or same.
+  hs =  2 << 28,  // C set            unsigned higher or same.
+  cc =  3 << 28,  // C clear          unsigned lower.
+  lo =  3 << 28,  // C clear          unsigned lower.
+  mi =  4 << 28,  // N set            negative.
+  pl =  5 << 28,  // N clear          positive or zero.
+  vs =  6 << 28,  // V set            overflow.
+  vc =  7 << 28,  // V clear          no overflow.
+  hi =  8 << 28,  // C set, Z clear   unsigned higher.
+  ls =  9 << 28,  // C clear or Z set unsigned lower or same.
+  ge = 10 << 28,  // N == V           greater or equal.
+  lt = 11 << 28,  // N != V           less than.
+  gt = 12 << 28,  // Z clear, N == V  greater than.
+  le = 13 << 28,  // Z set or N != V  less then or equal
+  al = 14 << 28   //                  always.
  };



Modified: branches/bleeding_edge/src/arm/builtins-arm.cc
==============================================================================
--- branches/bleeding_edge/src/arm/builtins-arm.cc      (original)
+++ branches/bleeding_edge/src/arm/builtins-arm.cc      Mon Apr 27 00:03:10 2009
@@ -417,15 +417,35 @@
    __ push(r0);
    __ InvokeBuiltin(Builtins::APPLY_PREPARE, CALL_JS);

-  // Eagerly check for stack-overflow before starting to push the  
arguments.
-  // r0: number of arguments
-  Label okay;
+  Label no_preemption, retry_preemption;
+  __ bind(&retry_preemption);
    ExternalReference stack_guard_limit_address =
        ExternalReference::address_of_stack_guard_limit();
    __ mov(r2, Operand(stack_guard_limit_address));
    __ ldr(r2, MemOperand(r2));
+  __ cmp(sp, r2);
+  __ b(hi, &no_preemption);
+
+  // We have encountered a preemption or stack overflow already before we  
push
+  // the array contents.  Save r0 which is the Smi-tagged length of the  
array.
+  __ push(r0);
+
+  // Runtime routines expect at least one argument, so give it a Smi.
+  __ mov(r0, Operand(Smi::FromInt(0)));
+  __ push(r0);
+  __ CallRuntime(Runtime::kStackGuard, 1);
+
+  // Since we returned, it wasn't a stack overflow.  Restore r0 and try  
again.
+  __ pop(r0);
+  __ b(&retry_preemption);
+
+  __ bind(&no_preemption);
+
+  // Eagerly check for stack-overflow before starting to push the  
arguments.
+  // r0: number of arguments.
+  // r2: stack limit.
+  Label okay;
    __ sub(r2, sp, r2);
-  __ sub(r2, r2, Operand(3 * kPointerSize));  // limit, index, receiver

    __ cmp(r2, Operand(r0, LSL, kPointerSizeLog2 - kSmiTagSize));
    __ b(hi, &okay);

Modified: branches/bleeding_edge/src/arm/codegen-arm.cc
==============================================================================
--- branches/bleeding_edge/src/arm/codegen-arm.cc       (original)
+++ branches/bleeding_edge/src/arm/codegen-arm.cc       Mon Apr 27 00:03:10 2009
@@ -4596,7 +4596,9 @@
    __ ldr(ip, MemOperand(ip));
    __ cmp(sp, Operand(ip));
    __ b(hs, &within_limit);
-  // Do tail-call to runtime routine.
+  // Do tail-call to runtime routine.  Runtime routines expect at least one
+  // argument, so give it a Smi.
+  __ mov(r0, Operand(Smi::FromInt(0)));
    __ push(r0);
    __ TailCallRuntime(ExternalReference(Runtime::kStackGuard), 1);
    __ bind(&within_limit);

Modified: branches/bleeding_edge/test/cctest/cctest.status
==============================================================================
--- branches/bleeding_edge/test/cctest/cctest.status    (original)
+++ branches/bleeding_edge/test/cctest/cctest.status    Mon Apr 27 00:03:10  
2009
@@ -34,9 +34,6 @@

  test-debug: SKIP

-# Bug http://code.google.com/p/v8/issues/detail?id=323
-test-api/ApplyInterruption: SKIP
-
  # BUG(113): Test seems flaky on ARM.
  test-spaces/LargeObjectSpace: PASS || FAIL


Modified: branches/bleeding_edge/test/cctest/test-api.cc
==============================================================================
--- branches/bleeding_edge/test/cctest/test-api.cc      (original)
+++ branches/bleeding_edge/test/cctest/test-api.cc      Mon Apr 27 00:03:10 2009
@@ -6081,6 +6081,8 @@
          Local<String> source = String::New(c_source);
          Local<Script> script = Script::Compile(source);
          Local<Value> result = script->Run();
+        // Check that no exception was thrown.
+        CHECK(!result.IsEmpty());
        }
        int gc_after = gc_count_;
        gc_during_apply_ += gc_after - gc_before;

Modified: branches/bleeding_edge/test/cctest/test-hashmap.cc
==============================================================================
--- branches/bleeding_edge/test/cctest/test-hashmap.cc  (original)
+++ branches/bleeding_edge/test/cctest/test-hashmap.cc  Mon Apr 27 00:03:10  
2009
@@ -43,7 +43,7 @@
    IntSet() : map_(DefaultMatchFun)  {}

    void Insert(int x) {
-    CHECK(x != 0);  // 0 corresponds to (void*)NULL - illegal key value
+    CHECK_NE(0, x);  // 0 corresponds to (void*)NULL - illegal key value
      HashMap::Entry* p = map_.Lookup(reinterpret_cast<void*>(x), Hash(x),  
true);
      CHECK(p != NULL);  // insert is set!
      CHECK_EQ(reinterpret_cast<void*>(x), p->key);

Modified: branches/bleeding_edge/test/cctest/test-list.cc
==============================================================================
--- branches/bleeding_edge/test/cctest/test-list.cc     (original)
+++ branches/bleeding_edge/test/cctest/test-list.cc     Mon Apr 27 00:03:10 2009
@@ -63,5 +63,5 @@

    // Add an existing element, the backing store should have to grow.
    list.Add(list[0]);
-  CHECK(list[4] == 1);
+  CHECK_EQ(1, list[4]);
  }

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

Reply via email to