1 /* |
1 /* |
2 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
24 */ |
24 */ |
25 |
25 |
26 package com.sun.tools.javac.jvm; |
26 package com.sun.tools.javac.jvm; |
27 |
27 |
28 import com.sun.tools.javac.code.*; |
28 import com.sun.tools.javac.code.*; |
29 |
|
30 import com.sun.tools.javac.code.Symbol.*; |
29 import com.sun.tools.javac.code.Symbol.*; |
31 import com.sun.tools.javac.code.Type.*; |
30 import com.sun.tools.javac.code.Type.*; |
32 import com.sun.tools.javac.jvm.Code.*; |
31 import com.sun.tools.javac.jvm.Code.*; |
33 import com.sun.tools.javac.tree.JCTree; |
32 import com.sun.tools.javac.tree.JCTree; |
|
33 import com.sun.tools.javac.util.Assert; |
34 |
34 |
35 import static com.sun.tools.javac.jvm.ByteCodes.*; |
35 import static com.sun.tools.javac.jvm.ByteCodes.*; |
36 |
36 |
37 /** A helper class for code generation. Items are objects |
37 /** A helper class for code generation. Items are objects |
38 * that stand for addressable entities in the bytecode. Each item |
38 * that stand for addressable entities in the bytecode. Each item |
467 /** An item representing a dynamic call site. |
467 /** An item representing a dynamic call site. |
468 */ |
468 */ |
469 class DynamicItem extends StaticItem { |
469 class DynamicItem extends StaticItem { |
470 DynamicItem(Symbol member) { |
470 DynamicItem(Symbol member) { |
471 super(member); |
471 super(member); |
472 assert member.owner == syms.invokeDynamicType.tsym; |
472 Assert.check(member.owner == syms.invokeDynamicType.tsym); |
473 } |
473 } |
474 |
474 |
475 Item load() { |
475 Item load() { |
476 assert false; |
476 Assert.error(); |
477 return null; |
477 return null; |
478 } |
478 } |
479 |
479 |
480 void store() { |
480 void store() { |
481 assert false; |
481 Assert.error(); |
482 } |
482 } |
483 |
483 |
484 Item invoke() { |
484 Item invoke() { |
485 // assert target.hasNativeInvokeDynamic(); |
485 // assert target.hasNativeInvokeDynamic(); |
486 MethodType mtype = (MethodType)member.erasure(types); |
486 MethodType mtype = (MethodType)member.erasure(types); |