1 /*
2 * Copyright (c) 1999, 2016, 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 *
548 , _log(env->log())
549 , _method(method)
550 , _osr_bci(osr_bci)
551 , _hir(NULL)
552 , _max_spills(-1)
553 , _frame_map(NULL)
554 , _masm(NULL)
555 , _has_exception_handlers(false)
556 , _has_fpu_code(true) // pessimistic assumption
557 , _has_unsafe_access(false)
558 , _would_profile(false)
559 , _has_method_handle_invokes(false)
560 , _has_reserved_stack_access(method->has_reserved_stack_access())
561 , _install_code(install_code)
562 , _bailout_msg(NULL)
563 , _exception_info_list(NULL)
564 , _allocator(NULL)
565 , _code(buffer_blob)
566 , _has_access_indexed(false)
567 , _interpreter_frame_size(0)
568 , _current_instruction(NULL)
569 #ifndef PRODUCT
570 , _last_instruction_printed(NULL)
571 , _cfg_printer_output(NULL)
572 #endif // PRODUCT
573 {
574 PhaseTraceTime timeit(_t_compile);
575 _arena = Thread::current()->resource_area();
576 _env->set_compiler_data(this);
577 _exception_info_list = new ExceptionInfoList();
578 _implicit_exception_table.set_size(0);
579 #ifndef PRODUCT
580 if (PrintCFGToFile) {
581 _cfg_printer_output = new CFGPrinterOutput(this);
582 }
583 #endif
584 compile_method();
585 if (bailed_out()) {
586 _env->record_method_not_compilable(bailout_msg(), !TieredCompilation);
587 if (is_profiling()) {
588 // Compilation failed, create MDO, which would signal the interpreter
589 // to start profiling on its own.
590 _method->ensure_method_data();
591 }
592 } else if (is_profiling()) {
593 ciMethodData *md = method->method_data_or_null();
594 if (md != NULL) {
595 md->set_would_profile(_would_profile);
596 }
597 }
598 }
599
600 Compilation::~Compilation() {
601 _env->set_compiler_data(NULL);
602 }
603
|
1 /*
2 * Copyright (c) 1999, 2019, 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 *
548 , _log(env->log())
549 , _method(method)
550 , _osr_bci(osr_bci)
551 , _hir(NULL)
552 , _max_spills(-1)
553 , _frame_map(NULL)
554 , _masm(NULL)
555 , _has_exception_handlers(false)
556 , _has_fpu_code(true) // pessimistic assumption
557 , _has_unsafe_access(false)
558 , _would_profile(false)
559 , _has_method_handle_invokes(false)
560 , _has_reserved_stack_access(method->has_reserved_stack_access())
561 , _install_code(install_code)
562 , _bailout_msg(NULL)
563 , _exception_info_list(NULL)
564 , _allocator(NULL)
565 , _code(buffer_blob)
566 , _has_access_indexed(false)
567 , _interpreter_frame_size(0)
568 , _compiled_entry_signature(method->get_Method())
569 , _current_instruction(NULL)
570 #ifndef PRODUCT
571 , _last_instruction_printed(NULL)
572 , _cfg_printer_output(NULL)
573 #endif // PRODUCT
574 {
575 PhaseTraceTime timeit(_t_compile);
576 _arena = Thread::current()->resource_area();
577 _env->set_compiler_data(this);
578 _exception_info_list = new ExceptionInfoList();
579 _implicit_exception_table.set_size(0);
580 #ifndef PRODUCT
581 if (PrintCFGToFile) {
582 _cfg_printer_output = new CFGPrinterOutput(this);
583 }
584 #endif
585 {
586 ResetNoHandleMark rnhm; // Huh? Required when doing class lookup of the Q-types
587 _compiled_entry_signature.compute_calling_conventions();
588 }
589 compile_method();
590 if (bailed_out()) {
591 _env->record_method_not_compilable(bailout_msg(), !TieredCompilation);
592 if (is_profiling()) {
593 // Compilation failed, create MDO, which would signal the interpreter
594 // to start profiling on its own.
595 _method->ensure_method_data();
596 }
597 } else if (is_profiling()) {
598 ciMethodData *md = method->method_data_or_null();
599 if (md != NULL) {
600 md->set_would_profile(_would_profile);
601 }
602 }
603 }
604
605 Compilation::~Compilation() {
606 _env->set_compiler_data(NULL);
607 }
608
|