diff -r f9c4371d59d4 -r 7721042bdb67 src/compiler/HIR.cpp --- a/src/compiler/HIR.cpp Thu Dec 27 21:07:03 2012 -0800 +++ b/src/compiler/HIR.cpp Fri Dec 28 17:13:51 2012 -0800 @@ -52,6 +52,7 @@ void visitIndex(HIndex *index); void visitPostIncDec(HPostIncDec *hir); void visitToRef(HToRef *hir); + void visitNewDependentArray(HNewDependentArray *hir); private: Zone *zone_; @@ -438,6 +439,10 @@ unary->in()->accept(this); switch (unary->token()) { + case TOK_TILDE: + __ bitnot(); + break; + case TOK_MINUS: if (unary->type()->isFloat()) __ neg_f(); @@ -474,6 +479,27 @@ } void +HIRTranslator::visitNewDependentArray(HNewDependentArray *hir) +{ + hir->base()->accept(this); + hir->index()->accept(this); + + Local type(zone_, ArrayType::cast(hir->type())); + + // Attach an actual map to the dependent type, in case it's a new + // type. + if (!ArrayMap::Attach(zone_, type)) + return; + + // The dependent map is used for the opcode, but is not attached. + Local map(zone_, ArrayMap::NewDependent(zone_, type)); + if (!map) + return; + + __ deparray(map); +} + +void ke::EmitHIR(Zone *zone, BytecodeEmitter &emitter, HIR *hir) { HIRTranslator translator(zone, emitter);