1612N/A/*
1879N/A * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
1612N/A * Copyright 2009 Red Hat, Inc.
1612N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1612N/A *
1612N/A * This code is free software; you can redistribute it and/or modify it
1612N/A * under the terms of the GNU General Public License version 2 only, as
1612N/A * published by the Free Software Foundation.
1612N/A *
1612N/A * This code is distributed in the hope that it will be useful, but WITHOUT
1612N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1612N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1612N/A * version 2 for more details (a copy is included in the LICENSE file that
1612N/A * accompanied this code).
1612N/A *
1612N/A * You should have received a copy of the GNU General Public License version
1612N/A * 2 along with this work; if not, write to the Free Software Foundation,
1612N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1612N/A *
1612N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1612N/A * or visit www.oracle.com if you need additional information or have any
1612N/A * questions.
1612N/A *
1612N/A */
1612N/A
1879N/A#include "precompiled.hpp"
1879N/A#include "ci/ciField.hpp"
1879N/A#include "ci/ciMethod.hpp"
1879N/A#include "ci/ciStreams.hpp"
1879N/A#include "interpreter/bytecodes.hpp"
1879N/A#include "memory/allocation.hpp"
1879N/A#include "shark/sharkBlock.hpp"
1879N/A#include "shark/sharkConstant.hpp"
1879N/A#include "shark/sharkInliner.hpp"
1879N/A#include "shark/sharkIntrinsics.hpp"
1879N/A#include "shark/sharkState.hpp"
1879N/A#include "shark/sharkValue.hpp"
1879N/A#include "shark/shark_globals.hpp"
1612N/A
1612N/Ausing namespace llvm;
1612N/A
1612N/Aclass SharkInlineBlock : public SharkBlock {
1612N/A public:
1612N/A SharkInlineBlock(ciMethod* target, SharkState* state)
1612N/A : SharkBlock(state, target),
1612N/A _outer_state(state),
1612N/A _entry_state(new SharkState(this)) {
1612N/A for (int i = target->max_locals() - 1; i >= 0; i--) {
1612N/A SharkValue *value = NULL;
1612N/A if (i < target->arg_size())
1612N/A value = outer_state()->pop();
1612N/A entry_state()->set_local(i, value);
1612N/A }
1612N/A }
1612N/A
1612N/A private:
1612N/A SharkState* _outer_state;
1612N/A SharkState* _entry_state;
1612N/A
1612N/A private:
1612N/A SharkState* outer_state() {
1612N/A return _outer_state;
1612N/A }
1612N/A SharkState* entry_state() {
1612N/A return _entry_state;
1612N/A }
1612N/A
1612N/A public:
1612N/A void emit_IR() {
1612N/A parse_bytecode(0, target()->code_size());
1612N/A }
1612N/A
1612N/A private:
1612N/A void do_return(BasicType type) {
1612N/A if (type != T_VOID) {
1612N/A SharkValue *result = pop_result(type);
1612N/A outer_state()->push(result);
1612N/A if (result->is_two_word())
1612N/A outer_state()->push(NULL);
1612N/A }
1612N/A }
1612N/A};
1612N/A
1612N/Aclass SharkInlinerHelper : public StackObj {
1612N/A public:
1612N/A SharkInlinerHelper(ciMethod* target, SharkState* entry_state)
1612N/A : _target(target),
1612N/A _entry_state(entry_state),
1612N/A _iter(target) {}
1612N/A
1612N/A private:
1612N/A ciBytecodeStream _iter;
1612N/A SharkState* _entry_state;
1612N/A ciMethod* _target;
1612N/A
1612N/A public:
1612N/A ciBytecodeStream* iter() {
1612N/A return &_iter;
1612N/A }
1612N/A SharkState* entry_state() const {
1612N/A return _entry_state;
1612N/A }
1612N/A ciMethod* target() const {
1612N/A return _target;
1612N/A }
1612N/A
1612N/A public:
1612N/A Bytecodes::Code bc() {
1612N/A return iter()->cur_bc();
1612N/A }
1612N/A int max_locals() const {
1612N/A return target()->max_locals();
1612N/A }
1612N/A int max_stack() const {
1612N/A return target()->max_stack();
1612N/A }
1612N/A
1612N/A // Inlinability check
1612N/A public:
1612N/A bool is_inlinable();
1612N/A
1612N/A private:
1612N/A void initialize_for_check();
1612N/A
1612N/A bool do_getstatic() {
1612N/A return do_field_access(true, false);
1612N/A }
1612N/A bool do_getfield() {
1612N/A return do_field_access(true, true);
1612N/A }
1612N/A bool do_putfield() {
1612N/A return do_field_access(false, true);
1612N/A }
1612N/A bool do_field_access(bool is_get, bool is_field);
1612N/A
1612N/A // Local variables for inlinability check
1612N/A private:
1612N/A bool* _locals;
1612N/A
1612N/A public:
1612N/A bool* local_addr(int index) const {
1612N/A assert(index >= 0 && index < max_locals(), "bad local variable index");
1612N/A return &_locals[index];
1612N/A }
1612N/A bool local(int index) const {
1612N/A return *local_addr(index);
1612N/A }
1612N/A void set_local(int index, bool value) {
1612N/A *local_addr(index) = value;
1612N/A }
1612N/A
1612N/A // Expression stack for inlinability check
1612N/A private:
1612N/A bool* _stack;
1612N/A bool* _sp;
1612N/A
1612N/A public:
1612N/A int stack_depth() const {
1612N/A return _sp - _stack;
1612N/A }
1612N/A bool* stack_addr(int slot) const {
1612N/A assert(slot >= 0 && slot < stack_depth(), "bad stack slot");
1612N/A return &_sp[-(slot + 1)];
1612N/A }
1612N/A void push(bool value) {
1612N/A assert(stack_depth() < max_stack(), "stack overrun");
1612N/A *(_sp++) = value;
1612N/A }
1612N/A bool pop() {
1612N/A assert(stack_depth() > 0, "stack underrun");
1612N/A return *(--_sp);
1612N/A }
1612N/A
1612N/A // Methods for two-word locals
1612N/A public:
1612N/A void push_pair_local(int index) {
1612N/A push(local(index));
1612N/A push(local(index + 1));
1612N/A }
1612N/A void pop_pair_local(int index) {
1612N/A set_local(index + 1, pop());
1612N/A set_local(index, pop());
1612N/A }
1612N/A
1612N/A // Code generation
1612N/A public:
1612N/A void do_inline() {
1612N/A (new SharkInlineBlock(target(), entry_state()))->emit_IR();
1612N/A }
1612N/A};
1612N/A
1612N/A// Quick checks so we can bail out before doing too much
1612N/Abool SharkInliner::may_be_inlinable(ciMethod *target) {
1612N/A // We can't inline native methods
1612N/A if (target->is_native())
1612N/A return false;
1612N/A
1612N/A // Not much point inlining abstract ones, and in any
1612N/A // case we'd need a stack frame to throw the exception
1612N/A if (target->is_abstract())
1612N/A return false;
1612N/A
1612N/A // Don't inline anything huge
1612N/A if (target->code_size() > SharkMaxInlineSize)
1612N/A return false;
1612N/A
1612N/A // Monitors aren't allowed without a frame to put them in
1612N/A if (target->is_synchronized() || target->has_monitor_bytecodes())
1612N/A return false;
1612N/A
1612N/A // We don't do control flow
1612N/A if (target->has_exception_handlers() || target->has_jsrs())
1612N/A return false;
1612N/A
1612N/A // Don't try to inline constructors, as they must
1612N/A // eventually call Object.<init> which we can't inline.
1612N/A // Note that this catches <clinit> too, but why would
1612N/A // we be compiling that?
1612N/A if (target->is_initializer())
1612N/A return false;
1612N/A
1612N/A // Mustn't inline Object.<init>
1612N/A // Should be caught by the above, but just in case...
1612N/A if (target->intrinsic_id() == vmIntrinsics::_Object_init)
1612N/A return false;
1612N/A
1612N/A return true;
1612N/A}
1612N/A
1612N/A// Full-on detailed check, for methods that pass the quick checks
1612N/A// Inlined methods have no stack frame, so we can't do anything
1612N/A// that would require one. This means no safepoints (and hence
1612N/A// no loops) and no VM calls. No VM calls means, amongst other
1612N/A// things, that no exceptions can be created, which means no null
1612N/A// checks or divide-by-zero checks are allowed. The lack of null
1612N/A// checks in particular would eliminate practically everything,
1612N/A// but we can get around that restriction by relying on the zero-
1612N/A// check eliminator to strip the checks. To do that, we need to
1612N/A// walk through the method, tracking which values are and are not
1612N/A// zero-checked.
1612N/Abool SharkInlinerHelper::is_inlinable() {
1612N/A ResourceMark rm;
1612N/A initialize_for_check();
1612N/A
1612N/A SharkConstant *sc;
1612N/A bool a, b, c, d;
1612N/A
1612N/A iter()->reset_to_bci(0);
1612N/A while (iter()->next() != ciBytecodeStream::EOBC()) {
1612N/A switch (bc()) {
1612N/A case Bytecodes::_nop:
1612N/A break;
1612N/A
1612N/A case Bytecodes::_aconst_null:
1612N/A push(false);
1612N/A break;
1612N/A
1612N/A case Bytecodes::_iconst_0:
1612N/A push(false);
1612N/A break;
1612N/A case Bytecodes::_iconst_m1:
1612N/A case Bytecodes::_iconst_1:
1612N/A case Bytecodes::_iconst_2:
1612N/A case Bytecodes::_iconst_3:
1612N/A case Bytecodes::_iconst_4:
1612N/A case Bytecodes::_iconst_5:
1612N/A push(true);
1612N/A break;
1612N/A
1612N/A case Bytecodes::_lconst_0:
1612N/A push(false);
1612N/A push(false);
1612N/A break;
1612N/A case Bytecodes::_lconst_1:
1612N/A push(true);
1612N/A push(false);
1612N/A break;
1612N/A
1612N/A case Bytecodes::_fconst_0:
1612N/A case Bytecodes::_fconst_1:
1612N/A case Bytecodes::_fconst_2:
1612N/A push(false);
1612N/A break;
1612N/A
1612N/A case Bytecodes::_dconst_0:
1612N/A case Bytecodes::_dconst_1:
1612N/A push(false);
1612N/A push(false);
1612N/A break;
1612N/A
1612N/A case Bytecodes::_bipush:
1612N/A push(iter()->get_constant_u1() != 0);
1612N/A break;
1612N/A case Bytecodes::_sipush:
1612N/A push(iter()->get_constant_u2() != 0);
1612N/A break;
1612N/A
1612N/A case Bytecodes::_ldc:
1612N/A case Bytecodes::_ldc_w:
1612N/A case Bytecodes::_ldc2_w:
1612N/A sc = SharkConstant::for_ldc(iter());
1612N/A if (!sc->is_loaded())
1612N/A return false;
1612N/A push(sc->is_nonzero());
1612N/A if (sc->is_two_word())
1612N/A push(false);
1612N/A break;
1612N/A
1612N/A case Bytecodes::_iload_0:
1612N/A case Bytecodes::_fload_0:
1612N/A case Bytecodes::_aload_0:
1612N/A push(local(0));
1612N/A break;
1612N/A case Bytecodes::_lload_0:
1612N/A case Bytecodes::_dload_0:
1612N/A push_pair_local(0);
1612N/A break;
1612N/A
1612N/A case Bytecodes::_iload_1:
1612N/A case Bytecodes::_fload_1:
1612N/A case Bytecodes::_aload_1:
1612N/A push(local(1));
1612N/A break;
1612N/A case Bytecodes::_lload_1:
1612N/A case Bytecodes::_dload_1:
1612N/A push_pair_local(1);
1612N/A break;
1612N/A
1612N/A case Bytecodes::_iload_2:
1612N/A case Bytecodes::_fload_2:
1612N/A case Bytecodes::_aload_2:
1612N/A push(local(2));
1612N/A break;
1612N/A case Bytecodes::_lload_2:
1612N/A case Bytecodes::_dload_2:
1612N/A push_pair_local(2);
1612N/A break;
1612N/A
1612N/A case Bytecodes::_iload_3:
1612N/A case Bytecodes::_fload_3:
1612N/A case Bytecodes::_aload_3:
1612N/A push(local(3));
1612N/A break;
1612N/A case Bytecodes::_lload_3:
1612N/A case Bytecodes::_dload_3:
1612N/A push_pair_local(3);
1612N/A break;
1612N/A
1612N/A case Bytecodes::_iload:
1612N/A case Bytecodes::_fload:
1612N/A case Bytecodes::_aload:
1612N/A push(local(iter()->get_index()));
1612N/A break;
1612N/A case Bytecodes::_lload:
1612N/A case Bytecodes::_dload:
1612N/A push_pair_local(iter()->get_index());
1612N/A break;
1612N/A
1612N/A case Bytecodes::_istore_0:
1612N/A case Bytecodes::_fstore_0:
1612N/A case Bytecodes::_astore_0:
1612N/A set_local(0, pop());
1612N/A break;
1612N/A case Bytecodes::_lstore_0:
1612N/A case Bytecodes::_dstore_0:
1612N/A pop_pair_local(0);
1612N/A break;
1612N/A
1612N/A case Bytecodes::_istore_1:
1612N/A case Bytecodes::_fstore_1:
1612N/A case Bytecodes::_astore_1:
1612N/A set_local(1, pop());
1612N/A break;
1612N/A case Bytecodes::_lstore_1:
1612N/A case Bytecodes::_dstore_1:
1612N/A pop_pair_local(1);
1612N/A break;
1612N/A
1612N/A case Bytecodes::_istore_2:
1612N/A case Bytecodes::_fstore_2:
1612N/A case Bytecodes::_astore_2:
1612N/A set_local(2, pop());
1612N/A break;
1612N/A case Bytecodes::_lstore_2:
1612N/A case Bytecodes::_dstore_2:
1612N/A pop_pair_local(2);
1612N/A break;
1612N/A
1612N/A case Bytecodes::_istore_3:
1612N/A case Bytecodes::_fstore_3:
1612N/A case Bytecodes::_astore_3:
1612N/A set_local(3, pop());
1612N/A break;
1612N/A case Bytecodes::_lstore_3:
1612N/A case Bytecodes::_dstore_3:
1612N/A pop_pair_local(3);
1612N/A break;
1612N/A
1612N/A case Bytecodes::_istore:
1612N/A case Bytecodes::_fstore:
1612N/A case Bytecodes::_astore:
1612N/A set_local(iter()->get_index(), pop());
1612N/A break;
1612N/A case Bytecodes::_lstore:
1612N/A case Bytecodes::_dstore:
1612N/A pop_pair_local(iter()->get_index());
1612N/A break;
1612N/A
1612N/A case Bytecodes::_pop:
1612N/A pop();
1612N/A break;
1612N/A case Bytecodes::_pop2:
1612N/A pop();
1612N/A pop();
1612N/A break;
1612N/A case Bytecodes::_swap:
1612N/A a = pop();
1612N/A b = pop();
1612N/A push(a);
1612N/A push(b);
1612N/A break;
1612N/A case Bytecodes::_dup:
1612N/A a = pop();
1612N/A push(a);
1612N/A push(a);
1612N/A break;
1612N/A case Bytecodes::_dup_x1:
1612N/A a = pop();
1612N/A b = pop();
1612N/A push(a);
1612N/A push(b);
1612N/A push(a);
1612N/A break;
1612N/A case Bytecodes::_dup_x2:
1612N/A a = pop();
1612N/A b = pop();
1612N/A c = pop();
1612N/A push(a);
1612N/A push(c);
1612N/A push(b);
1612N/A push(a);
1612N/A break;
1612N/A case Bytecodes::_dup2:
1612N/A a = pop();
1612N/A b = pop();
1612N/A push(b);
1612N/A push(a);
1612N/A push(b);
1612N/A push(a);
1612N/A break;
1612N/A case Bytecodes::_dup2_x1:
1612N/A a = pop();
1612N/A b = pop();
1612N/A c = pop();
1612N/A push(b);
1612N/A push(a);
1612N/A push(c);
1612N/A push(b);
1612N/A push(a);
1612N/A break;
1612N/A case Bytecodes::_dup2_x2:
1612N/A a = pop();
1612N/A b = pop();
1612N/A c = pop();
1612N/A d = pop();
1612N/A push(b);
1612N/A push(a);
1612N/A push(d);
1612N/A push(c);
1612N/A push(b);
1612N/A push(a);
1612N/A break;
1612N/A
1612N/A case Bytecodes::_getfield:
1612N/A if (!do_getfield())
1612N/A return false;
1612N/A break;
1612N/A case Bytecodes::_getstatic:
1612N/A if (!do_getstatic())
1612N/A return false;
1612N/A break;
1612N/A case Bytecodes::_putfield:
1612N/A if (!do_putfield())
1612N/A return false;
1612N/A break;
1612N/A
1612N/A case Bytecodes::_iadd:
1612N/A case Bytecodes::_isub:
1612N/A case Bytecodes::_imul:
1612N/A case Bytecodes::_iand:
1612N/A case Bytecodes::_ixor:
1612N/A case Bytecodes::_ishl:
1612N/A case Bytecodes::_ishr:
1612N/A case Bytecodes::_iushr:
1612N/A pop();
1612N/A pop();
1612N/A push(false);
1612N/A break;
1612N/A case Bytecodes::_ior:
1612N/A a = pop();
1612N/A b = pop();
1612N/A push(a && b);
1612N/A break;
1612N/A case Bytecodes::_idiv:
1612N/A case Bytecodes::_irem:
1612N/A if (!pop())
1612N/A return false;
1612N/A pop();
1612N/A push(false);
1612N/A break;
1612N/A case Bytecodes::_ineg:
1612N/A break;
1612N/A
1612N/A case Bytecodes::_ladd:
1612N/A case Bytecodes::_lsub:
1612N/A case Bytecodes::_lmul:
1612N/A case Bytecodes::_land:
1612N/A case Bytecodes::_lxor:
1612N/A pop();
1612N/A pop();
1612N/A pop();
1612N/A pop();
1612N/A push(false);
1612N/A push(false);
1612N/A break;
1612N/A case Bytecodes::_lor:
1612N/A a = pop();
1612N/A b = pop();
1612N/A push(a && b);
1612N/A break;
1612N/A case Bytecodes::_ldiv:
1612N/A case Bytecodes::_lrem:
1612N/A pop();
1612N/A if (!pop())
1612N/A return false;
1612N/A pop();
1612N/A pop();
1612N/A push(false);
1612N/A push(false);
1612N/A break;
1612N/A case Bytecodes::_lneg:
1612N/A break;
1612N/A case Bytecodes::_lshl:
1612N/A case Bytecodes::_lshr:
1612N/A case Bytecodes::_lushr:
1612N/A pop();
1612N/A pop();
1612N/A pop();
1612N/A push(false);
1612N/A push(false);
1612N/A break;
1612N/A
1612N/A case Bytecodes::_fadd:
1612N/A case Bytecodes::_fsub:
1612N/A case Bytecodes::_fmul:
1612N/A case Bytecodes::_fdiv:
1612N/A case Bytecodes::_frem:
1612N/A pop();
1612N/A pop();
1612N/A push(false);
1612N/A break;
1612N/A case Bytecodes::_fneg:
1612N/A break;
1612N/A
1612N/A case Bytecodes::_dadd:
1612N/A case Bytecodes::_dsub:
1612N/A case Bytecodes::_dmul:
1612N/A case Bytecodes::_ddiv:
1612N/A case Bytecodes::_drem:
1612N/A pop();
1612N/A pop();
1612N/A pop();
1612N/A pop();
1612N/A push(false);
1612N/A push(false);
1612N/A break;
1612N/A case Bytecodes::_dneg:
1612N/A break;
1612N/A
1612N/A case Bytecodes::_iinc:
1612N/A set_local(iter()->get_index(), false);
1612N/A break;
1612N/A
1612N/A case Bytecodes::_lcmp:
1612N/A pop();
1612N/A pop();
1612N/A pop();
1612N/A pop();
1612N/A push(false);
1612N/A break;
1612N/A
1612N/A case Bytecodes::_fcmpl:
1612N/A case Bytecodes::_fcmpg:
1612N/A pop();
1612N/A pop();
1612N/A push(false);
1612N/A break;
1612N/A
1612N/A case Bytecodes::_dcmpl:
1612N/A case Bytecodes::_dcmpg:
1612N/A pop();
1612N/A pop();
1612N/A pop();
1612N/A pop();
1612N/A push(false);
1612N/A break;
1612N/A
1612N/A case Bytecodes::_i2l:
1612N/A push(false);
1612N/A break;
1612N/A case Bytecodes::_i2f:
1612N/A pop();
1612N/A push(false);
1612N/A break;
1612N/A case Bytecodes::_i2d:
1612N/A pop();
1612N/A push(false);
1612N/A push(false);
1612N/A break;
1612N/A
1612N/A case Bytecodes::_l2i:
1612N/A case Bytecodes::_l2f:
1612N/A pop();
1612N/A pop();
1612N/A push(false);
1612N/A break;
1612N/A case Bytecodes::_l2d:
1612N/A pop();
1612N/A pop();
1612N/A push(false);
1612N/A push(false);
1612N/A break;
1612N/A
1612N/A case Bytecodes::_f2i:
1612N/A pop();
1612N/A push(false);
1612N/A break;
1612N/A case Bytecodes::_f2l:
1612N/A case Bytecodes::_f2d:
1612N/A pop();
1612N/A push(false);
1612N/A push(false);
1612N/A break;
1612N/A
1612N/A case Bytecodes::_d2i:
1612N/A case Bytecodes::_d2f:
1612N/A pop();
1612N/A pop();
1612N/A push(false);
1612N/A break;
1612N/A case Bytecodes::_d2l:
1612N/A pop();
1612N/A pop();
1612N/A push(false);
1612N/A push(false);
1612N/A break;
1612N/A
1612N/A case Bytecodes::_i2b:
1612N/A case Bytecodes::_i2c:
1612N/A case Bytecodes::_i2s:
1612N/A pop();
1612N/A push(false);
1612N/A break;
1612N/A
1612N/A case Bytecodes::_return:
1612N/A case Bytecodes::_ireturn:
1612N/A case Bytecodes::_lreturn:
1612N/A case Bytecodes::_freturn:
1612N/A case Bytecodes::_dreturn:
1612N/A case Bytecodes::_areturn:
1612N/A break;
1612N/A
1612N/A default:
1612N/A return false;
1612N/A }
1612N/A }
1612N/A
1612N/A return true;
1612N/A}
1612N/A
1612N/Avoid SharkInlinerHelper::initialize_for_check() {
1612N/A _locals = NEW_RESOURCE_ARRAY(bool, max_locals());
1612N/A _stack = NEW_RESOURCE_ARRAY(bool, max_stack());
1612N/A
1612N/A memset(_locals, 0, max_locals() * sizeof(bool));
1612N/A for (int i = 0; i < target()->arg_size(); i++) {
1612N/A SharkValue *arg = entry_state()->stack(target()->arg_size() - 1 - i);
1612N/A if (arg && arg->zero_checked())
1612N/A set_local(i, true);
1612N/A }
1612N/A
1612N/A _sp = _stack;
1612N/A}
1612N/A
1612N/Abool SharkInlinerHelper::do_field_access(bool is_get, bool is_field) {
1612N/A assert(is_get || is_field, "can't inline putstatic");
1612N/A
1612N/A // If the holder isn't linked then there isn't a lot we can do
1612N/A if (!target()->holder()->is_linked())
1612N/A return false;
1612N/A
1612N/A // Get the field
1612N/A bool will_link;
1612N/A ciField *field = iter()->get_field(will_link);
1612N/A if (!will_link)
1612N/A return false;
1612N/A
1612N/A // If the field is mismatched then an exception needs throwing
1612N/A if (is_field == field->is_static())
1612N/A return false;
1612N/A
1612N/A // Pop the value off the stack if necessary
1612N/A if (!is_get) {
1612N/A pop();
1612N/A if (field->type()->is_two_word())
1612N/A pop();
1612N/A }
1612N/A
1612N/A // Pop and null-check the receiver if necessary
1612N/A if (is_field) {
1612N/A if (!pop())
1612N/A return false;
1612N/A }
1612N/A
1612N/A // Push the result if necessary
1612N/A if (is_get) {
1612N/A bool result_pushed = false;
1612N/A if (field->is_constant()) {
1612N/A SharkConstant *sc = SharkConstant::for_field(iter());
1612N/A if (sc->is_loaded()) {
1612N/A push(sc->is_nonzero());
1612N/A result_pushed = true;
1612N/A }
1612N/A }
1612N/A
1612N/A if (!result_pushed)
1612N/A push(false);
1612N/A
1612N/A if (field->type()->is_two_word())
1612N/A push(false);
1612N/A }
1612N/A
1612N/A return true;
1612N/A}
1612N/A
1612N/Abool SharkInliner::attempt_inline(ciMethod *target, SharkState *state) {
1612N/A if (SharkIntrinsics::is_intrinsic(target)) {
1612N/A SharkIntrinsics::inline_intrinsic(target, state);
1612N/A return true;
1612N/A }
1612N/A
1612N/A if (may_be_inlinable(target)) {
1612N/A SharkInlinerHelper inliner(target, state);
1612N/A if (inliner.is_inlinable()) {
1612N/A inliner.do_inline();
1612N/A return true;
1612N/A }
1612N/A }
1612N/A return false;
1612N/A}