From 9273d5ca39df26af2a482b5feb41f562e78ab633 Mon Sep 17 00:00:00 2001 From: Joshua Warner Date: Sat, 3 May 2014 22:16:22 -0600 Subject: [PATCH] remove redundant Compiler::initLocal footprint parameter --- include/avian/codegen/compiler.h | 5 ++--- src/codegen/compiler.cpp | 5 +++-- src/compile.cpp | 12 ++++++------ 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/avian/codegen/compiler.h b/include/avian/codegen/compiler.h index 4c3d2bcf1c..099ae15ca5 100644 --- a/include/avian/codegen/compiler.h +++ b/include/avian/codegen/compiler.h @@ -93,10 +93,9 @@ class Compiler { virtual void return_(ir::Value* value) = 0; virtual void return_() = 0; - virtual void initLocal(unsigned size, unsigned index, ir::Type type) = 0; + virtual void initLocal(unsigned index, ir::Type type) = 0; virtual void initLocalsFromLogicalIp(unsigned logicalIp) = 0; - virtual void storeLocal(ir::Value* src, unsigned index) - = 0; + virtual void storeLocal(ir::Value* src, unsigned index) = 0; virtual ir::Value* loadLocal(ir::Type type, unsigned index) = 0; virtual void saveLocals() = 0; diff --git a/src/codegen/compiler.cpp b/src/codegen/compiler.cpp index fa5ba3d78f..019c139eb6 100644 --- a/src/codegen/compiler.cpp +++ b/src/codegen/compiler.cpp @@ -2490,9 +2490,10 @@ class MyCompiler: public Compiler { v->home = frameIndex(&c, index); } - virtual void initLocal(unsigned footprint, unsigned index, ir::Type type) + virtual void initLocal(unsigned index, ir::Type type) { - assert(&c, footprint == typeFootprint(&c, type)); + unsigned footprint = typeFootprint(&c, type); + assert(&c, index + footprint <= c.localFootprint); Value* v = value(&c, type); diff --git a/src/compile.cpp b/src/compile.cpp index bf7c7fd759..37b0a5f4ec 100644 --- a/src/compile.cpp +++ b/src/compile.cpp @@ -7030,7 +7030,7 @@ compile(MyThread* t, Context* context) unsigned index = methodParameterFootprint(t, context->method); if ((methodFlags(t, context->method) & ACC_STATIC) == 0) { frame.set(--index, Frame::Object); - c->initLocal(1, index, frame.types.object); + c->initLocal(index, frame.types.object); } for (MethodSpecIterator it @@ -7042,29 +7042,29 @@ compile(MyThread* t, Context* context) case 'L': case '[': frame.set(--index, Frame::Object); - c->initLocal(1, index, frame.types.object); + c->initLocal(index, frame.types.object); break; case 'J': frame.set(--index, Frame::Long); frame.set(--index, Frame::Long); - c->initLocal(2, index, frame.types.i8); + c->initLocal(index, frame.types.i8); break; case 'D': frame.set(--index, Frame::Long); frame.set(--index, Frame::Long); - c->initLocal(2, index, frame.types.f8); + c->initLocal(index, frame.types.f8); break; case 'F': frame.set(--index, Frame::Integer); - c->initLocal(1, index, frame.types.f4); + c->initLocal(index, frame.types.f4); break; default: frame.set(--index, Frame::Integer); - c->initLocal(1, index, frame.types.i4); + c->initLocal(index, frame.types.i4); break; } }