hotspot/src/share/vm/interpreter/cppInterpreter.cpp
author jprovino
Mon, 04 Apr 2016 12:57:48 -0400
changeset 37248 11a660dbbb8e
parent 37161 e881f320966e
permissions -rw-r--r--
8132524: Missing includes to resourceArea.hpp Summary: Files that use ResourceMark are missing the include of resourceArea.hpp Reviewed-by: tschatzl, jwilhelm
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
35479
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents: 35214
diff changeset
     2
 * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 2534
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 2534
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 2534
diff changeset
    21
 * questions.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    25
#include "precompiled.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    26
#include "interpreter/bytecodeInterpreter.hpp"
35214
d86005e0b4c2 8074457: Remove the non-Zero CPP Interpreter
coleenp
parents: 25950
diff changeset
    27
#include "interpreter/cppInterpreterGenerator.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    28
#include "interpreter/interpreter.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    29
#include "interpreter/interpreterRuntime.hpp"
37248
11a660dbbb8e 8132524: Missing includes to resourceArea.hpp
jprovino
parents: 37161
diff changeset
    30
#include "memory/resourceArea.hpp"
37161
e881f320966e 8150015: Integrate TraceTime with Unified Logging more seamlessly
rehn
parents: 36178
diff changeset
    31
#include "runtime/timerTrace.hpp"
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
#ifdef CC_INTERP
35214
d86005e0b4c2 8074457: Remove the non-Zero CPP Interpreter
coleenp
parents: 25950
diff changeset
    34
d86005e0b4c2 8074457: Remove the non-Zero CPP Interpreter
coleenp
parents: 25950
diff changeset
    35
#ifdef ZERO
d86005e0b4c2 8074457: Remove the non-Zero CPP Interpreter
coleenp
parents: 25950
diff changeset
    36
# include "entry_zero.hpp"
d86005e0b4c2 8074457: Remove the non-Zero CPP Interpreter
coleenp
parents: 25950
diff changeset
    37
#else
d86005e0b4c2 8074457: Remove the non-Zero CPP Interpreter
coleenp
parents: 25950
diff changeset
    38
#error "Only Zero CppInterpreter is supported"
d86005e0b4c2 8074457: Remove the non-Zero CPP Interpreter
coleenp
parents: 25950
diff changeset
    39
#endif
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
void CppInterpreter::initialize() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
  if (_code != NULL) return;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
  AbstractInterpreter::initialize();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
  // generate interpreter
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
  { ResourceMark rm;
37161
e881f320966e 8150015: Integrate TraceTime with Unified Logging more seamlessly
rehn
parents: 36178
diff changeset
    47
    TraceTime timer("Interpreter generation", TRACETIME_LOG(Info, startuptime));
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
    int code_size = InterpreterCodeSize;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
    NOT_PRODUCT(code_size *= 4;)  // debug uses extra interpreter code space
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
    _code = new StubQueue(new InterpreterCodeletInterface, code_size, NULL,
35479
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents: 35214
diff changeset
    51
                           "Interpreter");
35214
d86005e0b4c2 8074457: Remove the non-Zero CPP Interpreter
coleenp
parents: 25950
diff changeset
    52
    CppInterpreterGenerator g(_code);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
    if (PrintInterpreter) print();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
  // Allow c++ interpreter to do one initialization now that switches are set, etc.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
  BytecodeInterpreter start_msg(BytecodeInterpreter::initialize);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
  if (JvmtiExport::can_post_interpreter_events())
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
    BytecodeInterpreter::runWithChecks(&start_msg);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
  else
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
    BytecodeInterpreter::run(&start_msg);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
35214
d86005e0b4c2 8074457: Remove the non-Zero CPP Interpreter
coleenp
parents: 25950
diff changeset
    65
void CppInterpreter::invoke_method(Method* method, address entry_point, TRAPS) {
d86005e0b4c2 8074457: Remove the non-Zero CPP Interpreter
coleenp
parents: 25950
diff changeset
    66
  ((ZeroEntry *) entry_point)->invoke(method, THREAD);
d86005e0b4c2 8074457: Remove the non-Zero CPP Interpreter
coleenp
parents: 25950
diff changeset
    67
}
d86005e0b4c2 8074457: Remove the non-Zero CPP Interpreter
coleenp
parents: 25950
diff changeset
    68
d86005e0b4c2 8074457: Remove the non-Zero CPP Interpreter
coleenp
parents: 25950
diff changeset
    69
void CppInterpreter::invoke_osr(Method* method,
d86005e0b4c2 8074457: Remove the non-Zero CPP Interpreter
coleenp
parents: 25950
diff changeset
    70
                                address   entry_point,
d86005e0b4c2 8074457: Remove the non-Zero CPP Interpreter
coleenp
parents: 25950
diff changeset
    71
                                address   osr_buf,
d86005e0b4c2 8074457: Remove the non-Zero CPP Interpreter
coleenp
parents: 25950
diff changeset
    72
                                TRAPS) {
d86005e0b4c2 8074457: Remove the non-Zero CPP Interpreter
coleenp
parents: 25950
diff changeset
    73
  ((ZeroEntry *) entry_point)->invoke_osr(method, osr_buf, THREAD);
d86005e0b4c2 8074457: Remove the non-Zero CPP Interpreter
coleenp
parents: 25950
diff changeset
    74
}
d86005e0b4c2 8074457: Remove the non-Zero CPP Interpreter
coleenp
parents: 25950
diff changeset
    75
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
35214
d86005e0b4c2 8074457: Remove the non-Zero CPP Interpreter
coleenp
parents: 25950
diff changeset
    78
InterpreterCodelet* CppInterpreter::codelet_containing(address pc) {
d86005e0b4c2 8074457: Remove the non-Zero CPP Interpreter
coleenp
parents: 25950
diff changeset
    79
  // FIXME: I'm pretty sure _code is null and this is never called, which is why it's copied.
d86005e0b4c2 8074457: Remove the non-Zero CPP Interpreter
coleenp
parents: 25950
diff changeset
    80
  return (InterpreterCodelet*)_code->stub_containing(pc);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
#endif // CC_INTERP