001 /* 002 * The JastAdd Extensible Java Compiler (http://jastadd.org) is covered 003 * by the modified BSD License. You should have received a copy of the 004 * modified BSD license with this compiler. 005 * 006 * Copyright (c) 2005-2008, Torbjorn Ekman 007 * All rights reserved. 008 */ 009 010 aspect Version { 011 refine GenerateClassfile eq TypeDecl.majorVersion() { 012 return 49; 013 } 014 015 016 refine Transformations public void ClassAccess.transformation() { 017 super.transformation(); 018 } 019 refine CreateBCode public void ClassAccess.createBCode(CodeGeneration gen) { 020 if(prevExpr().type().isPrimitiveType() || prevExpr().type().isVoid()) 021 refined(gen); 022 else { 023 int index = gen.constantPool().addClass(prevExpr().type().jvmName()); 024 if(index < 256) 025 gen.emit(Bytecode.LDC).add(index); 026 else 027 gen.emit(Bytecode.LDC_W).add2(index); 028 } 029 } 030 }