Mercurial > hg > truffle
comparison src/cpu/sparc/vm/cppInterpreter_sparc.cpp @ 10408:836a62f43af9
Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 19 Jun 2013 10:45:56 +0200 |
parents | 603ca7e51354 |
children | bd3237e0e18d |
comparison
equal
deleted
inserted
replaced
10086:e0fb8a213650 | 10408:836a62f43af9 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2007, 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. |
402 // | 402 // |
403 // Lmethod: method | 403 // Lmethod: method |
404 // ??: invocation counter | 404 // ??: invocation counter |
405 // | 405 // |
406 void InterpreterGenerator::generate_counter_incr(Label* overflow, Label* profile_method, Label* profile_method_continue) { | 406 void InterpreterGenerator::generate_counter_incr(Label* overflow, Label* profile_method, Label* profile_method_continue) { |
407 Label done; | |
408 const Register Rcounters = G3_scratch; | |
409 | |
410 __ ld_ptr(STATE(_method), G5_method); | |
411 __ get_method_counters(G5_method, Rcounters, done); | |
412 | |
407 // Update standard invocation counters | 413 // Update standard invocation counters |
408 __ increment_invocation_counter(O0, G3_scratch); | 414 __ increment_invocation_counter(Rcounters, O0, G4_scratch); |
409 if (ProfileInterpreter) { // %%% Merge this into MethodData* | 415 if (ProfileInterpreter) { |
410 __ ld_ptr(STATE(_method), G3_scratch); | 416 Address interpreter_invocation_counter(Rcounters, 0, |
411 Address interpreter_invocation_counter(G3_scratch, 0, in_bytes(Method::interpreter_invocation_counter_offset())); | 417 in_bytes(MethodCounters::interpreter_invocation_counter_offset())); |
412 __ ld(interpreter_invocation_counter, G3_scratch); | 418 __ ld(interpreter_invocation_counter, G4_scratch); |
413 __ inc(G3_scratch); | 419 __ inc(G4_scratch); |
414 __ st(G3_scratch, interpreter_invocation_counter); | 420 __ st(G4_scratch, interpreter_invocation_counter); |
415 } | 421 } |
416 | 422 |
417 Address invocation_limit(G3_scratch, (address)&InvocationCounter::InterpreterInvocationLimit); | 423 Address invocation_limit(G3_scratch, (address)&InvocationCounter::InterpreterInvocationLimit); |
418 __ sethi(invocation_limit); | 424 __ sethi(invocation_limit); |
419 __ ld(invocation_limit, G3_scratch); | 425 __ ld(invocation_limit, G3_scratch); |
420 __ cmp(O0, G3_scratch); | 426 __ cmp(O0, G3_scratch); |
421 __ br(Assembler::greaterEqualUnsigned, false, Assembler::pn, *overflow); | 427 __ br(Assembler::greaterEqualUnsigned, false, Assembler::pn, *overflow); |
422 __ delayed()->nop(); | 428 __ delayed()->nop(); |
423 | 429 __ bind(done); |
424 } | 430 } |
425 | 431 |
426 address InterpreterGenerator::generate_empty_entry(void) { | 432 address InterpreterGenerator::generate_empty_entry(void) { |
427 | 433 |
428 // A method that does nothing but return... | 434 // A method that does nothing but return... |
1057 // that returns a result. | 1063 // that returns a result. |
1058 | 1064 |
1059 const int slop_factor = 2*wordSize; | 1065 const int slop_factor = 2*wordSize; |
1060 | 1066 |
1061 const int fixed_size = ((sizeof(BytecodeInterpreter) + slop_factor) >> LogBytesPerWord) + // what is the slop factor? | 1067 const int fixed_size = ((sizeof(BytecodeInterpreter) + slop_factor) >> LogBytesPerWord) + // what is the slop factor? |
1062 //6815692//Method::extra_stack_words() + // extra push slots for MH adapters | 1068 Method::extra_stack_entries() + // extra stack for jsr 292 |
1063 frame::memory_parameter_word_sp_offset + // register save area + param window | 1069 frame::memory_parameter_word_sp_offset + // register save area + param window |
1064 (native ? frame::interpreter_frame_extra_outgoing_argument_words : 0); // JNI, class | 1070 (native ? frame::interpreter_frame_extra_outgoing_argument_words : 0); // JNI, class |
1065 | 1071 |
1066 // XXX G5_method valid | 1072 // XXX G5_method valid |
1067 | 1073 |
1213 __ st_ptr(O2, XXX_STATE(_stack)); // PREPUSH | 1219 __ st_ptr(O2, XXX_STATE(_stack)); // PREPUSH |
1214 | 1220 |
1215 // Full size expression stack | 1221 // Full size expression stack |
1216 __ ld_ptr(constMethod, O3); | 1222 __ ld_ptr(constMethod, O3); |
1217 __ lduh(O3, in_bytes(ConstMethod::max_stack_offset()), O3); | 1223 __ lduh(O3, in_bytes(ConstMethod::max_stack_offset()), O3); |
1218 guarantee(!EnableInvokeDynamic, "no support yet for java.lang.invoke.MethodHandle"); //6815692 | 1224 __ inc(O3, Method::extra_stack_entries()); |
1219 //6815692//if (EnableInvokeDynamic) | |
1220 //6815692// __ inc(O3, Method::extra_stack_entries()); | |
1221 __ sll(O3, LogBytesPerWord, O3); | 1225 __ sll(O3, LogBytesPerWord, O3); |
1222 __ sub(O2, O3, O3); | 1226 __ sub(O2, O3, O3); |
1223 // __ sub(O3, wordSize, O3); // so prepush doesn't look out of bounds | 1227 // __ sub(O3, wordSize, O3); // so prepush doesn't look out of bounds |
1224 __ st_ptr(O3, XXX_STATE(_stack_limit)); | 1228 __ st_ptr(O3, XXX_STATE(_stack_limit)); |
1225 | 1229 |
2076 // is "slop_factor" here. | 2080 // is "slop_factor" here. |
2077 const int slop_factor = 2; | 2081 const int slop_factor = 2; |
2078 | 2082 |
2079 const int fixed_size = sizeof(BytecodeInterpreter)/wordSize + // interpreter state object | 2083 const int fixed_size = sizeof(BytecodeInterpreter)/wordSize + // interpreter state object |
2080 frame::memory_parameter_word_sp_offset; // register save area + param window | 2084 frame::memory_parameter_word_sp_offset; // register save area + param window |
2081 const int extra_stack = 0; //6815692//Method::extra_stack_entries(); | |
2082 return (round_to(max_stack + | 2085 return (round_to(max_stack + |
2083 extra_stack + | |
2084 slop_factor + | 2086 slop_factor + |
2085 fixed_size + | 2087 fixed_size + |
2086 monitor_size + | 2088 monitor_size + |
2087 (callee_extra_locals * Interpreter::stackElementWords), WordsPerLong)); | 2089 (callee_extra_locals * Interpreter::stackElementWords), WordsPerLong)); |
2088 | 2090 |
2165 to_fill->_oop_temp = NULL; | 2167 to_fill->_oop_temp = NULL; |
2166 to_fill->_stack_base = stack_base; | 2168 to_fill->_stack_base = stack_base; |
2167 // Need +1 here because stack_base points to the word just above the first expr stack entry | 2169 // Need +1 here because stack_base points to the word just above the first expr stack entry |
2168 // and stack_limit is supposed to point to the word just below the last expr stack entry. | 2170 // and stack_limit is supposed to point to the word just below the last expr stack entry. |
2169 // See generate_compute_interpreter_state. | 2171 // See generate_compute_interpreter_state. |
2170 int extra_stack = 0; //6815692//Method::extra_stack_entries(); | 2172 to_fill->_stack_limit = stack_base - (method->max_stack() + 1); |
2171 to_fill->_stack_limit = stack_base - (method->max_stack() + 1 + extra_stack); | |
2172 to_fill->_monitor_base = (BasicObjectLock*) monitor_base; | 2173 to_fill->_monitor_base = (BasicObjectLock*) monitor_base; |
2173 | 2174 |
2174 // sparc specific | 2175 // sparc specific |
2175 to_fill->_frame_bottom = frame_bottom; | 2176 to_fill->_frame_bottom = frame_bottom; |
2176 to_fill->_self_link = to_fill; | 2177 to_fill->_self_link = to_fill; |