1.1 --- a/src/compiler/HIR.cpp Sat Dec 22 23:18:57 2012 -0800
1.2 +++ b/src/compiler/HIR.cpp Mon Dec 24 02:49:20 2012 -0800
1.3 @@ -19,6 +19,7 @@
1.4 #include "AST.h"
1.5 #include "HIR.h"
1.6 #include "BytecodeEmitter.h"
1.7 +#include "../Strings.h"
1.8 #include "../Heap-inl.h"
1.9 #include "../Handles-inl.h"
1.10
1.11 @@ -39,6 +40,7 @@
1.12
1.13 void visitFloat(HFloat *hir);
1.14 void visitInteger(HInteger *hir);
1.15 + void visitArray(HArray *hir);
1.16 void visitCall(HCall *call);
1.17 void visitStore(HStore *store);
1.18 void visitBinary(HBinary *binary);
1.19 @@ -69,6 +71,18 @@
1.20 }
1.21
1.22 void
1.23 +HIRTranslator::visitArray(HArray *hir)
1.24 +{
1.25 + __ object(hir->array());
1.26 +
1.27 + if (!hir->type()->isConst()) {
1.28 + // If the type isn't const, we have to assume a consumer may modify
1.29 + // the array, and therefore we have to duplicate it here.
1.30 + __ duparray();
1.31 + }
1.32 +}
1.33 +
1.34 +void
1.35 HIRTranslator::visitCall(HCall *call)
1.36 {
1.37 Local<FunctionType> fun(zone_, FunctionType::cast(call->callee()->type()));