comparison src/cpu/x86/vm/methodHandles_x86.cpp @ 12355:cefad50507d8

Merge with hs25-b53
author Gilles Duboscq <duboscq@ssw.jku.at>
date Fri, 11 Oct 2013 10:38:03 +0200
parents 268e7a2178d7
children 78bbf4d43a14
comparison
equal deleted inserted replaced
12058:ccb4f2af2319 12355:cefad50507d8
1 /* 1 /*
2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2013, 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. 7 * published by the Free Software Foundation.
112 #endif //ASSERT 112 #endif //ASSERT
113 113
114 void MethodHandles::jump_from_method_handle(MacroAssembler* _masm, Register method, Register temp, 114 void MethodHandles::jump_from_method_handle(MacroAssembler* _masm, Register method, Register temp,
115 bool for_compiler_entry) { 115 bool for_compiler_entry) {
116 assert(method == rbx, "interpreter calling convention"); 116 assert(method == rbx, "interpreter calling convention");
117
118 Label L_no_such_method;
119 __ testptr(rbx, rbx);
120 __ jcc(Assembler::zero, L_no_such_method);
121
117 __ verify_method_ptr(method); 122 __ verify_method_ptr(method);
118 123
119 if (!for_compiler_entry && JvmtiExport::can_post_interpreter_events()) { 124 if (!for_compiler_entry && JvmtiExport::can_post_interpreter_events()) {
120 Label run_compiled_code; 125 Label run_compiled_code;
121 // JVMTI events, such as single-stepping, are implemented partly by avoiding running 126 // JVMTI events, such as single-stepping, are implemented partly by avoiding running
136 } 141 }
137 142
138 const ByteSize entry_offset = for_compiler_entry ? Method::from_compiled_offset() : 143 const ByteSize entry_offset = for_compiler_entry ? Method::from_compiled_offset() :
139 Method::from_interpreted_offset(); 144 Method::from_interpreted_offset();
140 __ jmp(Address(method, entry_offset)); 145 __ jmp(Address(method, entry_offset));
146
147 __ bind(L_no_such_method);
148 __ jump(RuntimeAddress(StubRoutines::throw_AbstractMethodError_entry()));
141 } 149 }
142 150
143 void MethodHandles::jump_to_lambda_form(MacroAssembler* _masm, 151 void MethodHandles::jump_to_lambda_form(MacroAssembler* _masm,
144 Register recv, Register method_temp, 152 Register recv, Register method_temp,
145 Register temp2, 153 Register temp2,
473 bool has_mh = (strstr(adaptername, "/static") == NULL && 481 bool has_mh = (strstr(adaptername, "/static") == NULL &&
474 strstr(adaptername, "linkTo") == NULL); // static linkers don't have MH 482 strstr(adaptername, "linkTo") == NULL); // static linkers don't have MH
475 const char* mh_reg_name = has_mh ? "rcx_mh" : "rcx"; 483 const char* mh_reg_name = has_mh ? "rcx_mh" : "rcx";
476 tty->print_cr("MH %s %s="PTR_FORMAT" sp="PTR_FORMAT, 484 tty->print_cr("MH %s %s="PTR_FORMAT" sp="PTR_FORMAT,
477 adaptername, mh_reg_name, 485 adaptername, mh_reg_name,
478 mh, entry_sp); 486 (void *)mh, entry_sp);
479 487
480 if (Verbose) { 488 if (Verbose) {
481 tty->print_cr("Registers:"); 489 tty->print_cr("Registers:");
482 const int saved_regs_count = RegisterImpl::number_of_registers; 490 const int saved_regs_count = RegisterImpl::number_of_registers;
483 for (int i = 0; i < saved_regs_count; i++) { 491 for (int i = 0; i < saved_regs_count; i++) {