1 /*
2 * Copyright 1999-2006 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
20 * CA 95054 USA or visit www.sun.com if you need additional information or
21 * have any questions.
22 *
398 } else {
399 ShouldNotReachHere();
400 }
401 assert(_bytes_to_copy <= (masm->pc() - pc_start()), "not enough bytes");
402 }
403
404 address pc_start() const { return _pc_start; }
405 PatchID id() const { return _id; }
406
407 virtual void emit_code(LIR_Assembler* e);
408 virtual CodeEmitInfo* info() const { return _info; }
409 virtual void visit(LIR_OpVisitState* visitor) {
410 visitor->do_slow_case(_info);
411 }
412 #ifndef PRODUCT
413 virtual void print_name(outputStream* out) const { out->print("PatchingStub"); }
414 #endif // PRODUCT
415 };
416
417
418 class SimpleExceptionStub: public CodeStub {
419 private:
420 LIR_Opr _obj;
421 Runtime1::StubID _stub;
422 CodeEmitInfo* _info;
423
424 public:
425 SimpleExceptionStub(Runtime1::StubID stub, LIR_Opr obj, CodeEmitInfo* info):
426 _obj(obj), _info(info), _stub(stub) {
427 }
428
429 virtual void emit_code(LIR_Assembler* e);
430 virtual CodeEmitInfo* info() const { return _info; }
431 virtual bool is_exception_throw_stub() const { return true; }
432 virtual void visit(LIR_OpVisitState* visitor) {
433 if (_obj->is_valid()) visitor->do_input(_obj);
434 visitor->do_slow_case(_info);
435 }
436 #ifndef PRODUCT
437 virtual void print_name(outputStream* out) const { out->print("SimpleExceptionStub"); }
|
1 /*
2 * Copyright 1999-2010 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
20 * CA 95054 USA or visit www.sun.com if you need additional information or
21 * have any questions.
22 *
398 } else {
399 ShouldNotReachHere();
400 }
401 assert(_bytes_to_copy <= (masm->pc() - pc_start()), "not enough bytes");
402 }
403
404 address pc_start() const { return _pc_start; }
405 PatchID id() const { return _id; }
406
407 virtual void emit_code(LIR_Assembler* e);
408 virtual CodeEmitInfo* info() const { return _info; }
409 virtual void visit(LIR_OpVisitState* visitor) {
410 visitor->do_slow_case(_info);
411 }
412 #ifndef PRODUCT
413 virtual void print_name(outputStream* out) const { out->print("PatchingStub"); }
414 #endif // PRODUCT
415 };
416
417
418 //------------------------------------------------------------------------------
419 // DeoptimizeStub
420 //
421 class DeoptimizeStub : public CodeStub {
422 private:
423 CodeEmitInfo* _info;
424
425 public:
426 DeoptimizeStub(CodeEmitInfo* info) : _info(new CodeEmitInfo(info)) {}
427
428 virtual void emit_code(LIR_Assembler* e);
429 virtual CodeEmitInfo* info() const { return _info; }
430 virtual bool is_exception_throw_stub() const { return true; }
431 virtual void visit(LIR_OpVisitState* visitor) {
432 visitor->do_slow_case(_info);
433 }
434 #ifndef PRODUCT
435 virtual void print_name(outputStream* out) const { out->print("DeoptimizeStub"); }
436 #endif // PRODUCT
437 };
438
439
440 class SimpleExceptionStub: public CodeStub {
441 private:
442 LIR_Opr _obj;
443 Runtime1::StubID _stub;
444 CodeEmitInfo* _info;
445
446 public:
447 SimpleExceptionStub(Runtime1::StubID stub, LIR_Opr obj, CodeEmitInfo* info):
448 _obj(obj), _info(info), _stub(stub) {
449 }
450
451 virtual void emit_code(LIR_Assembler* e);
452 virtual CodeEmitInfo* info() const { return _info; }
453 virtual bool is_exception_throw_stub() const { return true; }
454 virtual void visit(LIR_OpVisitState* visitor) {
455 if (_obj->is_valid()) visitor->do_input(_obj);
456 visitor->do_slow_case(_info);
457 }
458 #ifndef PRODUCT
459 virtual void print_name(outputStream* out) const { out->print("SimpleExceptionStub"); }
|