src/share/vm/opto/stringopts.cpp

changeset 1685
3f5b7efb9642
parent 1515
7c57aead6d3e
child 1907
c18cbe5936b8
equal deleted inserted replaced
1647:c028504fdaa6 1685:3f5b7efb9642
1 /* 1 /*
2 * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. 2 * Copyright 2009-2010 Sun Microsystems, Inc. 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.
1071 Node *mem = PhiNode::make(head, kit.memory(char_adr_idx), Type::MEMORY, TypeAryPtr::CHARS); 1071 Node *mem = PhiNode::make(head, kit.memory(char_adr_idx), Type::MEMORY, TypeAryPtr::CHARS);
1072 kit.gvn().set_type(mem, Type::MEMORY); 1072 kit.gvn().set_type(mem, Type::MEMORY);
1073 kit.set_control(head); 1073 kit.set_control(head);
1074 kit.set_memory(mem, char_adr_idx); 1074 kit.set_memory(mem, char_adr_idx);
1075 1075
1076 Node* q = __ DivI(kit.null(), i_phi, __ intcon(10)); 1076 Node* q = __ DivI(NULL, i_phi, __ intcon(10));
1077 Node* r = __ SubI(i_phi, __ AddI(__ LShiftI(q, __ intcon(3)), 1077 Node* r = __ SubI(i_phi, __ AddI(__ LShiftI(q, __ intcon(3)),
1078 __ LShiftI(q, __ intcon(1)))); 1078 __ LShiftI(q, __ intcon(1))));
1079 Node* m1 = __ SubI(charPos, __ intcon(1)); 1079 Node* m1 = __ SubI(charPos, __ intcon(1));
1080 Node* ch = __ AddI(r, __ intcon('0')); 1080 Node* ch = __ AddI(r, __ intcon('0'));
1081 1081
1268 } else if (!type->higher_equal(TypeInstPtr::NOTNULL)) { 1268 } else if (!type->higher_equal(TypeInstPtr::NOTNULL)) {
1269 // s = s != null ? s : "null"; 1269 // s = s != null ? s : "null";
1270 // length = length + (s.count - s.offset); 1270 // length = length + (s.count - s.offset);
1271 RegionNode *r = new (C, 3) RegionNode(3); 1271 RegionNode *r = new (C, 3) RegionNode(3);
1272 kit.gvn().set_type(r, Type::CONTROL); 1272 kit.gvn().set_type(r, Type::CONTROL);
1273 Node *phi = new (C, 3) PhiNode(r, type->join(TypeInstPtr::NOTNULL)); 1273 Node *phi = new (C, 3) PhiNode(r, type);
1274 kit.gvn().set_type(phi, phi->bottom_type()); 1274 kit.gvn().set_type(phi, phi->bottom_type());
1275 Node* p = __ Bool(__ CmpP(arg, kit.null()), BoolTest::ne); 1275 Node* p = __ Bool(__ CmpP(arg, kit.null()), BoolTest::ne);
1276 IfNode* iff = kit.create_and_map_if(kit.control(), p, PROB_MIN, COUNT_UNKNOWN); 1276 IfNode* iff = kit.create_and_map_if(kit.control(), p, PROB_MIN, COUNT_UNKNOWN);
1277 Node* notnull = __ IfTrue(iff); 1277 Node* notnull = __ IfTrue(iff);
1278 Node* isnull = __ IfFalse(iff); 1278 Node* isnull = __ IfFalse(iff);
1279 kit.set_control(notnull); // set control for the cast_not_null
1279 r->init_req(1, notnull); 1280 r->init_req(1, notnull);
1280 phi->init_req(1, arg); 1281 phi->init_req(1, kit.cast_not_null(arg, false));
1281 r->init_req(2, isnull); 1282 r->init_req(2, isnull);
1282 phi->init_req(2, null_string); 1283 phi->init_req(2, null_string);
1283 kit.set_control(r); 1284 kit.set_control(r);
1284 C->record_for_igvn(r); 1285 C->record_for_igvn(r);
1285 C->record_for_igvn(phi); 1286 C->record_for_igvn(phi);

mercurial