Mercurial > hg > truffle
comparison src/share/vm/prims/methodHandles.hpp @ 1299:9eba43136cb5
6934494: JSR 292 MethodHandles adapters should be generated into their own CodeBlob
Summary: Passing a null pointer to an InvokeDynamic function call should lead to a NullPointerException.
Reviewed-by: kvn, never
author | twisti |
---|---|
date | Tue, 16 Mar 2010 11:52:17 +0100 |
parents | 987e948ebbc8 |
children | 76c1d7d13ec5 |
comparison
equal
deleted
inserted
replaced
1298:da06d1795d84 | 1299:9eba43136cb5 |
---|---|
113 static bool _enabled; | 113 static bool _enabled; |
114 static MethodHandleEntry* _entries[_EK_LIMIT]; | 114 static MethodHandleEntry* _entries[_EK_LIMIT]; |
115 static const char* _entry_names[_EK_LIMIT+1]; | 115 static const char* _entry_names[_EK_LIMIT+1]; |
116 static jobject _raise_exception_method; | 116 static jobject _raise_exception_method; |
117 | 117 |
118 // Adapters. | |
119 static MethodHandlesAdapterBlob* _adapter_code; | |
120 static int _adapter_code_size; | |
121 | |
118 static bool ek_valid(EntryKind ek) { return (uint)ek < (uint)_EK_LIMIT; } | 122 static bool ek_valid(EntryKind ek) { return (uint)ek < (uint)_EK_LIMIT; } |
119 static bool conv_op_valid(int op) { return (uint)op < (uint)CONV_OP_LIMIT; } | 123 static bool conv_op_valid(int op) { return (uint)op < (uint)CONV_OP_LIMIT; } |
120 | 124 |
121 public: | 125 public: |
122 static bool have_entry(EntryKind ek) { return ek_valid(ek) && _entries[ek] != NULL; } | 126 static bool have_entry(EntryKind ek) { return ek_valid(ek) && _entries[ek] != NULL; } |
228 int mflags, klassOop caller, | 232 int mflags, klassOop caller, |
229 int skip, objArrayOop results); | 233 int skip, objArrayOop results); |
230 // bit values for suppress argument to expand_MemberName: | 234 // bit values for suppress argument to expand_MemberName: |
231 enum { _suppress_defc = 1, _suppress_name = 2, _suppress_type = 4 }; | 235 enum { _suppress_defc = 1, _suppress_name = 2, _suppress_type = 4 }; |
232 | 236 |
233 // called from InterpreterGenerator and StubGenerator | 237 // Generate MethodHandles adapters. |
238 static void generate_adapters(); | |
239 | |
240 // Called from InterpreterGenerator and MethodHandlesAdapterGenerator. | |
234 static address generate_method_handle_interpreter_entry(MacroAssembler* _masm); | 241 static address generate_method_handle_interpreter_entry(MacroAssembler* _masm); |
235 static void generate_method_handle_stub(MacroAssembler* _masm, EntryKind ek); | 242 static void generate_method_handle_stub(MacroAssembler* _masm, EntryKind ek); |
236 | 243 |
237 // argument list parsing | 244 // argument list parsing |
238 static int argument_slot(oop method_type, int arg); | 245 static int argument_slot(oop method_type, int arg); |
445 static MethodHandleEntry* finish_compiled_entry(MacroAssembler* masm, address start_addr); | 452 static MethodHandleEntry* finish_compiled_entry(MacroAssembler* masm, address start_addr); |
446 }; | 453 }; |
447 | 454 |
448 address MethodHandles::from_compiled_entry(EntryKind ek) { return entry(ek)->from_compiled_entry(); } | 455 address MethodHandles::from_compiled_entry(EntryKind ek) { return entry(ek)->from_compiled_entry(); } |
449 address MethodHandles::from_interpreted_entry(EntryKind ek) { return entry(ek)->from_interpreted_entry(); } | 456 address MethodHandles::from_interpreted_entry(EntryKind ek) { return entry(ek)->from_interpreted_entry(); } |
457 | |
458 | |
459 //------------------------------------------------------------------------------ | |
460 // MethodHandlesAdapterGenerator | |
461 // | |
462 class MethodHandlesAdapterGenerator : public StubCodeGenerator { | |
463 public: | |
464 MethodHandlesAdapterGenerator(CodeBuffer* code) : StubCodeGenerator(code) {} | |
465 | |
466 void generate(); | |
467 }; |