// 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.
};
__ 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);
__ 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);
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
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;
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);
// Add an existing element, the backing store should have to grow.
list.Add(list[0]);
- CHECK(list[4] == 1);
+ CHECK_EQ(1, list[4]);
}