hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp
author never
Tue, 05 Jan 2010 11:14:54 -0800
changeset 4568 d18b14983811
parent 4448 d6ec2737186c
child 4897 d5dd3852bf8d
permissions -rw-r--r--
6908267: Zero fails to unlock synchronized native methods on exception Reviewed-by: never Contributed-by: Gary Benson <gbenson@redhat.com>
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
     1
/*
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
     2
 * Copyright 2003-2007 Sun Microsystems, Inc.  All Rights Reserved.
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
     3
 * Copyright 2007, 2008, 2009 Red Hat, Inc.
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
     4
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
     5
 *
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
     6
 * This code is free software; you can redistribute it and/or modify it
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
     7
 * under the terms of the GNU General Public License version 2 only, as
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
     8
 * published by the Free Software Foundation.
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
     9
 *
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    10
 * This code is distributed in the hope that it will be useful, but WITHOUT
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    11
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    12
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    13
 * version 2 for more details (a copy is included in the LICENSE file that
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    14
 * accompanied this code).
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    15
 *
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    16
 * You should have received a copy of the GNU General Public License version
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    17
 * 2 along with this work; if not, write to the Free Software Foundation,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    18
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    19
 *
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    20
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    21
 * CA 95054 USA or visit www.sun.com if you need additional information or
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    22
 * have any questions.
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    23
 *
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    24
 */
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    25
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    26
#include "incls/_precompiled.incl"
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    27
#include "incls/_cppInterpreter_zero.cpp.incl"
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    28
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    29
#ifdef CC_INTERP
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    30
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    31
#define fixup_after_potential_safepoint()       \
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    32
  method = istate->method()
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    33
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    34
#define CALL_VM_NOCHECK(func)                   \
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    35
  thread->set_last_Java_frame();                \
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    36
  func;                                         \
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    37
  thread->reset_last_Java_frame();              \
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    38
  fixup_after_potential_safepoint()
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    39
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    40
void CppInterpreter::normal_entry(methodOop method, intptr_t UNUSED, TRAPS) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    41
  JavaThread *thread = (JavaThread *) THREAD;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    42
  ZeroStack *stack = thread->zero_stack();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    43
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    44
  // Adjust the caller's stack frame to accomodate any additional
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    45
  // local variables we have contiguously with our parameters.
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    46
  int extra_locals = method->max_locals() - method->size_of_parameters();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    47
  if (extra_locals > 0) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    48
    if (extra_locals > stack->available_words()) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    49
      Unimplemented();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    50
    }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    51
    for (int i = 0; i < extra_locals; i++)
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    52
      stack->push(0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    53
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    54
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    55
  // Allocate and initialize our frame.
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    56
  InterpreterFrame *frame = InterpreterFrame::build(stack, method, thread);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    57
  thread->push_zero_frame(frame);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    58
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    59
  // Execute those bytecodes!
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    60
  main_loop(0, THREAD);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    61
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    62
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    63
void CppInterpreter::main_loop(int recurse, TRAPS) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    64
  JavaThread *thread = (JavaThread *) THREAD;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    65
  ZeroStack *stack = thread->zero_stack();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    66
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    67
  // If we are entering from a deopt we may need to call
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    68
  // ourself a few times in order to get to our frame.
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    69
  if (recurse)
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    70
    main_loop(recurse - 1, THREAD);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    71
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    72
  InterpreterFrame *frame = thread->top_zero_frame()->as_interpreter_frame();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    73
  interpreterState istate = frame->interpreter_state();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    74
  methodOop method = istate->method();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    75
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    76
  intptr_t *result = NULL;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    77
  int result_slots = 0;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    78
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    79
  // Check we're not about to run out of stack
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    80
  if (stack_overflow_imminent(thread)) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    81
    CALL_VM_NOCHECK(InterpreterRuntime::throw_StackOverflowError(thread));
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    82
    goto unwind_and_return;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    83
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    84
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    85
  while (true) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    86
    // We can set up the frame anchor with everything we want at
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    87
    // this point as we are thread_in_Java and no safepoints can
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    88
    // occur until we go to vm mode.  We do have to clear flags
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    89
    // on return from vm but that is it.
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    90
    thread->set_last_Java_frame();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    91
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    92
    // Call the interpreter
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    93
    if (JvmtiExport::can_post_interpreter_events())
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    94
      BytecodeInterpreter::runWithChecks(istate);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    95
    else
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    96
      BytecodeInterpreter::run(istate);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    97
    fixup_after_potential_safepoint();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    98
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    99
    // Clear the frame anchor
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   100
    thread->reset_last_Java_frame();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   101
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   102
    // Examine the message from the interpreter to decide what to do
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   103
    if (istate->msg() == BytecodeInterpreter::call_method) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   104
      methodOop callee = istate->callee();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   105
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   106
      // Trim back the stack to put the parameters at the top
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   107
      stack->set_sp(istate->stack() + 1);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   108
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   109
      // Make the call
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   110
      Interpreter::invoke_method(callee, istate->callee_entry_point(), THREAD);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   111
      fixup_after_potential_safepoint();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   112
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   113
      // Convert the result
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   114
      istate->set_stack(stack->sp() - 1);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   115
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   116
      // Restore the stack
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   117
      stack->set_sp(istate->stack_limit() + 1);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   118
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   119
      // Resume the interpreter
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   120
      istate->set_msg(BytecodeInterpreter::method_resume);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   121
    }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   122
    else if (istate->msg() == BytecodeInterpreter::more_monitors) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   123
      int monitor_words = frame::interpreter_frame_monitor_size();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   124
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   125
      // Allocate the space
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   126
      if (monitor_words > stack->available_words()) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   127
        Unimplemented();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   128
      }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   129
      stack->alloc(monitor_words * wordSize);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   130
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   131
      // Move the expression stack contents
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   132
      for (intptr_t *p = istate->stack() + 1; p < istate->stack_base(); p++)
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   133
        *(p - monitor_words) = *p;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   134
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   135
      // Move the expression stack pointers
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   136
      istate->set_stack_limit(istate->stack_limit() - monitor_words);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   137
      istate->set_stack(istate->stack() - monitor_words);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   138
      istate->set_stack_base(istate->stack_base() - monitor_words);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   139
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   140
      // Zero the new monitor so the interpreter can find it.
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   141
      ((BasicObjectLock *) istate->stack_base())->set_obj(NULL);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   142
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   143
      // Resume the interpreter
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   144
      istate->set_msg(BytecodeInterpreter::got_monitors);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   145
    }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   146
    else if (istate->msg() == BytecodeInterpreter::return_from_method) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   147
      // Copy the result into the caller's frame
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   148
      result_slots = type2size[method->result_type()];
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   149
      assert(result_slots >= 0 && result_slots <= 2, "what?");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   150
      result = istate->stack() + result_slots;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   151
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   152
    }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   153
    else if (istate->msg() == BytecodeInterpreter::throwing_exception) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   154
      assert(HAS_PENDING_EXCEPTION, "should do");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   155
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   156
    }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   157
    else if (istate->msg() == BytecodeInterpreter::do_osr) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   158
      // Unwind the current frame
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   159
      thread->pop_zero_frame();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   160
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   161
      // Remove any extension of the previous frame
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   162
      int extra_locals = method->max_locals() - method->size_of_parameters();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   163
      stack->set_sp(stack->sp() + extra_locals);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   164
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   165
      // Jump into the OSR method
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   166
      Interpreter::invoke_osr(
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   167
        method, istate->osr_entry(), istate->osr_buf(), THREAD);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   168
      return;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   169
    }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   170
    else {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   171
      ShouldNotReachHere();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   172
    }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   173
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   174
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   175
 unwind_and_return:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   176
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   177
  // Unwind the current frame
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   178
  thread->pop_zero_frame();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   179
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   180
  // Pop our local variables
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   181
  stack->set_sp(stack->sp() + method->max_locals());
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   182
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   183
  // Push our result
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   184
  for (int i = 0; i < result_slots; i++)
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   185
    stack->push(result[-i]);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   186
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   187
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   188
void CppInterpreter::native_entry(methodOop method, intptr_t UNUSED, TRAPS) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   189
  // Make sure method is native and not abstract
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   190
  assert(method->is_native() && !method->is_abstract(), "should be");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   191
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   192
  JavaThread *thread = (JavaThread *) THREAD;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   193
  ZeroStack *stack = thread->zero_stack();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   194
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   195
  // Allocate and initialize our frame
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   196
  InterpreterFrame *frame = InterpreterFrame::build(stack, method, thread);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   197
  thread->push_zero_frame(frame);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   198
  interpreterState istate = frame->interpreter_state();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   199
  intptr_t *locals = istate->locals();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   200
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   201
  // Check we're not about to run out of stack
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   202
  if (stack_overflow_imminent(thread)) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   203
    CALL_VM_NOCHECK(InterpreterRuntime::throw_StackOverflowError(thread));
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   204
    goto unwind_and_return;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   205
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   206
4448
d6ec2737186c 6896043: first round of zero fixes
twisti
parents: 4013
diff changeset
   207
  // Update the invocation counter
d6ec2737186c 6896043: first round of zero fixes
twisti
parents: 4013
diff changeset
   208
  if ((UseCompiler || CountCompiledCalls) && !method->is_synchronized()) {
d6ec2737186c 6896043: first round of zero fixes
twisti
parents: 4013
diff changeset
   209
    thread->set_do_not_unlock();
d6ec2737186c 6896043: first round of zero fixes
twisti
parents: 4013
diff changeset
   210
    InvocationCounter *counter = method->invocation_counter();
d6ec2737186c 6896043: first round of zero fixes
twisti
parents: 4013
diff changeset
   211
    counter->increment();
d6ec2737186c 6896043: first round of zero fixes
twisti
parents: 4013
diff changeset
   212
    if (counter->reached_InvocationLimit()) {
d6ec2737186c 6896043: first round of zero fixes
twisti
parents: 4013
diff changeset
   213
      CALL_VM_NOCHECK(
d6ec2737186c 6896043: first round of zero fixes
twisti
parents: 4013
diff changeset
   214
        InterpreterRuntime::frequency_counter_overflow(thread, NULL));
d6ec2737186c 6896043: first round of zero fixes
twisti
parents: 4013
diff changeset
   215
      if (HAS_PENDING_EXCEPTION)
d6ec2737186c 6896043: first round of zero fixes
twisti
parents: 4013
diff changeset
   216
        goto unwind_and_return;
d6ec2737186c 6896043: first round of zero fixes
twisti
parents: 4013
diff changeset
   217
    }
d6ec2737186c 6896043: first round of zero fixes
twisti
parents: 4013
diff changeset
   218
    thread->clr_do_not_unlock();
d6ec2737186c 6896043: first round of zero fixes
twisti
parents: 4013
diff changeset
   219
  }
d6ec2737186c 6896043: first round of zero fixes
twisti
parents: 4013
diff changeset
   220
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   221
  // Lock if necessary
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   222
  BasicObjectLock *monitor;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   223
  monitor = NULL;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   224
  if (method->is_synchronized()) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   225
    monitor = (BasicObjectLock*) istate->stack_base();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   226
    oop lockee = monitor->obj();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   227
    markOop disp = lockee->mark()->set_unlocked();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   228
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   229
    monitor->lock()->set_displaced_header(disp);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   230
    if (Atomic::cmpxchg_ptr(monitor, lockee->mark_addr(), disp) != disp) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   231
      if (thread->is_lock_owned((address) disp->clear_lock_bits())) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   232
        monitor->lock()->set_displaced_header(NULL);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   233
      }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   234
      else {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   235
        CALL_VM_NOCHECK(InterpreterRuntime::monitorenter(thread, monitor));
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   236
        if (HAS_PENDING_EXCEPTION)
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   237
          goto unwind_and_return;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   238
      }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   239
    }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   240
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   241
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   242
  // Get the signature handler
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   243
  InterpreterRuntime::SignatureHandler *handler; {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   244
    address handlerAddr = method->signature_handler();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   245
    if (handlerAddr == NULL) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   246
      CALL_VM_NOCHECK(InterpreterRuntime::prepare_native_call(thread, method));
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   247
      if (HAS_PENDING_EXCEPTION)
4568
d18b14983811 6908267: Zero fails to unlock synchronized native methods on exception
never
parents: 4448
diff changeset
   248
        goto unlock_unwind_and_return;
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   249
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   250
      handlerAddr = method->signature_handler();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   251
      assert(handlerAddr != NULL, "eh?");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   252
    }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   253
    if (handlerAddr == (address) InterpreterRuntime::slow_signature_handler) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   254
      CALL_VM_NOCHECK(handlerAddr =
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   255
        InterpreterRuntime::slow_signature_handler(thread, method, NULL,NULL));
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   256
      if (HAS_PENDING_EXCEPTION)
4568
d18b14983811 6908267: Zero fails to unlock synchronized native methods on exception
never
parents: 4448
diff changeset
   257
        goto unlock_unwind_and_return;
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   258
    }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   259
    handler = \
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   260
      InterpreterRuntime::SignatureHandler::from_handlerAddr(handlerAddr);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   261
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   262
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   263
  // Get the native function entry point
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   264
  address function;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   265
  function = method->native_function();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   266
  assert(function != NULL, "should be set if signature handler is");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   267
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   268
  // Build the argument list
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   269
  if (handler->argument_count() * 2 > stack->available_words()) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   270
    Unimplemented();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   271
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   272
  void **arguments;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   273
  void *mirror; {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   274
    arguments =
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   275
      (void **) stack->alloc(handler->argument_count() * sizeof(void **));
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   276
    void **dst = arguments;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   277
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   278
    void *env = thread->jni_environment();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   279
    *(dst++) = &env;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   280
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   281
    if (method->is_static()) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   282
      istate->set_oop_temp(
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   283
        method->constants()->pool_holder()->klass_part()->java_mirror());
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   284
      mirror = istate->oop_temp_addr();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   285
      *(dst++) = &mirror;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   286
    }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   287
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   288
    intptr_t *src = locals;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   289
    for (int i = dst - arguments; i < handler->argument_count(); i++) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   290
      ffi_type *type = handler->argument_type(i);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   291
      if (type == &ffi_type_pointer) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   292
        if (*src) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   293
          stack->push((intptr_t) src);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   294
          *(dst++) = stack->sp();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   295
        }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   296
        else {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   297
          *(dst++) = src;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   298
        }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   299
        src--;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   300
      }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   301
      else if (type->size == 4) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   302
        *(dst++) = src--;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   303
      }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   304
      else if (type->size == 8) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   305
        src--;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   306
        *(dst++) = src--;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   307
      }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   308
      else {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   309
        ShouldNotReachHere();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   310
      }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   311
    }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   312
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   313
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   314
  // Set up the Java frame anchor
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   315
  thread->set_last_Java_frame();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   316
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   317
  // Change the thread state to _thread_in_native
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   318
  ThreadStateTransition::transition_from_java(thread, _thread_in_native);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   319
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   320
  // Make the call
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   321
  intptr_t result[4 - LogBytesPerWord];
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   322
  ffi_call(handler->cif(), (void (*)()) function, result, arguments);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   323
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   324
  // Change the thread state back to _thread_in_Java.
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   325
  // ThreadStateTransition::transition_from_native() cannot be used
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   326
  // here because it does not check for asynchronous exceptions.
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   327
  // We have to manage the transition ourself.
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   328
  thread->set_thread_state(_thread_in_native_trans);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   329
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   330
  // Make sure new state is visible in the GC thread
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   331
  if (os::is_MP()) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   332
    if (UseMembar) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   333
      OrderAccess::fence();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   334
    }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   335
    else {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   336
      InterfaceSupport::serialize_memory(thread);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   337
    }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   338
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   339
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   340
  // Handle safepoint operations, pending suspend requests,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   341
  // and pending asynchronous exceptions.
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   342
  if (SafepointSynchronize::do_call_back() ||
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   343
      thread->has_special_condition_for_native_trans()) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   344
    JavaThread::check_special_condition_for_native_trans(thread);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   345
    CHECK_UNHANDLED_OOPS_ONLY(thread->clear_unhandled_oops());
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   346
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   347
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   348
  // Finally we can change the thread state to _thread_in_Java.
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   349
  thread->set_thread_state(_thread_in_Java);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   350
  fixup_after_potential_safepoint();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   351
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   352
  // Clear the frame anchor
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   353
  thread->reset_last_Java_frame();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   354
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   355
  // If the result was an oop then unbox it and store it in
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   356
  // oop_temp where the garbage collector can see it before
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   357
  // we release the handle it might be protected by.
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   358
  if (handler->result_type() == &ffi_type_pointer) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   359
    if (result[0])
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   360
      istate->set_oop_temp(*(oop *) result[0]);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   361
    else
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   362
      istate->set_oop_temp(NULL);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   363
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   364
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   365
  // Reset handle block
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   366
  thread->active_handles()->clear();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   367
4568
d18b14983811 6908267: Zero fails to unlock synchronized native methods on exception
never
parents: 4448
diff changeset
   368
 unlock_unwind_and_return:
d18b14983811 6908267: Zero fails to unlock synchronized native methods on exception
never
parents: 4448
diff changeset
   369
d18b14983811 6908267: Zero fails to unlock synchronized native methods on exception
never
parents: 4448
diff changeset
   370
  // Unlock if necessary
d18b14983811 6908267: Zero fails to unlock synchronized native methods on exception
never
parents: 4448
diff changeset
   371
  if (monitor) {
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   372
    BasicLock *lock = monitor->lock();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   373
    markOop header = lock->displaced_header();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   374
    oop rcvr = monitor->obj();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   375
    monitor->set_obj(NULL);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   376
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   377
    if (header != NULL) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   378
      if (Atomic::cmpxchg_ptr(header, rcvr->mark_addr(), lock) != lock) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   379
        monitor->set_obj(rcvr); {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   380
          HandleMark hm(thread);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   381
          CALL_VM_NOCHECK(InterpreterRuntime::monitorexit(thread, monitor));
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   382
        }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   383
      }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   384
    }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   385
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   386
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   387
 unwind_and_return:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   388
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   389
  // Unwind the current activation
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   390
  thread->pop_zero_frame();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   391
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   392
  // Pop our parameters
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   393
  stack->set_sp(stack->sp() + method->size_of_parameters());
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   394
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   395
  // Push our result
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   396
  if (!HAS_PENDING_EXCEPTION) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   397
    stack->set_sp(stack->sp() - type2size[method->result_type()]);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   398
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   399
    switch (method->result_type()) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   400
    case T_VOID:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   401
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   402
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   403
    case T_BOOLEAN:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   404
#ifndef VM_LITTLE_ENDIAN
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   405
      result[0] <<= (BitsPerWord - BitsPerByte);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   406
#endif
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   407
      SET_LOCALS_INT(*(jboolean *) result != 0, 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   408
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   409
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   410
    case T_CHAR:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   411
#ifndef VM_LITTLE_ENDIAN
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   412
      result[0] <<= (BitsPerWord - BitsPerShort);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   413
#endif
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   414
      SET_LOCALS_INT(*(jchar *) result, 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   415
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   416
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   417
    case T_BYTE:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   418
#ifndef VM_LITTLE_ENDIAN
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   419
      result[0] <<= (BitsPerWord - BitsPerByte);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   420
#endif
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   421
      SET_LOCALS_INT(*(jbyte *) result, 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   422
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   423
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   424
    case T_SHORT:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   425
#ifndef VM_LITTLE_ENDIAN
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   426
      result[0] <<= (BitsPerWord - BitsPerShort);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   427
#endif
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   428
      SET_LOCALS_INT(*(jshort *) result, 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   429
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   430
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   431
    case T_INT:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   432
#ifndef VM_LITTLE_ENDIAN
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   433
      result[0] <<= (BitsPerWord - BitsPerInt);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   434
#endif
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   435
      SET_LOCALS_INT(*(jint *) result, 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   436
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   437
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   438
    case T_LONG:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   439
      SET_LOCALS_LONG(*(jlong *) result, 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   440
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   441
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   442
    case T_FLOAT:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   443
      SET_LOCALS_FLOAT(*(jfloat *) result, 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   444
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   445
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   446
    case T_DOUBLE:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   447
      SET_LOCALS_DOUBLE(*(jdouble *) result, 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   448
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   449
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   450
    case T_OBJECT:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   451
    case T_ARRAY:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   452
      SET_LOCALS_OBJECT(istate->oop_temp(), 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   453
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   454
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   455
    default:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   456
      ShouldNotReachHere();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   457
    }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   458
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   459
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   460
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   461
void CppInterpreter::accessor_entry(methodOop method, intptr_t UNUSED, TRAPS) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   462
  JavaThread *thread = (JavaThread *) THREAD;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   463
  ZeroStack *stack = thread->zero_stack();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   464
  intptr_t *locals = stack->sp();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   465
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   466
  // Drop into the slow path if we need a safepoint check
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   467
  if (SafepointSynchronize::do_call_back()) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   468
    normal_entry(method, 0, THREAD);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   469
    return;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   470
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   471
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   472
  // Load the object pointer and drop into the slow path
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   473
  // if we have a NullPointerException
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   474
  oop object = LOCALS_OBJECT(0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   475
  if (object == NULL) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   476
    normal_entry(method, 0, THREAD);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   477
    return;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   478
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   479
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   480
  // Read the field index from the bytecode, which looks like this:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   481
  //  0:  aload_0
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   482
  //  1:  getfield
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   483
  //  2:    index
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   484
  //  3:    index
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   485
  //  4:  ireturn/areturn
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   486
  // NB this is not raw bytecode: index is in machine order
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   487
  u1 *code = method->code_base();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   488
  assert(code[0] == Bytecodes::_aload_0 &&
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   489
         code[1] == Bytecodes::_getfield &&
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   490
         (code[4] == Bytecodes::_ireturn ||
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   491
          code[4] == Bytecodes::_areturn), "should do");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   492
  u2 index = Bytes::get_native_u2(&code[2]);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   493
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   494
  // Get the entry from the constant pool cache, and drop into
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   495
  // the slow path if it has not been resolved
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   496
  constantPoolCacheOop cache = method->constants()->cache();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   497
  ConstantPoolCacheEntry* entry = cache->entry_at(index);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   498
  if (!entry->is_resolved(Bytecodes::_getfield)) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   499
    normal_entry(method, 0, THREAD);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   500
    return;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   501
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   502
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   503
  // Get the result and push it onto the stack
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   504
  switch (entry->flag_state()) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   505
  case ltos:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   506
  case dtos:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   507
    if (stack->available_words() < 1) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   508
      Unimplemented();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   509
    }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   510
    stack->alloc(wordSize);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   511
    break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   512
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   513
  if (entry->is_volatile()) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   514
    switch (entry->flag_state()) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   515
    case ctos:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   516
      SET_LOCALS_INT(object->char_field_acquire(entry->f2()), 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   517
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   518
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   519
    case btos:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   520
      SET_LOCALS_INT(object->byte_field_acquire(entry->f2()), 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   521
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   522
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   523
    case stos:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   524
      SET_LOCALS_INT(object->short_field_acquire(entry->f2()), 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   525
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   526
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   527
    case itos:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   528
      SET_LOCALS_INT(object->int_field_acquire(entry->f2()), 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   529
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   530
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   531
    case ltos:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   532
      SET_LOCALS_LONG(object->long_field_acquire(entry->f2()), 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   533
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   534
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   535
    case ftos:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   536
      SET_LOCALS_FLOAT(object->float_field_acquire(entry->f2()), 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   537
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   538
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   539
    case dtos:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   540
      SET_LOCALS_DOUBLE(object->double_field_acquire(entry->f2()), 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   541
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   542
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   543
    case atos:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   544
      SET_LOCALS_OBJECT(object->obj_field_acquire(entry->f2()), 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   545
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   546
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   547
    default:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   548
      ShouldNotReachHere();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   549
    }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   550
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   551
  else {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   552
    switch (entry->flag_state()) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   553
    case ctos:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   554
      SET_LOCALS_INT(object->char_field(entry->f2()), 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   555
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   556
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   557
    case btos:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   558
      SET_LOCALS_INT(object->byte_field(entry->f2()), 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   559
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   560
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   561
    case stos:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   562
      SET_LOCALS_INT(object->short_field(entry->f2()), 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   563
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   564
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   565
    case itos:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   566
      SET_LOCALS_INT(object->int_field(entry->f2()), 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   567
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   568
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   569
    case ltos:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   570
      SET_LOCALS_LONG(object->long_field(entry->f2()), 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   571
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   572
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   573
    case ftos:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   574
      SET_LOCALS_FLOAT(object->float_field(entry->f2()), 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   575
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   576
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   577
    case dtos:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   578
      SET_LOCALS_DOUBLE(object->double_field(entry->f2()), 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   579
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   580
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   581
    case atos:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   582
      SET_LOCALS_OBJECT(object->obj_field(entry->f2()), 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   583
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   584
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   585
    default:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   586
      ShouldNotReachHere();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   587
    }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   588
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   589
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   590
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   591
void CppInterpreter::empty_entry(methodOop method, intptr_t UNUSED, TRAPS) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   592
  JavaThread *thread = (JavaThread *) THREAD;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   593
  ZeroStack *stack = thread->zero_stack();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   594
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   595
  // Drop into the slow path if we need a safepoint check
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   596
  if (SafepointSynchronize::do_call_back()) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   597
    normal_entry(method, 0, THREAD);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   598
    return;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   599
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   600
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   601
  // Pop our parameters
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   602
  stack->set_sp(stack->sp() + method->size_of_parameters());
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   603
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   604
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   605
bool CppInterpreter::stack_overflow_imminent(JavaThread *thread) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   606
  // How is the ABI stack?
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   607
  address stack_top = thread->stack_base() - thread->stack_size();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   608
  int free_stack = os::current_stack_pointer() - stack_top;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   609
  if (free_stack < StackShadowPages * os::vm_page_size()) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   610
    return true;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   611
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   612
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   613
  // How is the Zero stack?
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   614
  // Throwing a StackOverflowError involves a VM call, which means
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   615
  // we need a frame on the stack.  We should be checking here to
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   616
  // ensure that methods we call have enough room to install the
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   617
  // largest possible frame, but that's more than twice the size
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   618
  // of the entire Zero stack we get by default, so we just check
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   619
  // we have *some* space instead...
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   620
  free_stack = thread->zero_stack()->available_words() * wordSize;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   621
  if (free_stack < StackShadowPages * os::vm_page_size()) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   622
    return true;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   623
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   624
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   625
  return false;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   626
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   627
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   628
InterpreterFrame *InterpreterFrame::build(ZeroStack*       stack,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   629
                                          const methodOop  method,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   630
                                          JavaThread*      thread) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   631
  int monitor_words =
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   632
    method->is_synchronized() ? frame::interpreter_frame_monitor_size() : 0;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   633
  int stack_words = method->is_native() ? 0 : method->max_stack();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   634
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   635
  if (header_words + monitor_words + stack_words > stack->available_words()) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   636
    Unimplemented();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   637
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   638
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   639
  intptr_t *locals;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   640
  if (method->is_native())
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   641
    locals = stack->sp() + (method->size_of_parameters() - 1);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   642
  else
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   643
    locals = stack->sp() + (method->max_locals() - 1);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   644
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   645
  stack->push(0); // next_frame, filled in later
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   646
  intptr_t *fp = stack->sp();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   647
  assert(fp - stack->sp() == next_frame_off, "should be");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   648
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   649
  stack->push(INTERPRETER_FRAME);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   650
  assert(fp - stack->sp() == frame_type_off, "should be");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   651
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   652
  interpreterState istate =
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   653
    (interpreterState) stack->alloc(sizeof(BytecodeInterpreter));
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   654
  assert(fp - stack->sp() == istate_off, "should be");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   655
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   656
  istate->set_locals(locals);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   657
  istate->set_method(method);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   658
  istate->set_self_link(istate);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   659
  istate->set_prev_link(NULL);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   660
  istate->set_thread(thread);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   661
  istate->set_bcp(method->is_native() ? NULL : method->code_base());
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   662
  istate->set_constants(method->constants()->cache());
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   663
  istate->set_msg(BytecodeInterpreter::method_entry);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   664
  istate->set_oop_temp(NULL);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   665
  istate->set_mdx(NULL);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   666
  istate->set_callee(NULL);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   667
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   668
  istate->set_monitor_base((BasicObjectLock *) stack->sp());
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   669
  if (method->is_synchronized()) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   670
    BasicObjectLock *monitor =
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   671
      (BasicObjectLock *) stack->alloc(monitor_words * wordSize);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   672
    oop object;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   673
    if (method->is_static())
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   674
      object = method->constants()->pool_holder()->klass_part()->java_mirror();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   675
    else
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   676
      object = (oop) locals[0];
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   677
    monitor->set_obj(object);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   678
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   679
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   680
  istate->set_stack_base(stack->sp());
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   681
  istate->set_stack(stack->sp() - 1);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   682
  if (stack_words)
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   683
    stack->alloc(stack_words * wordSize);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   684
  istate->set_stack_limit(stack->sp() - 1);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   685
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   686
  return (InterpreterFrame *) fp;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   687
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   688
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   689
int AbstractInterpreter::BasicType_as_index(BasicType type) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   690
  int i = 0;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   691
  switch (type) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   692
    case T_BOOLEAN: i = 0; break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   693
    case T_CHAR   : i = 1; break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   694
    case T_BYTE   : i = 2; break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   695
    case T_SHORT  : i = 3; break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   696
    case T_INT    : i = 4; break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   697
    case T_LONG   : i = 5; break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   698
    case T_VOID   : i = 6; break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   699
    case T_FLOAT  : i = 7; break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   700
    case T_DOUBLE : i = 8; break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   701
    case T_OBJECT : i = 9; break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   702
    case T_ARRAY  : i = 9; break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   703
    default       : ShouldNotReachHere();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   704
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   705
  assert(0 <= i && i < AbstractInterpreter::number_of_result_handlers,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   706
         "index out of bounds");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   707
  return i;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   708
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   709
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   710
address InterpreterGenerator::generate_empty_entry() {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   711
  if (!UseFastEmptyMethods)
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   712
    return NULL;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   713
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   714
  return generate_entry((address) CppInterpreter::empty_entry);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   715
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   716
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   717
address InterpreterGenerator::generate_accessor_entry() {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   718
  if (!UseFastAccessorMethods)
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   719
    return NULL;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   720
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   721
  return generate_entry((address) CppInterpreter::accessor_entry);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   722
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   723
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   724
address InterpreterGenerator::generate_native_entry(bool synchronized) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   725
  assert(synchronized == false, "should be");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   726
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   727
  return generate_entry((address) CppInterpreter::native_entry);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   728
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   729
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   730
address InterpreterGenerator::generate_normal_entry(bool synchronized) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   731
  assert(synchronized == false, "should be");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   732
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   733
  return generate_entry((address) CppInterpreter::normal_entry);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   734
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   735
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   736
address AbstractInterpreterGenerator::generate_method_entry(
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   737
    AbstractInterpreter::MethodKind kind) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   738
  address entry_point = NULL;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   739
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   740
  switch (kind) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   741
  case Interpreter::zerolocals:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   742
  case Interpreter::zerolocals_synchronized:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   743
    break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   744
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   745
  case Interpreter::native:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   746
    entry_point = ((InterpreterGenerator*) this)->generate_native_entry(false);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   747
    break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   748
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   749
  case Interpreter::native_synchronized:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   750
    entry_point = ((InterpreterGenerator*) this)->generate_native_entry(false);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   751
    break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   752
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   753
  case Interpreter::empty:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   754
    entry_point = ((InterpreterGenerator*) this)->generate_empty_entry();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   755
    break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   756
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   757
  case Interpreter::accessor:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   758
    entry_point = ((InterpreterGenerator*) this)->generate_accessor_entry();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   759
    break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   760
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   761
  case Interpreter::abstract:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   762
    entry_point = ((InterpreterGenerator*) this)->generate_abstract_entry();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   763
    break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   764
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   765
  case Interpreter::method_handle:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   766
    entry_point = ((InterpreterGenerator*) this)->generate_method_handle_entry();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   767
    break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   768
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   769
  case Interpreter::java_lang_math_sin:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   770
  case Interpreter::java_lang_math_cos:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   771
  case Interpreter::java_lang_math_tan:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   772
  case Interpreter::java_lang_math_abs:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   773
  case Interpreter::java_lang_math_log:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   774
  case Interpreter::java_lang_math_log10:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   775
  case Interpreter::java_lang_math_sqrt:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   776
    entry_point = ((InterpreterGenerator*) this)->generate_math_entry(kind);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   777
    break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   778
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   779
  default:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   780
    ShouldNotReachHere();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   781
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   782
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   783
  if (entry_point == NULL)
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   784
    entry_point = ((InterpreterGenerator*) this)->generate_normal_entry(false);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   785
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   786
  return entry_point;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   787
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   788
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   789
InterpreterGenerator::InterpreterGenerator(StubQueue* code)
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   790
 : CppInterpreterGenerator(code) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   791
   generate_all();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   792
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   793
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   794
// Deoptimization helpers
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   795
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   796
InterpreterFrame *InterpreterFrame::build(ZeroStack* stack, int size) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   797
  int size_in_words = size >> LogBytesPerWord;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   798
  assert(size_in_words * wordSize == size, "unaligned");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   799
  assert(size_in_words >= header_words, "too small");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   800
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   801
  if (size_in_words > stack->available_words()) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   802
    Unimplemented();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   803
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   804
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   805
  stack->push(0); // next_frame, filled in later
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   806
  intptr_t *fp = stack->sp();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   807
  assert(fp - stack->sp() == next_frame_off, "should be");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   808
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   809
  stack->push(INTERPRETER_FRAME);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   810
  assert(fp - stack->sp() == frame_type_off, "should be");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   811
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   812
  interpreterState istate =
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   813
    (interpreterState) stack->alloc(sizeof(BytecodeInterpreter));
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   814
  assert(fp - stack->sp() == istate_off, "should be");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   815
  istate->set_self_link(NULL); // mark invalid
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   816
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   817
  stack->alloc((size_in_words - header_words) * wordSize);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   818
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   819
  return (InterpreterFrame *) fp;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   820
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   821
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   822
int AbstractInterpreter::layout_activation(methodOop method,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   823
                                           int       tempcount,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   824
                                           int       popframe_extra_args,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   825
                                           int       moncount,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   826
                                           int       callee_param_count,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   827
                                           int       callee_locals,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   828
                                           frame*    caller,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   829
                                           frame*    interpreter_frame,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   830
                                           bool      is_top_frame) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   831
  assert(popframe_extra_args == 0, "what to do?");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   832
  assert(!is_top_frame || (!callee_locals && !callee_param_count),
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   833
         "top frame should have no caller")
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   834
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   835
  // This code must exactly match what InterpreterFrame::build
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   836
  // does (the full InterpreterFrame::build, that is, not the
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   837
  // one that creates empty frames for the deoptimizer).
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   838
  //
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   839
  // If interpreter_frame is not NULL then it will be filled in.
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   840
  // It's size is determined by a previous call to this method,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   841
  // so it should be correct.
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   842
  //
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   843
  // Note that tempcount is the current size of the expression
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   844
  // stack.  For top most frames we will allocate a full sized
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   845
  // expression stack and not the trimmed version that non-top
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   846
  // frames have.
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   847
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   848
  int header_words        = InterpreterFrame::header_words;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   849
  int monitor_words       = moncount * frame::interpreter_frame_monitor_size();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   850
  int stack_words         = is_top_frame ? method->max_stack() : tempcount;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   851
  int callee_extra_locals = callee_locals - callee_param_count;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   852
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   853
  if (interpreter_frame) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   854
    intptr_t *locals        = interpreter_frame->sp() + method->max_locals();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   855
    interpreterState istate = interpreter_frame->get_interpreterState();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   856
    intptr_t *monitor_base  = (intptr_t*) istate;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   857
    intptr_t *stack_base    = monitor_base - monitor_words;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   858
    intptr_t *stack         = stack_base - tempcount - 1;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   859
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   860
    BytecodeInterpreter::layout_interpreterState(istate,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   861
                                                 caller,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   862
                                                 NULL,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   863
                                                 method,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   864
                                                 locals,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   865
                                                 stack,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   866
                                                 stack_base,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   867
                                                 monitor_base,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   868
                                                 NULL,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   869
                                                 is_top_frame);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   870
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   871
  return header_words + monitor_words + stack_words + callee_extra_locals;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   872
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   873
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   874
void BytecodeInterpreter::layout_interpreterState(interpreterState istate,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   875
                                                  frame*    caller,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   876
                                                  frame*    current,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   877
                                                  methodOop method,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   878
                                                  intptr_t* locals,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   879
                                                  intptr_t* stack,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   880
                                                  intptr_t* stack_base,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   881
                                                  intptr_t* monitor_base,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   882
                                                  intptr_t* frame_bottom,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   883
                                                  bool      is_top_frame) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   884
  istate->set_locals(locals);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   885
  istate->set_method(method);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   886
  istate->set_self_link(istate);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   887
  istate->set_prev_link(NULL);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   888
  // thread will be set by a hacky repurposing of frame::patch_pc()
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   889
  // bcp will be set by vframeArrayElement::unpack_on_stack()
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   890
  istate->set_constants(method->constants()->cache());
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   891
  istate->set_msg(BytecodeInterpreter::method_resume);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   892
  istate->set_bcp_advance(0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   893
  istate->set_oop_temp(NULL);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   894
  istate->set_mdx(NULL);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   895
  if (caller->is_interpreted_frame()) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   896
    interpreterState prev = caller->get_interpreterState();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   897
    prev->set_callee(method);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   898
    if (*prev->bcp() == Bytecodes::_invokeinterface)
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   899
      prev->set_bcp_advance(5);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   900
    else
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   901
      prev->set_bcp_advance(3);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   902
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   903
  istate->set_callee(NULL);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   904
  istate->set_monitor_base((BasicObjectLock *) monitor_base);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   905
  istate->set_stack_base(stack_base);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   906
  istate->set_stack(stack);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   907
  istate->set_stack_limit(stack_base - method->max_stack() - 1);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   908
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   909
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   910
address CppInterpreter::return_entry(TosState state, int length) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   911
  ShouldNotCallThis();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   912
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   913
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   914
address CppInterpreter::deopt_entry(TosState state, int length) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   915
  return NULL;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   916
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   917
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   918
// Helper for (runtime) stack overflow checks
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   919
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   920
int AbstractInterpreter::size_top_interpreter_activation(methodOop method) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   921
  return 0;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   922
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   923
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   924
// Helper for figuring out if frames are interpreter frames
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   925
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   926
bool CppInterpreter::contains(address pc) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   927
#ifdef PRODUCT
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   928
  ShouldNotCallThis();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   929
#else
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   930
  return false; // make frame::print_value_on work
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   931
#endif // !PRODUCT
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   932
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   933
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   934
// Result handlers and convertors
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   935
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   936
address CppInterpreterGenerator::generate_result_handler_for(
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   937
    BasicType type) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   938
  assembler()->advance(1);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   939
  return ShouldNotCallThisStub();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   940
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   941
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   942
address CppInterpreterGenerator::generate_tosca_to_stack_converter(
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   943
    BasicType type) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   944
  assembler()->advance(1);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   945
  return ShouldNotCallThisStub();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   946
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   947
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   948
address CppInterpreterGenerator::generate_stack_to_stack_converter(
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   949
    BasicType type) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   950
  assembler()->advance(1);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   951
  return ShouldNotCallThisStub();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   952
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   953
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   954
address CppInterpreterGenerator::generate_stack_to_native_abi_converter(
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   955
    BasicType type) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   956
  assembler()->advance(1);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   957
  return ShouldNotCallThisStub();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   958
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   959
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   960
#endif // CC_INTERP