< prev index next >

src/hotspot/share/c1/c1_GraphBuilder.cpp

Print this page


   1 /*
   2  * Copyright (c) 1999, 2017, 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  *


2127   append_split(result);
2128 
2129   if (result_type != voidType) {
2130     if (method()->is_strict()) {
2131       push(result_type, round_fp(result));
2132     } else {
2133       push(result_type, result);
2134     }
2135   }
2136   if (profile_return() && result_type->is_object_kind()) {
2137     profile_return_type(result, target);
2138   }
2139 }
2140 
2141 
2142 void GraphBuilder::new_instance(int klass_index) {
2143   ValueStack* state_before = copy_state_exhandling();
2144   bool will_link;
2145   ciKlass* klass = stream()->get_klass(will_link);
2146   assert(klass->is_instance_klass(), "must be an instance klass");
2147   NewInstance* new_instance = new NewInstance(klass->as_instance_klass(), state_before,
2148                                               stream()->is_unresolved_klass() || stream()->is_unresolved_value_type());
2149   _memory->new_instance(new_instance);
2150   apush(append_split(new_instance));
2151 }
2152 
2153 
2154 void GraphBuilder::new_type_array() {
2155   ValueStack* state_before = copy_state_exhandling();
2156   apush(append_split(new NewTypeArray(ipop(), (BasicType)stream()->get_index(), state_before)));
2157 }
2158 
2159 
2160 void GraphBuilder::new_object_array() {
2161   bool will_link;
2162   ciKlass* klass = stream()->get_klass(will_link);
2163   ValueStack* state_before = !klass->is_loaded() || PatchALot ? copy_state_before() : copy_state_exhandling();
2164   NewArray* n = new NewObjectArray(klass, ipop(), state_before);
2165   apush(append_split(n));
2166 }
2167 
2168 


   1 /*
   2  * Copyright (c) 1999, 2018, 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  *


2127   append_split(result);
2128 
2129   if (result_type != voidType) {
2130     if (method()->is_strict()) {
2131       push(result_type, round_fp(result));
2132     } else {
2133       push(result_type, result);
2134     }
2135   }
2136   if (profile_return() && result_type->is_object_kind()) {
2137     profile_return_type(result, target);
2138   }
2139 }
2140 
2141 
2142 void GraphBuilder::new_instance(int klass_index) {
2143   ValueStack* state_before = copy_state_exhandling();
2144   bool will_link;
2145   ciKlass* klass = stream()->get_klass(will_link);
2146   assert(klass->is_instance_klass(), "must be an instance klass");
2147   NewInstance* new_instance = new NewInstance(klass->as_instance_klass(), state_before, stream()->is_unresolved_klass());

2148   _memory->new_instance(new_instance);
2149   apush(append_split(new_instance));
2150 }
2151 
2152 
2153 void GraphBuilder::new_type_array() {
2154   ValueStack* state_before = copy_state_exhandling();
2155   apush(append_split(new NewTypeArray(ipop(), (BasicType)stream()->get_index(), state_before)));
2156 }
2157 
2158 
2159 void GraphBuilder::new_object_array() {
2160   bool will_link;
2161   ciKlass* klass = stream()->get_klass(will_link);
2162   ValueStack* state_before = !klass->is_loaded() || PatchALot ? copy_state_before() : copy_state_exhandling();
2163   NewArray* n = new NewObjectArray(klass, ipop(), state_before);
2164   apush(append_split(n));
2165 }
2166 
2167 


< prev index next >