54 if (base == NULL) {
55 return NULL; // CodeBuffer::expand failed
56 }
57 // static stub relocation stores the instruction address of the call
58 __ relocate(static_stub_Relocation::spec(mark));
59 // static stub relocation also tags the Method* in the code-stream.
60 __ mov_metadata(rmethod, (Metadata*)NULL);
61 __ movptr(rscratch1, 0);
62 __ br(rscratch1);
63
64 assert((__ offset() - offset) <= (int)to_interp_stub_size(), "stub too big");
65 __ end_a_stub();
66 return base;
67 }
68 #undef __
69
70 int CompiledStaticCall::to_interp_stub_size() {
71 return 7 * NativeInstruction::instruction_size;
72 }
73
74 // Relocation entries for call stub, compiled java to interpreter.
75 int CompiledStaticCall::reloc_to_interp_stub() {
76 return 4; // 3 in emit_to_interp_stub + 1 in emit_call
77 }
78
79 void CompiledDirectStaticCall::set_to_interpreted(const methodHandle& callee, address entry) {
80 address stub = find_stub(false /* is_aot */);
81 guarantee(stub != NULL, "stub not found");
82
83 if (TraceICs) {
84 ResourceMark rm;
85 tty->print_cr("CompiledDirectStaticCall@" INTPTR_FORMAT ": set_to_interpreted %s",
86 p2i(instruction_address()),
87 callee->name_and_sig_as_C_string());
88 }
89
90 // Creation also verifies the object.
91 NativeMovConstReg* method_holder = nativeMovConstReg_at(stub);
92 #ifndef PRODUCT
93 NativeGeneralJump* jump = nativeGeneralJump_at(method_holder->next_instruction_address());
|
54 if (base == NULL) {
55 return NULL; // CodeBuffer::expand failed
56 }
57 // static stub relocation stores the instruction address of the call
58 __ relocate(static_stub_Relocation::spec(mark));
59 // static stub relocation also tags the Method* in the code-stream.
60 __ mov_metadata(rmethod, (Metadata*)NULL);
61 __ movptr(rscratch1, 0);
62 __ br(rscratch1);
63
64 assert((__ offset() - offset) <= (int)to_interp_stub_size(), "stub too big");
65 __ end_a_stub();
66 return base;
67 }
68 #undef __
69
70 int CompiledStaticCall::to_interp_stub_size() {
71 return 7 * NativeInstruction::instruction_size;
72 }
73
74 int CompiledStaticCall::to_trampoline_stub_size() {
75 // Somewhat pessimistically, we count 3 instructions here (although
76 // there are only two) because we sometimes emit an alignment nop.
77 // Trampoline stubs are always word aligned.
78 return 3 * NativeInstruction::instruction_size + wordSize;
79 }
80
81 // Relocation entries for call stub, compiled java to interpreter.
82 int CompiledStaticCall::reloc_to_interp_stub() {
83 return 4; // 3 in emit_to_interp_stub + 1 in emit_call
84 }
85
86 void CompiledDirectStaticCall::set_to_interpreted(const methodHandle& callee, address entry) {
87 address stub = find_stub(false /* is_aot */);
88 guarantee(stub != NULL, "stub not found");
89
90 if (TraceICs) {
91 ResourceMark rm;
92 tty->print_cr("CompiledDirectStaticCall@" INTPTR_FORMAT ": set_to_interpreted %s",
93 p2i(instruction_address()),
94 callee->name_and_sig_as_C_string());
95 }
96
97 // Creation also verifies the object.
98 NativeMovConstReg* method_holder = nativeMovConstReg_at(stub);
99 #ifndef PRODUCT
100 NativeGeneralJump* jump = nativeGeneralJump_at(method_holder->next_instruction_address());
|