Mercurial > hg > truffle
comparison src/share/vm/utilities/constantTag.hpp @ 1602:136b78722a08
6939203: JSR 292 needs method handle constants
Summary: Add new CP types CONSTANT_MethodHandle, CONSTANT_MethodType; extend 'ldc' bytecode.
Reviewed-by: twisti, never
author | jrose |
---|---|
date | Wed, 09 Jun 2010 18:50:45 -0700 |
parents | c18cbe5936b8 |
children | 083fde3b838e |
comparison
equal
deleted
inserted
replaced
1585:49fac4acd688 | 1602:136b78722a08 |
---|---|
76 bool is_klass_reference() const { return is_klass_index() || is_unresolved_klass(); } | 76 bool is_klass_reference() const { return is_klass_index() || is_unresolved_klass(); } |
77 bool is_klass_or_reference() const{ return is_klass() || is_klass_reference(); } | 77 bool is_klass_or_reference() const{ return is_klass() || is_klass_reference(); } |
78 bool is_field_or_method() const { return is_field() || is_method() || is_interface_method(); } | 78 bool is_field_or_method() const { return is_field() || is_method() || is_interface_method(); } |
79 bool is_symbol() const { return is_utf8(); } | 79 bool is_symbol() const { return is_utf8(); } |
80 | 80 |
81 bool is_method_type() const { return _tag == JVM_CONSTANT_MethodType; } | |
82 bool is_method_handle() const { return _tag == JVM_CONSTANT_MethodHandle; } | |
83 | |
84 constantTag() { | |
85 _tag = JVM_CONSTANT_Invalid; | |
86 } | |
81 constantTag(jbyte tag) { | 87 constantTag(jbyte tag) { |
82 assert((tag >= 0 && tag <= JVM_CONSTANT_NameAndType) || | 88 assert((tag >= 0 && tag <= JVM_CONSTANT_NameAndType) || |
89 (tag >= JVM_CONSTANT_MethodHandle && tag <= JVM_CONSTANT_MethodType) || | |
83 (tag >= JVM_CONSTANT_InternalMin && tag <= JVM_CONSTANT_InternalMax), "Invalid constant tag"); | 90 (tag >= JVM_CONSTANT_InternalMin && tag <= JVM_CONSTANT_InternalMax), "Invalid constant tag"); |
84 _tag = tag; | 91 _tag = tag; |
85 } | 92 } |
86 | 93 |
87 jbyte value() { return _tag; } | 94 jbyte value() { return _tag; } |
88 | 95 |
96 BasicType basic_type() const; // if used with ldc, what kind of value gets pushed? | |
97 | |
98 const char* internal_name() const; // for error reporting | |
99 | |
89 void print_on(outputStream* st) const PRODUCT_RETURN; | 100 void print_on(outputStream* st) const PRODUCT_RETURN; |
90 }; | 101 }; |