< prev index next >
src/share/vm/c1/c1_GraphBuilder.cpp
Print this page
rev 10547 : imported patch c1_Instruction
rev 10549 : imported patch c1_Instruction_BBA
rev 10553 : imported patch minor fixes
rev 10555 : imported patch primitive arrays
rev 10556 : imported patch update dates
*** 1,7 ****
/*
! * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,7 ----
/*
! * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 354,364 ****
void BlockListBuilder::mark_loops() {
ResourceMark rm;
_active = BitMap(BlockBegin::number_of_blocks()); _active.clear();
_visited = BitMap(BlockBegin::number_of_blocks()); _visited.clear();
! _loop_map = intArray(BlockBegin::number_of_blocks(), 0);
_next_loop_index = 0;
_next_block_number = _blocks.length();
// recursively iterate the control flow graph
mark_loops(_bci2block->at(0), false);
--- 354,364 ----
void BlockListBuilder::mark_loops() {
ResourceMark rm;
_active = BitMap(BlockBegin::number_of_blocks()); _active.clear();
_visited = BitMap(BlockBegin::number_of_blocks()); _visited.clear();
! _loop_map = intArray(BlockBegin::number_of_blocks(), BlockBegin::number_of_blocks(), 0);
_next_loop_index = 0;
_next_block_number = _blocks.length();
// recursively iterate the control flow graph
mark_loops(_bci2block->at(0), false);
*** 1351,1361 ****
ValueStack* state_before = copy_state_if_bb(is_bb);;
append(new If(ipop(), If::eql, true, key, tsux, fsux, state_before, is_bb));
} else {
// collect successors & keys
BlockList* sux = new BlockList(l + 1, NULL);
! intArray* keys = new intArray(l, 0);
int i;
bool has_bb = false;
for (i = 0; i < l; i++) {
LookupswitchPair pair = sw.pair_at(i);
if (pair.offset() < 0) has_bb = true;
--- 1351,1361 ----
ValueStack* state_before = copy_state_if_bb(is_bb);;
append(new If(ipop(), If::eql, true, key, tsux, fsux, state_before, is_bb));
} else {
// collect successors & keys
BlockList* sux = new BlockList(l + 1, NULL);
! intArray* keys = new intArray(l, l, 0);
int i;
bool has_bb = false;
for (i = 0; i < l; i++) {
LookupswitchPair pair = sw.pair_at(i);
if (pair.offset() < 0) has_bb = true;
*** 1719,1740 ****
void GraphBuilder::check_args_for_profiling(Values* obj_args, int expected) {
#ifdef ASSERT
bool ignored_will_link;
ciSignature* declared_signature = NULL;
ciMethod* real_target = method()->get_method_at_bci(bci(), ignored_will_link, &declared_signature);
! assert(expected == obj_args->length() || real_target->is_method_handle_intrinsic(), "missed on arg?");
#endif
}
// Collect arguments that we want to profile in a list
Values* GraphBuilder::collect_args_for_profiling(Values* args, ciMethod* target, bool may_have_receiver) {
int start = 0;
Values* obj_args = args_list_for_profiling(target, start, may_have_receiver);
if (obj_args == NULL) {
return NULL;
}
! int s = obj_args->size();
// if called through method handle invoke, some arguments may have been popped
for (int i = start, j = 0; j < s && i < args->length(); i++) {
if (args->at(i)->type()->is_object_kind()) {
obj_args->push(args->at(i));
j++;
--- 1719,1740 ----
void GraphBuilder::check_args_for_profiling(Values* obj_args, int expected) {
#ifdef ASSERT
bool ignored_will_link;
ciSignature* declared_signature = NULL;
ciMethod* real_target = method()->get_method_at_bci(bci(), ignored_will_link, &declared_signature);
! assert(expected == obj_args->max_length() || real_target->is_method_handle_intrinsic(), "missed on arg?");
#endif
}
// Collect arguments that we want to profile in a list
Values* GraphBuilder::collect_args_for_profiling(Values* args, ciMethod* target, bool may_have_receiver) {
int start = 0;
Values* obj_args = args_list_for_profiling(target, start, may_have_receiver);
if (obj_args == NULL) {
return NULL;
}
! int s = obj_args->max_length();
// if called through method handle invoke, some arguments may have been popped
for (int i = start, j = 0; j < s && i < args->length(); i++) {
if (args->at(i)->type()->is_object_kind()) {
obj_args->push(args->at(i));
j++;
*** 2167,2177 ****
void GraphBuilder::new_multi_array(int dimensions) {
bool will_link;
ciKlass* klass = stream()->get_klass(will_link);
ValueStack* state_before = !klass->is_loaded() || PatchALot ? copy_state_before() : copy_state_exhandling();
! Values* dims = new Values(dimensions, NULL);
// fill in all dimensions
int i = dimensions;
while (i-- > 0) dims->at_put(i, ipop());
// create array
NewArray* n = new NewMultiArray(klass, dims, state_before);
--- 2167,2177 ----
void GraphBuilder::new_multi_array(int dimensions) {
bool will_link;
ciKlass* klass = stream()->get_klass(will_link);
ValueStack* state_before = !klass->is_loaded() || PatchALot ? copy_state_before() : copy_state_exhandling();
! Values* dims = new Values(dimensions, dimensions, NULL);
// fill in all dimensions
int i = dimensions;
while (i-- > 0) dims->at_put(i, ipop());
// create array
NewArray* n = new NewMultiArray(klass, dims, state_before);
*** 3770,3782 ****
if (profile_calls()) {
int start = 0;
Values* obj_args = args_list_for_profiling(callee, start, has_receiver);
if (obj_args != NULL) {
! int s = obj_args->size();
// if called through method handle invoke, some arguments may have been popped
! for (int i = args_base+start, j = 0; j < obj_args->size() && i < state()->stack_size(); ) {
Value v = state()->stack_at_inc(i);
if (v->type()->is_object_kind()) {
obj_args->push(v);
j++;
}
--- 3770,3782 ----
if (profile_calls()) {
int start = 0;
Values* obj_args = args_list_for_profiling(callee, start, has_receiver);
if (obj_args != NULL) {
! int s = obj_args->max_length();
// if called through method handle invoke, some arguments may have been popped
! for (int i = args_base+start, j = 0; j < obj_args->max_length() && i < state()->stack_size(); ) {
Value v = state()->stack_at_inc(i);
if (v->type()->is_object_kind()) {
obj_args->push(v);
j++;
}
*** 4089,4099 ****
data->set_jsr_return_address_local(-1);
// Must clone bci2block list as we will be mutating it in order to
// properly clone all blocks in jsr region as well as exception
// handlers containing rets
BlockList* new_bci2block = new BlockList(bci2block()->length());
! new_bci2block->push_all(bci2block());
data->set_bci2block(new_bci2block);
data->set_scope(scope());
data->setup_jsr_xhandlers();
data->set_continuation(continuation());
data->set_jsr_continuation(jsr_continuation);
--- 4089,4099 ----
data->set_jsr_return_address_local(-1);
// Must clone bci2block list as we will be mutating it in order to
// properly clone all blocks in jsr region as well as exception
// handlers containing rets
BlockList* new_bci2block = new BlockList(bci2block()->length());
! new_bci2block->appendAll(bci2block());
data->set_bci2block(new_bci2block);
data->set_scope(scope());
data->setup_jsr_xhandlers();
data->set_continuation(continuation());
data->set_jsr_continuation(jsr_continuation);
< prev index next >