1 /* |
1 /* |
2 * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1998, 2016, 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. |
55 } |
55 } |
56 |
56 |
57 |
57 |
58 //--------------------------------array_store---------------------------------- |
58 //--------------------------------array_store---------------------------------- |
59 void Parse::array_store(BasicType elem_type) { |
59 void Parse::array_store(BasicType elem_type) { |
60 Node* adr = array_addressing(elem_type, 1); |
60 const Type* elem = Type::TOP; |
|
61 Node* adr = array_addressing(elem_type, 1, &elem); |
61 if (stopped()) return; // guaranteed null or range check |
62 if (stopped()) return; // guaranteed null or range check |
62 Node* val = pop(); |
63 Node* val = pop(); |
63 dec_sp(2); // Pop array and index |
64 dec_sp(2); // Pop array and index |
64 const TypeAryPtr* adr_type = TypeAryPtr::get_array_body_type(elem_type); |
65 const TypeAryPtr* adr_type = TypeAryPtr::get_array_body_type(elem_type); |
|
66 if (elem == TypeInt::BOOL) { |
|
67 elem_type = T_BOOLEAN; |
|
68 } |
65 store_to_memory(control(), adr, val, elem_type, adr_type, StoreNode::release_if_reference(elem_type)); |
69 store_to_memory(control(), adr, val, elem_type, adr_type, StoreNode::release_if_reference(elem_type)); |
66 } |
70 } |
67 |
71 |
68 |
72 |
69 //------------------------------array_addressing------------------------------- |
73 //------------------------------array_addressing------------------------------- |