From 21cb1c3c8fe6c7f9d0921cb6a016874a10a627c1 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Tue, 20 May 2008 16:47:53 -0600 Subject: [PATCH] remove Event::validate, since it is no longer needed and actually causes trouble --- src/compiler.cpp | 19 ++++++------------- test/Misc.java | 7 +++++++ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/compiler.cpp b/src/compiler.cpp index 1dbacd819d..e890b589d3 100644 --- a/src/compiler.cpp +++ b/src/compiler.cpp @@ -55,8 +55,6 @@ class Site { virtual void thaw(Context*) { } - virtual void validate(Context*, Stack*, unsigned, Value*) { } - virtual OperandType type(Context*) = 0; virtual Assembler::Operand* asAssemblerOperand(Context*) = 0; @@ -581,7 +579,12 @@ class RegisterSite: public Site { } virtual void acquire(Context* c, Stack* stack, unsigned size, Value* v) { - validate(c, stack, size, v); + low = ::validate(c, mask, stack, size, v, this, low); + if (size > BytesPerWord) { + ::freeze(low); + high = ::validate(c, mask >> 32, stack, size, v, this, high); + ::thaw(low); + } } virtual void release(Context* c) { @@ -611,15 +614,6 @@ class RegisterSite: public Site { } } - virtual void validate(Context* c, Stack* stack, unsigned size, Value* v) { - low = ::validate(c, mask, stack, size, v, this, low); - if (size > BytesPerWord) { - ::freeze(low); - high = ::validate(c, mask >> 32, stack, size, v, this, high); - ::thaw(low); - } - } - virtual OperandType type(Context*) { return RegisterOperand; } @@ -2196,7 +2190,6 @@ readSource(Context* c, Stack* stack, Read* r) apply(c, Move, r->size, site, target); return target; } else { - site->validate(c, stack, r->size, r->value); return site; } } diff --git a/test/Misc.java b/test/Misc.java index 9b570794d3..5ccc1df9d9 100644 --- a/test/Misc.java +++ b/test/Misc.java @@ -89,7 +89,14 @@ public class Misc { return a + b + c; } + private static long roundUp(long a, long b) { + a += b - 1L; + return a - (a % b); + } + public static void main(String[] args) { + expect(roundUp(156, 2) == 156); + { Foo foo = new Foo(); int x = foo.a + foo.b + foo.c; bar(foo.a, foo.b, foo.c);