comparison src/cpu/sparc/vm/cppInterpreter_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 c18cbe5936b8
comparison
equal deleted inserted replaced
709:1d037ecd7960 710:e5b0439ef4ae
1 /* 1 /*
2 * Copyright 2007-2008 Sun Microsystems, Inc. All Rights Reserved. 2 * Copyright 2007-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.
1015 // that returns a result. 1015 // that returns a result.
1016 1016
1017 const int slop_factor = 2*wordSize; 1017 const int slop_factor = 2*wordSize;
1018 1018
1019 const int fixed_size = ((sizeof(BytecodeInterpreter) + slop_factor) >> LogBytesPerWord) + // what is the slop factor? 1019 const int fixed_size = ((sizeof(BytecodeInterpreter) + slop_factor) >> LogBytesPerWord) + // what is the slop factor?
1020 //6815692//methodOopDesc::extra_stack_words() + // extra push slots for MH adapters
1020 frame::memory_parameter_word_sp_offset + // register save area + param window 1021 frame::memory_parameter_word_sp_offset + // register save area + param window
1021 (native ? frame::interpreter_frame_extra_outgoing_argument_words : 0); // JNI, class 1022 (native ? frame::interpreter_frame_extra_outgoing_argument_words : 0); // JNI, class
1022 1023
1023 // XXX G5_method valid 1024 // XXX G5_method valid
1024 1025
1161 1162
1162 __ sub(O2, wordSize, O2); // prepush 1163 __ sub(O2, wordSize, O2); // prepush
1163 __ st_ptr(O2, XXX_STATE(_stack)); // PREPUSH 1164 __ st_ptr(O2, XXX_STATE(_stack)); // PREPUSH
1164 1165
1165 __ lduh(max_stack, O3); // Full size expression stack 1166 __ lduh(max_stack, O3); // Full size expression stack
1167 guarantee(!EnableMethodHandles, "no support yet for java.dyn.MethodHandle"); //6815692
1168 //6815692//if (EnableMethodHandles)
1169 //6815692// __ inc(O3, methodOopDesc::extra_stack_entries());
1166 __ sll(O3, LogBytesPerWord, O3); 1170 __ sll(O3, LogBytesPerWord, O3);
1167 __ sub(O2, O3, O3); 1171 __ sub(O2, O3, O3);
1168 // __ sub(O3, wordSize, O3); // so prepush doesn't look out of bounds 1172 // __ sub(O3, wordSize, O3); // so prepush doesn't look out of bounds
1169 __ st_ptr(O3, XXX_STATE(_stack_limit)); 1173 __ st_ptr(O3, XXX_STATE(_stack_limit));
1170 1174
2015 // is "slop_factor" here. 2019 // is "slop_factor" here.
2016 const int slop_factor = 2; 2020 const int slop_factor = 2;
2017 2021
2018 const int fixed_size = sizeof(BytecodeInterpreter)/wordSize + // interpreter state object 2022 const int fixed_size = sizeof(BytecodeInterpreter)/wordSize + // interpreter state object
2019 frame::memory_parameter_word_sp_offset; // register save area + param window 2023 frame::memory_parameter_word_sp_offset; // register save area + param window
2024 const int extra_stack = 0; //6815692//methodOopDesc::extra_stack_entries();
2020 return (round_to(max_stack + 2025 return (round_to(max_stack +
2026 extra_stack +
2021 slop_factor + 2027 slop_factor +
2022 fixed_size + 2028 fixed_size +
2023 monitor_size + 2029 monitor_size +
2024 (callee_extra_locals * Interpreter::stackElementWords()), WordsPerLong)); 2030 (callee_extra_locals * Interpreter::stackElementWords()), WordsPerLong));
2025 2031
2102 to_fill->_oop_temp = NULL; 2108 to_fill->_oop_temp = NULL;
2103 to_fill->_stack_base = stack_base; 2109 to_fill->_stack_base = stack_base;
2104 // Need +1 here because stack_base points to the word just above the first expr stack entry 2110 // Need +1 here because stack_base points to the word just above the first expr stack entry
2105 // and stack_limit is supposed to point to the word just below the last expr stack entry. 2111 // and stack_limit is supposed to point to the word just below the last expr stack entry.
2106 // See generate_compute_interpreter_state. 2112 // See generate_compute_interpreter_state.
2107 to_fill->_stack_limit = stack_base - (method->max_stack() + 1); 2113 int extra_stack = 0; //6815692//methodOopDesc::extra_stack_entries();
2114 to_fill->_stack_limit = stack_base - (method->max_stack() + 1 + extra_stack);
2108 to_fill->_monitor_base = (BasicObjectLock*) monitor_base; 2115 to_fill->_monitor_base = (BasicObjectLock*) monitor_base;
2109 2116
2110 // sparc specific 2117 // sparc specific
2111 to_fill->_frame_bottom = frame_bottom; 2118 to_fill->_frame_bottom = frame_bottom;
2112 to_fill->_self_link = to_fill; 2119 to_fill->_self_link = to_fill;