1 /*
2 * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
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,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
340 return;
341 }
342
343 Compile* C = Compile::current();
344 // Remove inlined methods from Compiler's lists.
345 if (call->is_macro()) {
346 C->remove_macro_node(call);
347 }
348
349 // Make a clone of the JVMState that appropriate to use for driving a parse
350 JVMState* old_jvms = call->jvms();
351 JVMState* jvms = old_jvms->clone_shallow(C);
352 uint size = call->req();
353 SafePointNode* map = new SafePointNode(size, jvms);
354 for (uint i1 = 0; i1 < size; i1++) {
355 map->init_req(i1, call->in(i1));
356 }
357
358 // Make sure the state is a MergeMem for parsing.
359 if (!map->in(TypeFunc::Memory)->is_MergeMem()) {
360 Node* mem = MergeMemNode::make(C, map->in(TypeFunc::Memory));
361 C->initial_gvn()->set_type_bottom(mem);
362 map->set_req(TypeFunc::Memory, mem);
363 }
364
365 uint nargs = method()->arg_size();
366 // blow away old call arguments
367 Node* top = C->top();
368 for (uint i1 = 0; i1 < nargs; i1++) {
369 map->set_req(TypeFunc::Parms + i1, top);
370 }
371 jvms->set_map(map);
372
373 // Make enough space in the expression stack to transfer
374 // the incoming arguments and return value.
375 map->ensure_stack(jvms, jvms->method()->max_stack());
376 for (uint i1 = 0; i1 < nargs; i1++) {
377 map->set_argument(jvms, i1, call->in(TypeFunc::Parms + i1));
378 }
379
380 C->print_inlining_assert_ready();
|
1 /*
2 * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
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,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
340 return;
341 }
342
343 Compile* C = Compile::current();
344 // Remove inlined methods from Compiler's lists.
345 if (call->is_macro()) {
346 C->remove_macro_node(call);
347 }
348
349 // Make a clone of the JVMState that appropriate to use for driving a parse
350 JVMState* old_jvms = call->jvms();
351 JVMState* jvms = old_jvms->clone_shallow(C);
352 uint size = call->req();
353 SafePointNode* map = new SafePointNode(size, jvms);
354 for (uint i1 = 0; i1 < size; i1++) {
355 map->init_req(i1, call->in(i1));
356 }
357
358 // Make sure the state is a MergeMem for parsing.
359 if (!map->in(TypeFunc::Memory)->is_MergeMem()) {
360 Node* mem = MergeMemNode::make(map->in(TypeFunc::Memory));
361 C->initial_gvn()->set_type_bottom(mem);
362 map->set_req(TypeFunc::Memory, mem);
363 }
364
365 uint nargs = method()->arg_size();
366 // blow away old call arguments
367 Node* top = C->top();
368 for (uint i1 = 0; i1 < nargs; i1++) {
369 map->set_req(TypeFunc::Parms + i1, top);
370 }
371 jvms->set_map(map);
372
373 // Make enough space in the expression stack to transfer
374 // the incoming arguments and return value.
375 map->ensure_stack(jvms, jvms->method()->max_stack());
376 for (uint i1 = 0; i1 < nargs; i1++) {
377 map->set_argument(jvms, i1, call->in(TypeFunc::Parms + i1));
378 }
379
380 C->print_inlining_assert_ready();
|