Mercurial > hg > truffle
comparison src/share/vm/runtime/javaCalls.hpp @ 1930:2d26b0046e0d
Merge.
author | Thomas Wuerthinger <wuerthinger@ssw.jku.at> |
---|---|
date | Tue, 30 Nov 2010 14:53:30 +0100 |
parents | 6223633ce7dd c18cbe5936b8 |
children | 06f017f7daa7 |
comparison
equal
deleted
inserted
replaced
1484:6b7001391c97 | 1930:2d26b0046e0d |
---|---|
1 /* | 1 /* |
2 * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. | 2 * Copyright (c) 1997, 2008, 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. |
14 * | 14 * |
15 * You should have received a copy of the GNU General Public License version | 15 * You should have received a copy of the GNU General Public License version |
16 * 2 along with this work; if not, write to the Free Software Foundation, | 16 * 2 along with this work; if not, write to the Free Software Foundation, |
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
18 * | 18 * |
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, | 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
20 * CA 95054 USA or visit www.sun.com if you need additional information or | 20 * or visit www.oracle.com if you need additional information or have any |
21 * have any questions. | 21 * questions. |
22 * | 22 * |
23 */ | 23 */ |
24 | 24 |
25 // A JavaCallWrapper is constructed before each JavaCall and destructed after the call. | 25 // A JavaCallWrapper is constructed before each JavaCall and destructed after the call. |
26 // Its purpose is to allocate/deallocate a new handle block and to save/restore the last | 26 // Its purpose is to allocate/deallocate a new handle block and to save/restore the last |
64 enum Constants { | 64 enum Constants { |
65 _default_size = 8 // Must be at least # of arguments in JavaCalls methods | 65 _default_size = 8 // Must be at least # of arguments in JavaCalls methods |
66 }; | 66 }; |
67 | 67 |
68 intptr_t _value_buffer [_default_size + 1]; | 68 intptr_t _value_buffer [_default_size + 1]; |
69 intptr_t _parameter_buffer [_default_size*2 + 1]; | |
70 bool _is_oop_buffer[_default_size + 1]; | 69 bool _is_oop_buffer[_default_size + 1]; |
71 | 70 |
72 intptr_t* _value; | 71 intptr_t* _value; |
73 intptr_t* _parameters; | |
74 bool* _is_oop; | 72 bool* _is_oop; |
75 int _size; | 73 int _size; |
76 int _max_size; | 74 int _max_size; |
77 bool _start_at_zero; // Support late setting of receiver | 75 bool _start_at_zero; // Support late setting of receiver |
78 | 76 |
79 void initialize() { | 77 void initialize() { |
80 // Starts at first element to support set_receiver. | 78 // Starts at first element to support set_receiver. |
81 _value = &_value_buffer[1]; | 79 _value = &_value_buffer[1]; |
82 _is_oop = &_is_oop_buffer[1]; | 80 _is_oop = &_is_oop_buffer[1]; |
83 | 81 |
84 _parameters = &_parameter_buffer[0]; | |
85 _max_size = _default_size; | 82 _max_size = _default_size; |
86 _size = 0; | 83 _size = 0; |
87 _start_at_zero = false; | 84 _start_at_zero = false; |
88 } | 85 } |
89 | 86 |
97 | 94 |
98 JavaCallArguments(int max_size) { | 95 JavaCallArguments(int max_size) { |
99 if (max_size > _default_size) { | 96 if (max_size > _default_size) { |
100 _value = NEW_RESOURCE_ARRAY(intptr_t, max_size + 1); | 97 _value = NEW_RESOURCE_ARRAY(intptr_t, max_size + 1); |
101 _is_oop = NEW_RESOURCE_ARRAY(bool, max_size + 1); | 98 _is_oop = NEW_RESOURCE_ARRAY(bool, max_size + 1); |
102 if (TaggedStackInterpreter) { | 99 |
103 _parameters = NEW_RESOURCE_ARRAY(intptr_t, max_size*2 + 1); | |
104 } | |
105 // Reserve room for potential receiver in value and is_oop | 100 // Reserve room for potential receiver in value and is_oop |
106 _value++; _is_oop++; | 101 _value++; _is_oop++; |
102 | |
107 _max_size = max_size; | 103 _max_size = max_size; |
108 _size = 0; | 104 _size = 0; |
109 _start_at_zero = false; | 105 _start_at_zero = false; |
110 } else { | 106 } else { |
111 initialize(); | 107 initialize(); |