Mercurial > hg > graal-compiler
comparison src/share/vm/opto/callnode.cpp @ 12355:cefad50507d8
Merge with hs25-b53
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Fri, 11 Oct 2013 10:38:03 +0200 |
parents | 766fac3395d6 |
children | de6a9e811145 4cdf4f71177d |
comparison
equal
deleted
inserted
replaced
12058:ccb4f2af2319 | 12355:cefad50507d8 |
---|---|
456 } | 456 } |
457 } | 457 } |
458 st->print("={"); | 458 st->print("={"); |
459 uint nf = spobj->n_fields(); | 459 uint nf = spobj->n_fields(); |
460 if (nf > 0) { | 460 if (nf > 0) { |
461 uint first_ind = spobj->first_index(); | 461 uint first_ind = spobj->first_index(mcall->jvms()); |
462 Node* fld_node = mcall->in(first_ind); | 462 Node* fld_node = mcall->in(first_ind); |
463 ciField* cifield; | 463 ciField* cifield; |
464 if (iklass != NULL) { | 464 if (iklass != NULL) { |
465 st->print(" ["); | 465 st->print(" ["); |
466 cifield = iklass->nonstatic_field_at(0); | 466 cifield = iklass->nonstatic_field_at(0); |
1061 assert((int)grow_by > 0, "sanity"); | 1061 assert((int)grow_by > 0, "sanity"); |
1062 int monoff = jvms->monoff(); | 1062 int monoff = jvms->monoff(); |
1063 int scloff = jvms->scloff(); | 1063 int scloff = jvms->scloff(); |
1064 int endoff = jvms->endoff(); | 1064 int endoff = jvms->endoff(); |
1065 assert(endoff == (int)req(), "no other states or debug info after me"); | 1065 assert(endoff == (int)req(), "no other states or debug info after me"); |
1066 assert(jvms->scl_size() == 0, "parsed code should not have scalar objects"); | |
1067 Node* top = Compile::current()->top(); | 1066 Node* top = Compile::current()->top(); |
1068 for (uint i = 0; i < grow_by; i++) { | 1067 for (uint i = 0; i < grow_by; i++) { |
1069 ins_req(monoff, top); | 1068 ins_req(monoff, top); |
1070 } | 1069 } |
1071 jvms->set_monoff(monoff + grow_by); | 1070 jvms->set_monoff(monoff + grow_by); |
1077 // Add a LockNode, which points to both the original BoxLockNode (the | 1076 // Add a LockNode, which points to both the original BoxLockNode (the |
1078 // stack space for the monitor) and the Object being locked. | 1077 // stack space for the monitor) and the Object being locked. |
1079 const int MonitorEdges = 2; | 1078 const int MonitorEdges = 2; |
1080 assert(JVMState::logMonitorEdges == exact_log2(MonitorEdges), "correct MonitorEdges"); | 1079 assert(JVMState::logMonitorEdges == exact_log2(MonitorEdges), "correct MonitorEdges"); |
1081 assert(req() == jvms()->endoff(), "correct sizing"); | 1080 assert(req() == jvms()->endoff(), "correct sizing"); |
1082 assert((jvms()->scl_size() == 0), "parsed code should not have scalar objects"); | |
1083 int nextmon = jvms()->scloff(); | 1081 int nextmon = jvms()->scloff(); |
1084 if (GenerateSynchronizationCode) { | 1082 if (GenerateSynchronizationCode) { |
1085 add_req(lock->box_node()); | 1083 ins_req(nextmon, lock->box_node()); |
1086 add_req(lock->obj_node()); | 1084 ins_req(nextmon+1, lock->obj_node()); |
1087 } else { | 1085 } else { |
1088 Node* top = Compile::current()->top(); | 1086 Node* top = Compile::current()->top(); |
1089 add_req(top); | 1087 ins_req(nextmon, top); |
1090 add_req(top); | 1088 ins_req(nextmon, top); |
1091 } | 1089 } |
1092 jvms()->set_scloff(nextmon+MonitorEdges); | 1090 jvms()->set_scloff(nextmon + MonitorEdges); |
1093 jvms()->set_endoff(req()); | 1091 jvms()->set_endoff(req()); |
1094 } | 1092 } |
1095 | 1093 |
1096 void SafePointNode::pop_monitor() { | 1094 void SafePointNode::pop_monitor() { |
1097 // Delete last monitor from debug info | 1095 // Delete last monitor from debug info |
1098 assert((jvms()->scl_size() == 0), "parsed code should not have scalar objects"); | |
1099 debug_only(int num_before_pop = jvms()->nof_monitors()); | 1096 debug_only(int num_before_pop = jvms()->nof_monitors()); |
1100 const int MonitorEdges = (1<<JVMState::logMonitorEdges); | 1097 const int MonitorEdges = 2; |
1098 assert(JVMState::logMonitorEdges == exact_log2(MonitorEdges), "correct MonitorEdges"); | |
1101 int scloff = jvms()->scloff(); | 1099 int scloff = jvms()->scloff(); |
1102 int endoff = jvms()->endoff(); | 1100 int endoff = jvms()->endoff(); |
1103 int new_scloff = scloff - MonitorEdges; | 1101 int new_scloff = scloff - MonitorEdges; |
1104 int new_endoff = endoff - MonitorEdges; | 1102 int new_endoff = endoff - MonitorEdges; |
1105 jvms()->set_scloff(new_scloff); | 1103 jvms()->set_scloff(new_scloff); |
1106 jvms()->set_endoff(new_endoff); | 1104 jvms()->set_endoff(new_endoff); |
1107 while (scloff > new_scloff) del_req(--scloff); | 1105 while (scloff > new_scloff) del_req_ordered(--scloff); |
1108 assert(jvms()->nof_monitors() == num_before_pop-1, ""); | 1106 assert(jvms()->nof_monitors() == num_before_pop-1, ""); |
1109 } | 1107 } |
1110 | 1108 |
1111 Node *SafePointNode::peek_monitor_box() const { | 1109 Node *SafePointNode::peek_monitor_box() const { |
1112 int mon = jvms()->nof_monitors() - 1; | 1110 int mon = jvms()->nof_monitors() - 1; |
1167 uint SafePointScalarObjectNode::match_edge(uint idx) const { | 1165 uint SafePointScalarObjectNode::match_edge(uint idx) const { |
1168 return 0; | 1166 return 0; |
1169 } | 1167 } |
1170 | 1168 |
1171 SafePointScalarObjectNode* | 1169 SafePointScalarObjectNode* |
1172 SafePointScalarObjectNode::clone(int jvms_adj, Dict* sosn_map) const { | 1170 SafePointScalarObjectNode::clone(Dict* sosn_map) const { |
1173 void* cached = (*sosn_map)[(void*)this]; | 1171 void* cached = (*sosn_map)[(void*)this]; |
1174 if (cached != NULL) { | 1172 if (cached != NULL) { |
1175 return (SafePointScalarObjectNode*)cached; | 1173 return (SafePointScalarObjectNode*)cached; |
1176 } | 1174 } |
1177 SafePointScalarObjectNode* res = (SafePointScalarObjectNode*)Node::clone(); | 1175 SafePointScalarObjectNode* res = (SafePointScalarObjectNode*)Node::clone(); |
1178 res->_first_index += jvms_adj; | |
1179 sosn_map->Insert((void*)this, (void*)res); | 1176 sosn_map->Insert((void*)this, (void*)res); |
1180 return res; | 1177 return res; |
1181 } | 1178 } |
1182 | 1179 |
1183 | 1180 |