comparison src/cpu/sparc/vm/templateInterpreter_sparc.cpp @ 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 d1605aabd0a1
children be93aad57795 6b2273dd6fa9
comparison
equal deleted inserted replaced
709:1d037ecd7960 710:e5b0439ef4ae
1 /* 1 /*
2 * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. 2 * Copyright 1997-2009 Sun Microsystems, Inc. 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.
101 // load exception object 101 // load exception object
102 __ call_VM(Oexception, 102 __ call_VM(Oexception,
103 CAST_FROM_FN_PTR(address, 103 CAST_FROM_FN_PTR(address,
104 InterpreterRuntime::throw_ClassCastException), 104 InterpreterRuntime::throw_ClassCastException),
105 Otos_i); 105 Otos_i);
106 __ should_not_reach_here();
107 return entry;
108 }
109
110
111 // Arguments are: required type in G5_method_type, and
112 // failing object (or NULL) in G3_method_handle.
113 address TemplateInterpreterGenerator::generate_WrongMethodType_handler() {
114 address entry = __ pc();
115 // expression stack must be empty before entering the VM if an exception
116 // happened
117 __ empty_expression_stack();
118 // load exception object
119 __ call_VM(Oexception,
120 CAST_FROM_FN_PTR(address,
121 InterpreterRuntime::throw_WrongMethodTypeException),
122 G5_method_type, // required
123 G3_method_handle); // actual
106 __ should_not_reach_here(); 124 __ should_not_reach_here();
107 return entry; 125 return entry;
108 } 126 }
109 127
110 128
446 const Address max_stack (G5_method, 0, in_bytes(methodOopDesc::max_stack_offset())); 464 const Address max_stack (G5_method, 0, in_bytes(methodOopDesc::max_stack_offset()));
447 int rounded_vm_local_words = round_to( frame::interpreter_frame_vm_local_words, WordsPerLong ); 465 int rounded_vm_local_words = round_to( frame::interpreter_frame_vm_local_words, WordsPerLong );
448 466
449 const int extra_space = 467 const int extra_space =
450 rounded_vm_local_words + // frame local scratch space 468 rounded_vm_local_words + // frame local scratch space
469 //6815692//methodOopDesc::extra_stack_words() + // extra push slots for MH adapters
451 frame::memory_parameter_word_sp_offset + // register save area 470 frame::memory_parameter_word_sp_offset + // register save area
452 (native_call ? frame::interpreter_frame_extra_outgoing_argument_words : 0); 471 (native_call ? frame::interpreter_frame_extra_outgoing_argument_words : 0);
453 472
454 const Register Glocals_size = G3; 473 const Register Glocals_size = G3;
455 const Register Otmp1 = O3; 474 const Register Otmp1 = O3;
1445 // callee_locals and max_stack are counts, not the size in frame. 1464 // callee_locals and max_stack are counts, not the size in frame.
1446 const int locals_size = 1465 const int locals_size =
1447 round_to(callee_extra_locals * Interpreter::stackElementWords(), WordsPerLong); 1466 round_to(callee_extra_locals * Interpreter::stackElementWords(), WordsPerLong);
1448 const int max_stack_words = max_stack * Interpreter::stackElementWords(); 1467 const int max_stack_words = max_stack * Interpreter::stackElementWords();
1449 return (round_to((max_stack_words 1468 return (round_to((max_stack_words
1469 //6815692//+ methodOopDesc::extra_stack_words()
1450 + rounded_vm_local_words 1470 + rounded_vm_local_words
1451 + frame::memory_parameter_word_sp_offset), WordsPerLong) 1471 + frame::memory_parameter_word_sp_offset), WordsPerLong)
1452 // already rounded 1472 // already rounded
1453 + locals_size + monitor_size); 1473 + locals_size + monitor_size);
1454 } 1474 }