1 /*
2 * Copyright (c) 2000, 2014, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
396 DebugInformationRecorder* debug_info = compilation()->debug_info_recorder();
397 assert(debug_info->recording_non_safepoints(), "sanity");
398
399 debug_info->add_non_safepoint(pc_offset);
400
401 // Visit scopes from oldest to youngest.
402 for (int n = 0; ; n++) {
403 int s_bci = bci;
404 ValueStack* s = nth_oldest(vstack, n, s_bci);
405 if (s == NULL) break;
406 IRScope* scope = s->scope();
407 //Always pass false for reexecute since these ScopeDescs are never used for deopt
408 methodHandle null_mh;
409 debug_info->describe_scope(pc_offset, null_mh, scope->method(), s->bci(), false/*reexecute*/);
410 }
411
412 debug_info->end_non_safepoint(pc_offset);
413 }
414
415
416 void LIR_Assembler::add_debug_info_for_null_check_here(CodeEmitInfo* cinfo) {
417 add_debug_info_for_null_check(code_offset(), cinfo);
418 }
419
420 void LIR_Assembler::add_debug_info_for_null_check(int pc_offset, CodeEmitInfo* cinfo) {
421 ImplicitNullCheckStub* stub = new ImplicitNullCheckStub(pc_offset, cinfo);
422 append_code_stub(stub);
423 }
424
425 void LIR_Assembler::add_debug_info_for_div0_here(CodeEmitInfo* info) {
426 add_debug_info_for_div0(code_offset(), info);
427 }
428
429 void LIR_Assembler::add_debug_info_for_div0(int pc_offset, CodeEmitInfo* cinfo) {
430 DivByZeroStub* stub = new DivByZeroStub(pc_offset, cinfo);
431 append_code_stub(stub);
432 }
433
434 void LIR_Assembler::emit_rtcall(LIR_OpRTCall* op) {
435 rt_call(op->result_opr(), op->addr(), op->arguments(), op->tmp(), op->info());
436 }
437
438
439 void LIR_Assembler::emit_call(LIR_OpJavaCall* op) {
440 verify_oop_map(op->info());
441
442 if (os::is_MP()) {
540 break;
541
542 case lir_push:
543 push(op->in_opr());
544 break;
545
546 case lir_pop:
547 pop(op->in_opr());
548 break;
549
550 case lir_neg:
551 negate(op->in_opr(), op->result_opr());
552 break;
553
554 case lir_leal:
555 leal(op->in_opr(), op->result_opr());
556 break;
557
558 case lir_null_check:
559 if (GenerateCompilerNullChecks) {
560 add_debug_info_for_null_check_here(op->info());
561
562 if (op->in_opr()->is_single_cpu()) {
563 _masm->null_check(op->in_opr()->as_register());
564 } else {
565 Unimplemented();
566 }
567 }
568 break;
569
570 case lir_monaddr:
571 monitor_address(op->in_opr()->as_constant_ptr()->as_jint(), op->result_opr());
572 break;
573
574 #ifdef SPARC
575 case lir_pack64:
576 pack64(op->in_opr(), op->result_opr());
577 break;
578
579 case lir_unpack64:
580 unpack64(op->in_opr(), op->result_opr());
581 break;
582 #endif
583
|
1 /*
2 * Copyright (c) 2000, 2015, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
396 DebugInformationRecorder* debug_info = compilation()->debug_info_recorder();
397 assert(debug_info->recording_non_safepoints(), "sanity");
398
399 debug_info->add_non_safepoint(pc_offset);
400
401 // Visit scopes from oldest to youngest.
402 for (int n = 0; ; n++) {
403 int s_bci = bci;
404 ValueStack* s = nth_oldest(vstack, n, s_bci);
405 if (s == NULL) break;
406 IRScope* scope = s->scope();
407 //Always pass false for reexecute since these ScopeDescs are never used for deopt
408 methodHandle null_mh;
409 debug_info->describe_scope(pc_offset, null_mh, scope->method(), s->bci(), false/*reexecute*/);
410 }
411
412 debug_info->end_non_safepoint(pc_offset);
413 }
414
415
416 ImplicitNullCheckStub* LIR_Assembler::add_debug_info_for_null_check_here(CodeEmitInfo* cinfo) {
417 return add_debug_info_for_null_check(code_offset(), cinfo);
418 }
419
420 ImplicitNullCheckStub* LIR_Assembler::add_debug_info_for_null_check(int pc_offset, CodeEmitInfo* cinfo) {
421 ImplicitNullCheckStub* stub = new ImplicitNullCheckStub(pc_offset, cinfo);
422 append_code_stub(stub);
423 return stub;
424 }
425
426 void LIR_Assembler::add_debug_info_for_div0_here(CodeEmitInfo* info) {
427 add_debug_info_for_div0(code_offset(), info);
428 }
429
430 void LIR_Assembler::add_debug_info_for_div0(int pc_offset, CodeEmitInfo* cinfo) {
431 DivByZeroStub* stub = new DivByZeroStub(pc_offset, cinfo);
432 append_code_stub(stub);
433 }
434
435 void LIR_Assembler::emit_rtcall(LIR_OpRTCall* op) {
436 rt_call(op->result_opr(), op->addr(), op->arguments(), op->tmp(), op->info());
437 }
438
439
440 void LIR_Assembler::emit_call(LIR_OpJavaCall* op) {
441 verify_oop_map(op->info());
442
443 if (os::is_MP()) {
541 break;
542
543 case lir_push:
544 push(op->in_opr());
545 break;
546
547 case lir_pop:
548 pop(op->in_opr());
549 break;
550
551 case lir_neg:
552 negate(op->in_opr(), op->result_opr());
553 break;
554
555 case lir_leal:
556 leal(op->in_opr(), op->result_opr());
557 break;
558
559 case lir_null_check:
560 if (GenerateCompilerNullChecks) {
561 ImplicitNullCheckStub* stub = add_debug_info_for_null_check_here(op->info());
562
563 if (op->in_opr()->is_single_cpu()) {
564 _masm->null_check(op->in_opr()->as_register(), stub->entry());
565 } else {
566 Unimplemented();
567 }
568 }
569 break;
570
571 case lir_monaddr:
572 monitor_address(op->in_opr()->as_constant_ptr()->as_jint(), op->result_opr());
573 break;
574
575 #ifdef SPARC
576 case lir_pack64:
577 pack64(op->in_opr(), op->result_opr());
578 break;
579
580 case lir_unpack64:
581 unpack64(op->in_opr(), op->result_opr());
582 break;
583 #endif
584
|