hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp
author kvn
Fri, 12 Feb 2010 10:34:11 -0800
changeset 4897 d5dd3852bf8d
parent 4568 d18b14983811
child 5229 54a4606c7383
permissions -rw-r--r--
6926048: Improve Zero performance Summary: Make Zero figure out result types in a similar way to C++ interpreter implementation. Reviewed-by: kvn Contributed-by: 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.
4897
d5dd3852bf8d 6926048: Improve Zero performance
kvn
parents: 4568
diff changeset
     3
 * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc.
4013
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
4897
d5dd3852bf8d 6926048: Improve Zero performance
kvn
parents: 4568
diff changeset
   148
      result_slots = type2size[result_type_of(method)];
4013
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) {
4897
d5dd3852bf8d 6926048: Improve Zero performance
kvn
parents: 4568
diff changeset
   397
    BasicType type = result_type_of(method);
d5dd3852bf8d 6926048: Improve Zero performance
kvn
parents: 4568
diff changeset
   398
    stack->set_sp(stack->sp() - type2size[type]);
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   399
4897
d5dd3852bf8d 6926048: Improve Zero performance
kvn
parents: 4568
diff changeset
   400
    switch (type) {
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   401
    case T_VOID:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   402
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   403
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   404
    case T_BOOLEAN:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   405
#ifndef VM_LITTLE_ENDIAN
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   406
      result[0] <<= (BitsPerWord - BitsPerByte);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   407
#endif
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   408
      SET_LOCALS_INT(*(jboolean *) result != 0, 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   409
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   410
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   411
    case T_CHAR:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   412
#ifndef VM_LITTLE_ENDIAN
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   413
      result[0] <<= (BitsPerWord - BitsPerShort);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   414
#endif
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   415
      SET_LOCALS_INT(*(jchar *) result, 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   416
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   417
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   418
    case T_BYTE:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   419
#ifndef VM_LITTLE_ENDIAN
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   420
      result[0] <<= (BitsPerWord - BitsPerByte);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   421
#endif
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   422
      SET_LOCALS_INT(*(jbyte *) result, 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   423
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   424
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   425
    case T_SHORT:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   426
#ifndef VM_LITTLE_ENDIAN
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   427
      result[0] <<= (BitsPerWord - BitsPerShort);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   428
#endif
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   429
      SET_LOCALS_INT(*(jshort *) result, 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   430
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   431
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   432
    case T_INT:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   433
#ifndef VM_LITTLE_ENDIAN
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   434
      result[0] <<= (BitsPerWord - BitsPerInt);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   435
#endif
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   436
      SET_LOCALS_INT(*(jint *) result, 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   437
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   438
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   439
    case T_LONG:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   440
      SET_LOCALS_LONG(*(jlong *) result, 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   441
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   442
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   443
    case T_FLOAT:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   444
      SET_LOCALS_FLOAT(*(jfloat *) result, 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   445
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   446
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   447
    case T_DOUBLE:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   448
      SET_LOCALS_DOUBLE(*(jdouble *) result, 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   449
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   450
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   451
    case T_OBJECT:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   452
    case T_ARRAY:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   453
      SET_LOCALS_OBJECT(istate->oop_temp(), 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   454
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   455
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   456
    default:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   457
      ShouldNotReachHere();
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
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   462
void CppInterpreter::accessor_entry(methodOop method, intptr_t UNUSED, TRAPS) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   463
  JavaThread *thread = (JavaThread *) THREAD;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   464
  ZeroStack *stack = thread->zero_stack();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   465
  intptr_t *locals = stack->sp();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   466
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   467
  // Drop into the slow path if we need a safepoint check
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   468
  if (SafepointSynchronize::do_call_back()) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   469
    normal_entry(method, 0, THREAD);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   470
    return;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   471
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   472
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   473
  // Load the object pointer and drop into the slow path
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   474
  // if we have a NullPointerException
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   475
  oop object = LOCALS_OBJECT(0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   476
  if (object == NULL) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   477
    normal_entry(method, 0, THREAD);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   478
    return;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   479
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   480
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   481
  // Read the field index from the bytecode, which looks like this:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   482
  //  0:  aload_0
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   483
  //  1:  getfield
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   484
  //  2:    index
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   485
  //  3:    index
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   486
  //  4:  ireturn/areturn
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   487
  // NB this is not raw bytecode: index is in machine order
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   488
  u1 *code = method->code_base();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   489
  assert(code[0] == Bytecodes::_aload_0 &&
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   490
         code[1] == Bytecodes::_getfield &&
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   491
         (code[4] == Bytecodes::_ireturn ||
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   492
          code[4] == Bytecodes::_areturn), "should do");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   493
  u2 index = Bytes::get_native_u2(&code[2]);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   494
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   495
  // Get the entry from the constant pool cache, and drop into
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   496
  // the slow path if it has not been resolved
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   497
  constantPoolCacheOop cache = method->constants()->cache();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   498
  ConstantPoolCacheEntry* entry = cache->entry_at(index);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   499
  if (!entry->is_resolved(Bytecodes::_getfield)) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   500
    normal_entry(method, 0, THREAD);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   501
    return;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   502
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   503
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   504
  // Get the result and push it onto the stack
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   505
  switch (entry->flag_state()) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   506
  case ltos:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   507
  case dtos:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   508
    if (stack->available_words() < 1) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   509
      Unimplemented();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   510
    }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   511
    stack->alloc(wordSize);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   512
    break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   513
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   514
  if (entry->is_volatile()) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   515
    switch (entry->flag_state()) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   516
    case ctos:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   517
      SET_LOCALS_INT(object->char_field_acquire(entry->f2()), 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   518
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   519
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   520
    case btos:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   521
      SET_LOCALS_INT(object->byte_field_acquire(entry->f2()), 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   522
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   523
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   524
    case stos:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   525
      SET_LOCALS_INT(object->short_field_acquire(entry->f2()), 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   526
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   527
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   528
    case itos:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   529
      SET_LOCALS_INT(object->int_field_acquire(entry->f2()), 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   530
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   531
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   532
    case ltos:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   533
      SET_LOCALS_LONG(object->long_field_acquire(entry->f2()), 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   534
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   535
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   536
    case ftos:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   537
      SET_LOCALS_FLOAT(object->float_field_acquire(entry->f2()), 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   538
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   539
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   540
    case dtos:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   541
      SET_LOCALS_DOUBLE(object->double_field_acquire(entry->f2()), 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   542
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   543
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   544
    case atos:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   545
      SET_LOCALS_OBJECT(object->obj_field_acquire(entry->f2()), 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   546
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   547
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   548
    default:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   549
      ShouldNotReachHere();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   550
    }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   551
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   552
  else {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   553
    switch (entry->flag_state()) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   554
    case ctos:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   555
      SET_LOCALS_INT(object->char_field(entry->f2()), 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   556
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   557
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   558
    case btos:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   559
      SET_LOCALS_INT(object->byte_field(entry->f2()), 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   560
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   561
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   562
    case stos:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   563
      SET_LOCALS_INT(object->short_field(entry->f2()), 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   564
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   565
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   566
    case itos:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   567
      SET_LOCALS_INT(object->int_field(entry->f2()), 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   568
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   569
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   570
    case ltos:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   571
      SET_LOCALS_LONG(object->long_field(entry->f2()), 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   572
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   573
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   574
    case ftos:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   575
      SET_LOCALS_FLOAT(object->float_field(entry->f2()), 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   576
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   577
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   578
    case dtos:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   579
      SET_LOCALS_DOUBLE(object->double_field(entry->f2()), 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   580
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   581
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   582
    case atos:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   583
      SET_LOCALS_OBJECT(object->obj_field(entry->f2()), 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   584
      break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   585
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   586
    default:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   587
      ShouldNotReachHere();
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
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   592
void CppInterpreter::empty_entry(methodOop method, intptr_t UNUSED, TRAPS) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   593
  JavaThread *thread = (JavaThread *) THREAD;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   594
  ZeroStack *stack = thread->zero_stack();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   595
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   596
  // Drop into the slow path if we need a safepoint check
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   597
  if (SafepointSynchronize::do_call_back()) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   598
    normal_entry(method, 0, THREAD);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   599
    return;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   600
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   601
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   602
  // Pop our parameters
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   603
  stack->set_sp(stack->sp() + method->size_of_parameters());
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   604
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   605
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   606
bool CppInterpreter::stack_overflow_imminent(JavaThread *thread) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   607
  // How is the ABI stack?
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   608
  address stack_top = thread->stack_base() - thread->stack_size();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   609
  int free_stack = os::current_stack_pointer() - stack_top;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   610
  if (free_stack < StackShadowPages * os::vm_page_size()) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   611
    return true;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   612
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   613
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   614
  // How is the Zero stack?
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   615
  // Throwing a StackOverflowError involves a VM call, which means
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   616
  // we need a frame on the stack.  We should be checking here to
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   617
  // ensure that methods we call have enough room to install the
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   618
  // largest possible frame, but that's more than twice the size
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   619
  // of the entire Zero stack we get by default, so we just check
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   620
  // we have *some* space instead...
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   621
  free_stack = thread->zero_stack()->available_words() * wordSize;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   622
  if (free_stack < StackShadowPages * os::vm_page_size()) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   623
    return true;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   624
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   625
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   626
  return false;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   627
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   628
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   629
InterpreterFrame *InterpreterFrame::build(ZeroStack*       stack,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   630
                                          const methodOop  method,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   631
                                          JavaThread*      thread) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   632
  int monitor_words =
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   633
    method->is_synchronized() ? frame::interpreter_frame_monitor_size() : 0;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   634
  int stack_words = method->is_native() ? 0 : method->max_stack();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   635
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   636
  if (header_words + monitor_words + stack_words > stack->available_words()) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   637
    Unimplemented();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   638
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   639
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   640
  intptr_t *locals;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   641
  if (method->is_native())
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   642
    locals = stack->sp() + (method->size_of_parameters() - 1);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   643
  else
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   644
    locals = stack->sp() + (method->max_locals() - 1);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   645
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   646
  stack->push(0); // next_frame, filled in later
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   647
  intptr_t *fp = stack->sp();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   648
  assert(fp - stack->sp() == next_frame_off, "should be");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   649
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   650
  stack->push(INTERPRETER_FRAME);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   651
  assert(fp - stack->sp() == frame_type_off, "should be");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   652
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   653
  interpreterState istate =
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   654
    (interpreterState) stack->alloc(sizeof(BytecodeInterpreter));
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   655
  assert(fp - stack->sp() == istate_off, "should be");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   656
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   657
  istate->set_locals(locals);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   658
  istate->set_method(method);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   659
  istate->set_self_link(istate);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   660
  istate->set_prev_link(NULL);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   661
  istate->set_thread(thread);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   662
  istate->set_bcp(method->is_native() ? NULL : method->code_base());
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   663
  istate->set_constants(method->constants()->cache());
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   664
  istate->set_msg(BytecodeInterpreter::method_entry);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   665
  istate->set_oop_temp(NULL);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   666
  istate->set_mdx(NULL);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   667
  istate->set_callee(NULL);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   668
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   669
  istate->set_monitor_base((BasicObjectLock *) stack->sp());
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   670
  if (method->is_synchronized()) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   671
    BasicObjectLock *monitor =
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   672
      (BasicObjectLock *) stack->alloc(monitor_words * wordSize);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   673
    oop object;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   674
    if (method->is_static())
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   675
      object = method->constants()->pool_holder()->klass_part()->java_mirror();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   676
    else
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   677
      object = (oop) locals[0];
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   678
    monitor->set_obj(object);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   679
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   680
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   681
  istate->set_stack_base(stack->sp());
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   682
  istate->set_stack(stack->sp() - 1);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   683
  if (stack_words)
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   684
    stack->alloc(stack_words * wordSize);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   685
  istate->set_stack_limit(stack->sp() - 1);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   686
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   687
  return (InterpreterFrame *) fp;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   688
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   689
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   690
int AbstractInterpreter::BasicType_as_index(BasicType type) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   691
  int i = 0;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   692
  switch (type) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   693
    case T_BOOLEAN: i = 0; break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   694
    case T_CHAR   : i = 1; break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   695
    case T_BYTE   : i = 2; break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   696
    case T_SHORT  : i = 3; break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   697
    case T_INT    : i = 4; break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   698
    case T_LONG   : i = 5; break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   699
    case T_VOID   : i = 6; break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   700
    case T_FLOAT  : i = 7; break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   701
    case T_DOUBLE : i = 8; break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   702
    case T_OBJECT : i = 9; break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   703
    case T_ARRAY  : i = 9; break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   704
    default       : ShouldNotReachHere();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   705
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   706
  assert(0 <= i && i < AbstractInterpreter::number_of_result_handlers,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   707
         "index out of bounds");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   708
  return i;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   709
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   710
4897
d5dd3852bf8d 6926048: Improve Zero performance
kvn
parents: 4568
diff changeset
   711
BasicType CppInterpreter::result_type_of(methodOop method) {
d5dd3852bf8d 6926048: Improve Zero performance
kvn
parents: 4568
diff changeset
   712
  BasicType t;
d5dd3852bf8d 6926048: Improve Zero performance
kvn
parents: 4568
diff changeset
   713
  switch (method->result_index()) {
d5dd3852bf8d 6926048: Improve Zero performance
kvn
parents: 4568
diff changeset
   714
    case 0 : t = T_BOOLEAN; break;
d5dd3852bf8d 6926048: Improve Zero performance
kvn
parents: 4568
diff changeset
   715
    case 1 : t = T_CHAR;    break;
d5dd3852bf8d 6926048: Improve Zero performance
kvn
parents: 4568
diff changeset
   716
    case 2 : t = T_BYTE;    break;
d5dd3852bf8d 6926048: Improve Zero performance
kvn
parents: 4568
diff changeset
   717
    case 3 : t = T_SHORT;   break;
d5dd3852bf8d 6926048: Improve Zero performance
kvn
parents: 4568
diff changeset
   718
    case 4 : t = T_INT;     break;
d5dd3852bf8d 6926048: Improve Zero performance
kvn
parents: 4568
diff changeset
   719
    case 5 : t = T_LONG;    break;
d5dd3852bf8d 6926048: Improve Zero performance
kvn
parents: 4568
diff changeset
   720
    case 6 : t = T_VOID;    break;
d5dd3852bf8d 6926048: Improve Zero performance
kvn
parents: 4568
diff changeset
   721
    case 7 : t = T_FLOAT;   break;
d5dd3852bf8d 6926048: Improve Zero performance
kvn
parents: 4568
diff changeset
   722
    case 8 : t = T_DOUBLE;  break;
d5dd3852bf8d 6926048: Improve Zero performance
kvn
parents: 4568
diff changeset
   723
    case 9 : t = T_OBJECT;  break;
d5dd3852bf8d 6926048: Improve Zero performance
kvn
parents: 4568
diff changeset
   724
    default: ShouldNotReachHere();
d5dd3852bf8d 6926048: Improve Zero performance
kvn
parents: 4568
diff changeset
   725
  }
d5dd3852bf8d 6926048: Improve Zero performance
kvn
parents: 4568
diff changeset
   726
  assert(AbstractInterpreter::BasicType_as_index(t) == method->result_index(),
d5dd3852bf8d 6926048: Improve Zero performance
kvn
parents: 4568
diff changeset
   727
         "out of step with AbstractInterpreter::BasicType_as_index");
d5dd3852bf8d 6926048: Improve Zero performance
kvn
parents: 4568
diff changeset
   728
  return t;
d5dd3852bf8d 6926048: Improve Zero performance
kvn
parents: 4568
diff changeset
   729
}
d5dd3852bf8d 6926048: Improve Zero performance
kvn
parents: 4568
diff changeset
   730
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   731
address InterpreterGenerator::generate_empty_entry() {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   732
  if (!UseFastEmptyMethods)
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   733
    return NULL;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   734
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   735
  return generate_entry((address) CppInterpreter::empty_entry);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   736
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   737
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   738
address InterpreterGenerator::generate_accessor_entry() {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   739
  if (!UseFastAccessorMethods)
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   740
    return NULL;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   741
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   742
  return generate_entry((address) CppInterpreter::accessor_entry);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   743
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   744
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   745
address InterpreterGenerator::generate_native_entry(bool synchronized) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   746
  assert(synchronized == false, "should be");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   747
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   748
  return generate_entry((address) CppInterpreter::native_entry);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   749
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   750
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   751
address InterpreterGenerator::generate_normal_entry(bool synchronized) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   752
  assert(synchronized == false, "should be");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   753
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   754
  return generate_entry((address) CppInterpreter::normal_entry);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   755
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   756
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   757
address AbstractInterpreterGenerator::generate_method_entry(
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   758
    AbstractInterpreter::MethodKind kind) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   759
  address entry_point = NULL;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   760
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   761
  switch (kind) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   762
  case Interpreter::zerolocals:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   763
  case Interpreter::zerolocals_synchronized:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   764
    break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   765
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   766
  case Interpreter::native:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   767
    entry_point = ((InterpreterGenerator*) this)->generate_native_entry(false);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   768
    break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   769
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   770
  case Interpreter::native_synchronized:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   771
    entry_point = ((InterpreterGenerator*) this)->generate_native_entry(false);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   772
    break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   773
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   774
  case Interpreter::empty:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   775
    entry_point = ((InterpreterGenerator*) this)->generate_empty_entry();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   776
    break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   777
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   778
  case Interpreter::accessor:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   779
    entry_point = ((InterpreterGenerator*) this)->generate_accessor_entry();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   780
    break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   781
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   782
  case Interpreter::abstract:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   783
    entry_point = ((InterpreterGenerator*) this)->generate_abstract_entry();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   784
    break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   785
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   786
  case Interpreter::method_handle:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   787
    entry_point = ((InterpreterGenerator*) this)->generate_method_handle_entry();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   788
    break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   789
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   790
  case Interpreter::java_lang_math_sin:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   791
  case Interpreter::java_lang_math_cos:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   792
  case Interpreter::java_lang_math_tan:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   793
  case Interpreter::java_lang_math_abs:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   794
  case Interpreter::java_lang_math_log:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   795
  case Interpreter::java_lang_math_log10:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   796
  case Interpreter::java_lang_math_sqrt:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   797
    entry_point = ((InterpreterGenerator*) this)->generate_math_entry(kind);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   798
    break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   799
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   800
  default:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   801
    ShouldNotReachHere();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   802
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   803
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   804
  if (entry_point == NULL)
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   805
    entry_point = ((InterpreterGenerator*) this)->generate_normal_entry(false);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   806
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   807
  return entry_point;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   808
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   809
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   810
InterpreterGenerator::InterpreterGenerator(StubQueue* code)
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   811
 : CppInterpreterGenerator(code) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   812
   generate_all();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   813
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   814
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   815
// Deoptimization helpers
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   816
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   817
InterpreterFrame *InterpreterFrame::build(ZeroStack* stack, int size) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   818
  int size_in_words = size >> LogBytesPerWord;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   819
  assert(size_in_words * wordSize == size, "unaligned");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   820
  assert(size_in_words >= header_words, "too small");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   821
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   822
  if (size_in_words > stack->available_words()) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   823
    Unimplemented();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   824
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   825
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   826
  stack->push(0); // next_frame, filled in later
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   827
  intptr_t *fp = stack->sp();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   828
  assert(fp - stack->sp() == next_frame_off, "should be");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   829
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   830
  stack->push(INTERPRETER_FRAME);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   831
  assert(fp - stack->sp() == frame_type_off, "should be");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   832
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   833
  interpreterState istate =
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   834
    (interpreterState) stack->alloc(sizeof(BytecodeInterpreter));
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   835
  assert(fp - stack->sp() == istate_off, "should be");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   836
  istate->set_self_link(NULL); // mark invalid
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   837
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   838
  stack->alloc((size_in_words - header_words) * wordSize);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   839
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   840
  return (InterpreterFrame *) fp;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   841
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   842
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   843
int AbstractInterpreter::layout_activation(methodOop method,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   844
                                           int       tempcount,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   845
                                           int       popframe_extra_args,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   846
                                           int       moncount,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   847
                                           int       callee_param_count,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   848
                                           int       callee_locals,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   849
                                           frame*    caller,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   850
                                           frame*    interpreter_frame,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   851
                                           bool      is_top_frame) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   852
  assert(popframe_extra_args == 0, "what to do?");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   853
  assert(!is_top_frame || (!callee_locals && !callee_param_count),
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   854
         "top frame should have no caller")
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   855
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   856
  // This code must exactly match what InterpreterFrame::build
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   857
  // does (the full InterpreterFrame::build, that is, not the
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   858
  // one that creates empty frames for the deoptimizer).
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   859
  //
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   860
  // If interpreter_frame is not NULL then it will be filled in.
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   861
  // It's size is determined by a previous call to this method,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   862
  // so it should be correct.
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   863
  //
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   864
  // Note that tempcount is the current size of the expression
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   865
  // stack.  For top most frames we will allocate a full sized
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   866
  // expression stack and not the trimmed version that non-top
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   867
  // frames have.
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   868
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   869
  int header_words        = InterpreterFrame::header_words;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   870
  int monitor_words       = moncount * frame::interpreter_frame_monitor_size();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   871
  int stack_words         = is_top_frame ? method->max_stack() : tempcount;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   872
  int callee_extra_locals = callee_locals - callee_param_count;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   873
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   874
  if (interpreter_frame) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   875
    intptr_t *locals        = interpreter_frame->sp() + method->max_locals();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   876
    interpreterState istate = interpreter_frame->get_interpreterState();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   877
    intptr_t *monitor_base  = (intptr_t*) istate;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   878
    intptr_t *stack_base    = monitor_base - monitor_words;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   879
    intptr_t *stack         = stack_base - tempcount - 1;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   880
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   881
    BytecodeInterpreter::layout_interpreterState(istate,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   882
                                                 caller,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   883
                                                 NULL,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   884
                                                 method,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   885
                                                 locals,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   886
                                                 stack,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   887
                                                 stack_base,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   888
                                                 monitor_base,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   889
                                                 NULL,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   890
                                                 is_top_frame);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   891
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   892
  return header_words + monitor_words + stack_words + callee_extra_locals;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   893
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   894
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   895
void BytecodeInterpreter::layout_interpreterState(interpreterState istate,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   896
                                                  frame*    caller,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   897
                                                  frame*    current,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   898
                                                  methodOop method,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   899
                                                  intptr_t* locals,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   900
                                                  intptr_t* stack,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   901
                                                  intptr_t* stack_base,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   902
                                                  intptr_t* monitor_base,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   903
                                                  intptr_t* frame_bottom,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   904
                                                  bool      is_top_frame) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   905
  istate->set_locals(locals);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   906
  istate->set_method(method);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   907
  istate->set_self_link(istate);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   908
  istate->set_prev_link(NULL);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   909
  // thread will be set by a hacky repurposing of frame::patch_pc()
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   910
  // bcp will be set by vframeArrayElement::unpack_on_stack()
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   911
  istate->set_constants(method->constants()->cache());
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   912
  istate->set_msg(BytecodeInterpreter::method_resume);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   913
  istate->set_bcp_advance(0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   914
  istate->set_oop_temp(NULL);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   915
  istate->set_mdx(NULL);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   916
  if (caller->is_interpreted_frame()) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   917
    interpreterState prev = caller->get_interpreterState();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   918
    prev->set_callee(method);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   919
    if (*prev->bcp() == Bytecodes::_invokeinterface)
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   920
      prev->set_bcp_advance(5);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   921
    else
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   922
      prev->set_bcp_advance(3);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   923
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   924
  istate->set_callee(NULL);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   925
  istate->set_monitor_base((BasicObjectLock *) monitor_base);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   926
  istate->set_stack_base(stack_base);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   927
  istate->set_stack(stack);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   928
  istate->set_stack_limit(stack_base - method->max_stack() - 1);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   929
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   930
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   931
address CppInterpreter::return_entry(TosState state, int length) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   932
  ShouldNotCallThis();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   933
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   934
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   935
address CppInterpreter::deopt_entry(TosState state, int length) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   936
  return NULL;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   937
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   938
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   939
// Helper for (runtime) stack overflow checks
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   940
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   941
int AbstractInterpreter::size_top_interpreter_activation(methodOop method) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   942
  return 0;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   943
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   944
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   945
// Helper for figuring out if frames are interpreter frames
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   946
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   947
bool CppInterpreter::contains(address pc) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   948
#ifdef PRODUCT
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   949
  ShouldNotCallThis();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   950
#else
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   951
  return false; // make frame::print_value_on work
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   952
#endif // !PRODUCT
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   953
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   954
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   955
// Result handlers and convertors
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   956
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   957
address CppInterpreterGenerator::generate_result_handler_for(
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   958
    BasicType type) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   959
  assembler()->advance(1);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   960
  return ShouldNotCallThisStub();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   961
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   962
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   963
address CppInterpreterGenerator::generate_tosca_to_stack_converter(
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   964
    BasicType type) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   965
  assembler()->advance(1);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   966
  return ShouldNotCallThisStub();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   967
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   968
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   969
address CppInterpreterGenerator::generate_stack_to_stack_converter(
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   970
    BasicType type) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   971
  assembler()->advance(1);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   972
  return ShouldNotCallThisStub();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   973
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   974
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   975
address CppInterpreterGenerator::generate_stack_to_native_abi_converter(
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   976
    BasicType type) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   977
  assembler()->advance(1);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   978
  return ShouldNotCallThisStub();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   979
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   980
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   981
#endif // CC_INTERP