hotspot/src/cpu/x86/vm/interpreterGenerator_x86.cpp
author goetz
Mon, 29 Jun 2015 15:30:55 +0200
changeset 31590 427d073af867
parent 25950 b5c40ed1d349
child 33070 54f3f085b165
permissions -rw-r--r--
8086069: Adapt runtime calls to recent intrinsics to pass ints as long Summary: Remove CCallingConventionRequiresIntsAsLongs from shared code and push functionality to native wrapper. Less optimal but more flexible. Reviewed-by: jrose, kvn
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
25950
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
     1
/*
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
     2
 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
     4
 *
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
     7
 * published by the Free Software Foundation.
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
     8
 *
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    13
 * accompanied this code).
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    14
 *
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    18
 *
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    21
 * questions.
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    22
 *
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    23
 */
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    24
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    25
#include "precompiled.hpp"
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    26
#include "asm/macroAssembler.hpp"
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    27
#include "interpreter/interpreter.hpp"
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    28
#include "interpreter/interpreterGenerator.hpp"
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    29
#include "interpreter/interpreterRuntime.hpp"
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    30
#include "interpreter/interp_masm.hpp"
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    31
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    32
#define __ _masm->
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    33
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    34
// Jump into normal path for accessor and empty entry to jump to normal entry
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    35
// The "fast" optimization don't update compilation count therefore can disable inlining
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    36
// for these functions that should be inlined.
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    37
address InterpreterGenerator::generate_jump_to_normal_entry(void) {
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    38
  address entry_point = __ pc();
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    39
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    40
  assert(Interpreter::entry_for_kind(Interpreter::zerolocals) != NULL, "should already be generated");
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    41
  __ jump(RuntimeAddress(Interpreter::entry_for_kind(Interpreter::zerolocals)));
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    42
  return entry_point;
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    43
}
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    44
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    45
// Abstract method entry
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    46
// Attempt to execute abstract method. Throw exception
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    47
address InterpreterGenerator::generate_abstract_entry(void) {
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    48
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    49
  address entry_point = __ pc();
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    50
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    51
  // abstract method entry
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    52
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    53
#ifndef CC_INTERP
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    54
  //  pop return address, reset last_sp to NULL
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    55
  __ empty_expression_stack();
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    56
  __ restore_bcp();      // rsi must be correct for exception handler   (was destroyed)
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    57
  __ restore_locals();   // make sure locals pointer is correct as well (was destroyed)
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    58
#endif
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    59
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    60
  // throw exception
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    61
  __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError));
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    62
  // the call_VM checks for exception, so we should never return here.
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    63
  __ should_not_reach_here();
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    64
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    65
  return entry_point;
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents:
diff changeset
    66
}