Mercurial > hg > graal-jvmci-8
comparison src/cpu/sparc/vm/assembler_sparc.hpp @ 710:e5b0439ef4ae
6655638: dynamic languages need method handles
Summary: initial implementation, with known omissions (x86/64, sparc, compiler optim., c-oops, C++ interp.)
Reviewed-by: kvn, twisti, never
author | jrose |
---|---|
date | Wed, 08 Apr 2009 10:56:49 -0700 |
parents | c89f86385056 |
children | 6b2273dd6fa9 |
comparison
equal
deleted
inserted
replaced
709:1d037ecd7960 | 710:e5b0439ef4ae |
---|---|
82 | 82 |
83 // These globals are used as short-lived scratch registers in the compiler: | 83 // These globals are used as short-lived scratch registers in the compiler: |
84 | 84 |
85 REGISTER_DECLARATION(Register, Gtemp , G5); | 85 REGISTER_DECLARATION(Register, Gtemp , G5); |
86 | 86 |
87 // JSR 292 fixed register usages: | |
88 REGISTER_DECLARATION(Register, G5_method_type , G5); | |
89 REGISTER_DECLARATION(Register, G3_method_handle , G3); | |
90 | |
87 // The compiler requires that G5_megamorphic_method is G5_inline_cache_klass, | 91 // The compiler requires that G5_megamorphic_method is G5_inline_cache_klass, |
88 // because a single patchable "set" instruction (NativeMovConstReg, | 92 // because a single patchable "set" instruction (NativeMovConstReg, |
89 // or NativeMovConstPatching for compiler1) instruction | 93 // or NativeMovConstPatching for compiler1) instruction |
90 // serves to set up either quantity, depending on whether the compiled | 94 // serves to set up either quantity, depending on whether the compiled |
91 // call site is an inline cache or is megamorphic. See the function | 95 // call site is an inline cache or is megamorphic. See the function |
92 // CompiledIC::set_to_megamorphic. | 96 // CompiledIC::set_to_megamorphic. |
93 // | 97 // |
94 // On the other hand, G5_inline_cache_klass must differ from G5_method, | 98 // If a inline cache targets an interpreted method, then the |
95 // because both registers are needed for an inline cache that calls | 99 // G5 register will be used twice during the call. First, |
96 // an interpreted method. | 100 // the call site will be patched to load a compiledICHolder |
101 // into G5. (This is an ordered pair of ic_klass, method.) | |
102 // The c2i adapter will first check the ic_klass, then load | |
103 // G5_method with the method part of the pair just before | |
104 // jumping into the interpreter. | |
97 // | 105 // |
98 // Note that G5_method is only the method-self for the interpreter, | 106 // Note that G5_method is only the method-self for the interpreter, |
99 // and is logically unrelated to G5_megamorphic_method. | 107 // and is logically unrelated to G5_megamorphic_method. |
100 // | 108 // |
101 // Invariants on G2_thread (the JavaThread pointer): | 109 // Invariants on G2_thread (the JavaThread pointer): |
1929 inline void load_ptr_contents( Address& a, Register d, int offset = 0 ); | 1937 inline void load_ptr_contents( Address& a, Register d, int offset = 0 ); |
1930 inline void store_contents( Register s, Address& a, int offset = 0 ); | 1938 inline void store_contents( Register s, Address& a, int offset = 0 ); |
1931 inline void store_ptr_contents( Register s, Address& a, int offset = 0 ); | 1939 inline void store_ptr_contents( Register s, Address& a, int offset = 0 ); |
1932 inline void jumpl_to( Address& a, Register d, int offset = 0 ); | 1940 inline void jumpl_to( Address& a, Register d, int offset = 0 ); |
1933 inline void jump_to( Address& a, int offset = 0 ); | 1941 inline void jump_to( Address& a, int offset = 0 ); |
1942 inline void jump_indirect_to( Address& a, Register temp, int ld_offset = 0, int jmp_offset = 0 ); | |
1934 | 1943 |
1935 // ring buffer traceable jumps | 1944 // ring buffer traceable jumps |
1936 | 1945 |
1937 void jmp2( Register r1, Register r2, const char* file, int line ); | 1946 void jmp2( Register r1, Register r2, const char* file, int line ); |
1938 void jmp ( Register r1, int offset, const char* file, int line ); | 1947 void jmp ( Register r1, int offset, const char* file, int line ); |
2364 Register super_klass, | 2373 Register super_klass, |
2365 Register temp_reg, | 2374 Register temp_reg, |
2366 Register temp2_reg, | 2375 Register temp2_reg, |
2367 Label& L_success); | 2376 Label& L_success); |
2368 | 2377 |
2378 // method handles (JSR 292) | |
2379 void check_method_handle_type(Register mtype_reg, Register mh_reg, | |
2380 Register temp_reg, | |
2381 Label& wrong_method_type); | |
2382 void jump_to_method_handle_entry(Register mh_reg, Register temp_reg); | |
2383 // offset relative to Gargs of argument at tos[arg_slot]. | |
2384 // (arg_slot == 0 means the last argument, not the first). | |
2385 RegisterOrConstant argument_offset(RegisterOrConstant arg_slot, | |
2386 int extra_slot_offset = 0); | |
2387 | |
2369 | 2388 |
2370 // Stack overflow checking | 2389 // Stack overflow checking |
2371 | 2390 |
2372 // Note: this clobbers G3_scratch | 2391 // Note: this clobbers G3_scratch |
2373 void bang_stack_with_offset(int offset) { | 2392 void bang_stack_with_offset(int offset) { |