1 /* |
1 /* |
2 * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
51 // [return pc ] |
51 // [return pc ] |
52 // [oop temp ] (only for native calls) |
52 // [oop temp ] (only for native calls) |
53 // [locals and parameters ] |
53 // [locals and parameters ] |
54 // <- sender sp |
54 // <- sender sp |
55 // ------------------------------ Asm interpreter ---------------------------------------- |
55 // ------------------------------ Asm interpreter ---------------------------------------- |
56 |
|
57 // ------------------------------ C++ interpreter ---------------------------------------- |
|
58 // |
|
59 // Layout of C++ interpreter frame: (While executing in BytecodeInterpreter::run) |
|
60 // |
|
61 // <- SP (current esp/rsp) |
|
62 // [local variables ] BytecodeInterpreter::run local variables |
|
63 // ... BytecodeInterpreter::run local variables |
|
64 // [local variables ] BytecodeInterpreter::run local variables |
|
65 // [old frame pointer ] fp [ BytecodeInterpreter::run's ebp/rbp ] |
|
66 // [return pc ] (return to frame manager) |
|
67 // [interpreter_state* ] (arg to BytecodeInterpreter::run) -------------- |
|
68 // [expression stack ] <- last_Java_sp | |
|
69 // [... ] * <- interpreter_state.stack | |
|
70 // [expression stack ] * <- interpreter_state.stack_base | |
|
71 // [monitors ] \ | |
|
72 // ... | monitor block size | |
|
73 // [monitors ] / <- interpreter_state.monitor_base | |
|
74 // [struct interpretState ] <-----------------------------------------| |
|
75 // [return pc ] (return to callee of frame manager [1] |
|
76 // [locals and parameters ] |
|
77 // <- sender sp |
|
78 |
|
79 // [1] When the C++ interpreter calls a new method it returns to the frame |
|
80 // manager which allocates a new frame on the stack. In that case there |
|
81 // is no real callee of this newly allocated frame. The frame manager is |
|
82 // aware of the additional frame(s) and will pop them as nested calls |
|
83 // complete. However, to make it look good in the debugger the frame |
|
84 // manager actually installs a dummy pc pointing to RecursiveInterpreterActivation |
|
85 // with a fake interpreter_state* parameter to make it easy to debug |
|
86 // nested calls. |
|
87 |
|
88 // Note that contrary to the layout for the assembly interpreter the |
|
89 // expression stack allocated for the C++ interpreter is full sized. |
|
90 // However this is not as bad as it seems as the interpreter frame_manager |
|
91 // will truncate the unused space on successive method calls. |
|
92 // |
|
93 // ------------------------------ C++ interpreter ---------------------------------------- |
|
94 |
56 |
95 public: |
57 public: |
96 enum { |
58 enum { |
97 pc_return_offset = 0, |
59 pc_return_offset = 0, |
98 // All frames |
60 // All frames |