1 /* |
1 /* |
2 * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2001, 2014, 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. |
589 // Cheat with a preallocated exception object. |
589 // Cheat with a preallocated exception object. |
590 if (C->log() != NULL) |
590 if (C->log() != NULL) |
591 C->log()->elem("hot_throw preallocated='1' reason='%s'", |
591 C->log()->elem("hot_throw preallocated='1' reason='%s'", |
592 Deoptimization::trap_reason_name(reason)); |
592 Deoptimization::trap_reason_name(reason)); |
593 const TypeInstPtr* ex_con = TypeInstPtr::make(ex_obj); |
593 const TypeInstPtr* ex_con = TypeInstPtr::make(ex_obj); |
594 Node* ex_node = _gvn.transform( ConNode::make(C, ex_con) ); |
594 Node* ex_node = _gvn.transform(ConNode::make(ex_con)); |
595 |
595 |
596 // Clear the detail message of the preallocated exception object. |
596 // Clear the detail message of the preallocated exception object. |
597 // Weblogic sometimes mutates the detail message of exceptions |
597 // Weblogic sometimes mutates the detail message of exceptions |
598 // using reflection. |
598 // using reflection. |
599 int offset = java_lang_Throwable::get_detailMessage_offset(); |
599 int offset = java_lang_Throwable::get_detailMessage_offset(); |
704 |
704 |
705 SafePointNode* GraphKit::clone_map() { |
705 SafePointNode* GraphKit::clone_map() { |
706 if (map() == NULL) return NULL; |
706 if (map() == NULL) return NULL; |
707 |
707 |
708 // Clone the memory edge first |
708 // Clone the memory edge first |
709 Node* mem = MergeMemNode::make(C, map()->memory()); |
709 Node* mem = MergeMemNode::make(map()->memory()); |
710 gvn().set_type_bottom(mem); |
710 gvn().set_type_bottom(mem); |
711 |
711 |
712 SafePointNode *clonemap = (SafePointNode*)map()->clone(); |
712 SafePointNode *clonemap = (SafePointNode*)map()->clone(); |
713 JVMState* jvms = this->jvms(); |
713 JVMState* jvms = this->jvms(); |
714 JVMState* clonejvms = jvms->clone_shallow(C); |
714 JVMState* clonejvms = jvms->clone_shallow(C); |
1133 juint offset_con = (juint) find_int_con(offset, Type::OffsetBot); |
1133 juint offset_con = (juint) find_int_con(offset, Type::OffsetBot); |
1134 if (offset_con != (juint) Type::OffsetBot) { |
1134 if (offset_con != (juint) Type::OffsetBot) { |
1135 return longcon((julong) offset_con); |
1135 return longcon((julong) offset_con); |
1136 } |
1136 } |
1137 Node* conv = _gvn.transform( new ConvI2LNode(offset)); |
1137 Node* conv = _gvn.transform( new ConvI2LNode(offset)); |
1138 Node* mask = _gvn.transform( ConLNode::make(C, (julong) max_juint) ); |
1138 Node* mask = _gvn.transform(ConLNode::make((julong) max_juint)); |
1139 return _gvn.transform( new AndLNode(conv, mask) ); |
1139 return _gvn.transform( new AndLNode(conv, mask) ); |
1140 } |
1140 } |
1141 |
1141 |
1142 Node* GraphKit::ConvL2I(Node* offset) { |
1142 Node* GraphKit::ConvL2I(Node* offset) { |
1143 // short-circuit a common case |
1143 // short-circuit a common case |
1433 return _gvn.transform( mem ); |
1433 return _gvn.transform( mem ); |
1434 } |
1434 } |
1435 |
1435 |
1436 //------------------------------set_all_memory--------------------------------- |
1436 //------------------------------set_all_memory--------------------------------- |
1437 void GraphKit::set_all_memory(Node* newmem) { |
1437 void GraphKit::set_all_memory(Node* newmem) { |
1438 Node* mergemem = MergeMemNode::make(C, newmem); |
1438 Node* mergemem = MergeMemNode::make(newmem); |
1439 gvn().set_type_bottom(mergemem); |
1439 gvn().set_type_bottom(mergemem); |
1440 map()->set_memory(mergemem); |
1440 map()->set_memory(mergemem); |
1441 } |
1441 } |
1442 |
1442 |
1443 //------------------------------set_all_memory_call---------------------------- |
1443 //------------------------------set_all_memory_call---------------------------- |
1462 const TypePtr* adr_type = NULL; // debug-mode-only argument |
1462 const TypePtr* adr_type = NULL; // debug-mode-only argument |
1463 debug_only(adr_type = C->get_adr_type(adr_idx)); |
1463 debug_only(adr_type = C->get_adr_type(adr_idx)); |
1464 Node* mem = memory(adr_idx); |
1464 Node* mem = memory(adr_idx); |
1465 Node* ld; |
1465 Node* ld; |
1466 if (require_atomic_access && bt == T_LONG) { |
1466 if (require_atomic_access && bt == T_LONG) { |
1467 ld = LoadLNode::make_atomic(C, ctl, mem, adr, adr_type, t, mo); |
1467 ld = LoadLNode::make_atomic(ctl, mem, adr, adr_type, t, mo); |
1468 } else if (require_atomic_access && bt == T_DOUBLE) { |
1468 } else if (require_atomic_access && bt == T_DOUBLE) { |
1469 ld = LoadDNode::make_atomic(C, ctl, mem, adr, adr_type, t, mo); |
1469 ld = LoadDNode::make_atomic(ctl, mem, adr, adr_type, t, mo); |
1470 } else { |
1470 } else { |
1471 ld = LoadNode::make(_gvn, ctl, mem, adr, adr_type, t, bt, mo); |
1471 ld = LoadNode::make(_gvn, ctl, mem, adr, adr_type, t, bt, mo); |
1472 } |
1472 } |
1473 ld = _gvn.transform(ld); |
1473 ld = _gvn.transform(ld); |
1474 if ((bt == T_OBJECT) && C->do_escape_analysis() || C->eliminate_boxing()) { |
1474 if ((bt == T_OBJECT) && C->do_escape_analysis() || C->eliminate_boxing()) { |
1486 const TypePtr* adr_type = NULL; |
1486 const TypePtr* adr_type = NULL; |
1487 debug_only(adr_type = C->get_adr_type(adr_idx)); |
1487 debug_only(adr_type = C->get_adr_type(adr_idx)); |
1488 Node *mem = memory(adr_idx); |
1488 Node *mem = memory(adr_idx); |
1489 Node* st; |
1489 Node* st; |
1490 if (require_atomic_access && bt == T_LONG) { |
1490 if (require_atomic_access && bt == T_LONG) { |
1491 st = StoreLNode::make_atomic(C, ctl, mem, adr, adr_type, val, mo); |
1491 st = StoreLNode::make_atomic(ctl, mem, adr, adr_type, val, mo); |
1492 } else if (require_atomic_access && bt == T_DOUBLE) { |
1492 } else if (require_atomic_access && bt == T_DOUBLE) { |
1493 st = StoreDNode::make_atomic(C, ctl, mem, adr, adr_type, val, mo); |
1493 st = StoreDNode::make_atomic(ctl, mem, adr, adr_type, val, mo); |
1494 } else { |
1494 } else { |
1495 st = StoreNode::make(_gvn, ctl, mem, adr, adr_type, val, bt, mo); |
1495 st = StoreNode::make(_gvn, ctl, mem, adr, adr_type, val, bt, mo); |
1496 } |
1496 } |
1497 st = _gvn.transform(st); |
1497 st = _gvn.transform(st); |
1498 set_memory(st, adr_idx); |
1498 set_memory(st, adr_idx); |
3362 // Extract memory strands which may participate in the new object's |
3362 // Extract memory strands which may participate in the new object's |
3363 // initialization, and source them from the new InitializeNode. |
3363 // initialization, and source them from the new InitializeNode. |
3364 // This will allow us to observe initializations when they occur, |
3364 // This will allow us to observe initializations when they occur, |
3365 // and link them properly (as a group) to the InitializeNode. |
3365 // and link them properly (as a group) to the InitializeNode. |
3366 assert(init->in(InitializeNode::Memory) == malloc, ""); |
3366 assert(init->in(InitializeNode::Memory) == malloc, ""); |
3367 MergeMemNode* minit_in = MergeMemNode::make(C, malloc); |
3367 MergeMemNode* minit_in = MergeMemNode::make(malloc); |
3368 init->set_req(InitializeNode::Memory, minit_in); |
3368 init->set_req(InitializeNode::Memory, minit_in); |
3369 record_for_igvn(minit_in); // fold it up later, if possible |
3369 record_for_igvn(minit_in); // fold it up later, if possible |
3370 Node* minit_out = memory(rawidx); |
3370 Node* minit_out = memory(rawidx); |
3371 assert(minit_out->is_Proj() && minit_out->in(0) == init, ""); |
3371 assert(minit_out->is_Proj() && minit_out->in(0) == init, ""); |
3372 if (oop_type->isa_aryptr()) { |
3372 if (oop_type->isa_aryptr()) { |