1 /*
2 * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
3 * Copyright 2008, 2009, 2010 Red Hat, Inc.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
6 * This code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 only, as
8 * published by the Free Software Foundation.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
23 *
24 */
25
26 class SharkTopLevelBlock : public SharkBlock {
27 public:
28 SharkTopLevelBlock(SharkFunction* function, ciTypeFlow::Block* ciblock)
29 : SharkBlock(function),
30 _function(function),
31 _ciblock(ciblock),
32 _entered(false),
33 _has_trap(false),
34 _needs_phis(false),
35 _entry_state(NULL),
36 _entry_block(NULL) {}
37
38 private:
39 SharkFunction* _function;
40 ciTypeFlow::Block* _ciblock;
41
42 public:
43 SharkFunction* function() const {
44 return _function;
45 }
411 private:
412 bool static_subtype_check(ciKlass* check_klass, ciKlass* object_klass);
413 void do_full_instance_check(ciKlass* klass);
414 void do_trapping_instance_check(ciKlass* klass);
415
416 void do_instance_check();
417 bool maybe_do_instanceof_if();
418
419 // new and *newarray
420 private:
421 void do_new();
422 void do_newarray();
423 void do_anewarray();
424 void do_multianewarray();
425
426 // monitorenter and monitorexit
427 private:
428 void do_monitorenter();
429 void do_monitorexit();
430 };
|
1 /*
2 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
3 * Copyright 2008, 2009, 2010 Red Hat, Inc.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
6 * This code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 only, as
8 * published by the Free Software Foundation.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
23 *
24 */
25
26 #ifndef SHARE_VM_SHARK_SHARKTOPLEVELBLOCK_HPP
27 #define SHARE_VM_SHARK_SHARKTOPLEVELBLOCK_HPP
28
29 #include "ci/ciStreams.hpp"
30 #include "ci/ciType.hpp"
31 #include "ci/ciTypeFlow.hpp"
32 #include "interpreter/bytecodes.hpp"
33 #include "memory/allocation.hpp"
34 #include "shark/llvmHeaders.hpp"
35 #include "shark/sharkBlock.hpp"
36 #include "shark/sharkBuilder.hpp"
37 #include "shark/sharkFunction.hpp"
38 #include "shark/sharkState.hpp"
39 #include "shark/sharkValue.hpp"
40
41 class SharkTopLevelBlock : public SharkBlock {
42 public:
43 SharkTopLevelBlock(SharkFunction* function, ciTypeFlow::Block* ciblock)
44 : SharkBlock(function),
45 _function(function),
46 _ciblock(ciblock),
47 _entered(false),
48 _has_trap(false),
49 _needs_phis(false),
50 _entry_state(NULL),
51 _entry_block(NULL) {}
52
53 private:
54 SharkFunction* _function;
55 ciTypeFlow::Block* _ciblock;
56
57 public:
58 SharkFunction* function() const {
59 return _function;
60 }
426 private:
427 bool static_subtype_check(ciKlass* check_klass, ciKlass* object_klass);
428 void do_full_instance_check(ciKlass* klass);
429 void do_trapping_instance_check(ciKlass* klass);
430
431 void do_instance_check();
432 bool maybe_do_instanceof_if();
433
434 // new and *newarray
435 private:
436 void do_new();
437 void do_newarray();
438 void do_anewarray();
439 void do_multianewarray();
440
441 // monitorenter and monitorexit
442 private:
443 void do_monitorenter();
444 void do_monitorexit();
445 };
446
447 #endif // SHARE_VM_SHARK_SHARKTOPLEVELBLOCK_HPP
|