mterp.h revision 6740997e6934bbca27d5830a32352d82aabbd38b
11452bee8f06b9f76a333ddf4760e4beaa82f8099buzbee/* 21452bee8f06b9f76a333ddf4760e4beaa82f8099buzbee * Copyright (C) 2016 The Android Open Source Project 31452bee8f06b9f76a333ddf4760e4beaa82f8099buzbee * 41452bee8f06b9f76a333ddf4760e4beaa82f8099buzbee * Licensed under the Apache License, Version 2.0 (the "License"); 51452bee8f06b9f76a333ddf4760e4beaa82f8099buzbee * you may not use this file except in compliance with the License. 61452bee8f06b9f76a333ddf4760e4beaa82f8099buzbee * You may obtain a copy of the License at 71452bee8f06b9f76a333ddf4760e4beaa82f8099buzbee * 81452bee8f06b9f76a333ddf4760e4beaa82f8099buzbee * http://www.apache.org/licenses/LICENSE-2.0 91452bee8f06b9f76a333ddf4760e4beaa82f8099buzbee * 101452bee8f06b9f76a333ddf4760e4beaa82f8099buzbee * Unless required by applicable law or agreed to in writing, software 111452bee8f06b9f76a333ddf4760e4beaa82f8099buzbee * distributed under the License is distributed on an "AS IS" BASIS, 121452bee8f06b9f76a333ddf4760e4beaa82f8099buzbee * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 131452bee8f06b9f76a333ddf4760e4beaa82f8099buzbee * See the License for the specific language governing permissions and 141452bee8f06b9f76a333ddf4760e4beaa82f8099buzbee * limitations under the License. 151452bee8f06b9f76a333ddf4760e4beaa82f8099buzbee */ 161452bee8f06b9f76a333ddf4760e4beaa82f8099buzbee 171452bee8f06b9f76a333ddf4760e4beaa82f8099buzbee#ifndef ART_RUNTIME_INTERPRETER_MTERP_MTERP_H_ 181452bee8f06b9f76a333ddf4760e4beaa82f8099buzbee#define ART_RUNTIME_INTERPRETER_MTERP_MTERP_H_ 191452bee8f06b9f76a333ddf4760e4beaa82f8099buzbee 201452bee8f06b9f76a333ddf4760e4beaa82f8099buzbee/* 211452bee8f06b9f76a333ddf4760e4beaa82f8099buzbee * Mterp assembly handler bases 221452bee8f06b9f76a333ddf4760e4beaa82f8099buzbee */ 231452bee8f06b9f76a333ddf4760e4beaa82f8099buzbeeextern "C" void* artMterpAsmInstructionStart[]; 241452bee8f06b9f76a333ddf4760e4beaa82f8099buzbeeextern "C" void* artMterpAsmInstructionEnd[]; 251452bee8f06b9f76a333ddf4760e4beaa82f8099buzbeeextern "C" void* artMterpAsmAltInstructionStart[]; 261452bee8f06b9f76a333ddf4760e4beaa82f8099buzbeeextern "C" void* artMterpAsmAltInstructionEnd[]; 271452bee8f06b9f76a333ddf4760e4beaa82f8099buzbee 281452bee8f06b9f76a333ddf4760e4beaa82f8099buzbeenamespace art { 291452bee8f06b9f76a333ddf4760e4beaa82f8099buzbeenamespace interpreter { 301452bee8f06b9f76a333ddf4760e4beaa82f8099buzbee 311452bee8f06b9f76a333ddf4760e4beaa82f8099buzbeevoid InitMterpTls(Thread* self); 321452bee8f06b9f76a333ddf4760e4beaa82f8099buzbeevoid CheckMterpAsmConstants(); 336740997e6934bbca27d5830a32352d82aabbd38bAndreas Gampe 346740997e6934bbca27d5830a32352d82aabbd38bAndreas Gampe// The return type should be 'bool' but our assembly stubs expect 'bool' 356740997e6934bbca27d5830a32352d82aabbd38bAndreas Gampe// to be zero-extended to the whole register and that's broken on x86-64 366740997e6934bbca27d5830a32352d82aabbd38bAndreas Gampe// as a 'bool' is returned in 'al' and the rest of 'rax' is garbage. 376740997e6934bbca27d5830a32352d82aabbd38bAndreas Gampe// TODO: Fix mterp and stubs and revert this workaround. http://b/30232671 386740997e6934bbca27d5830a32352d82aabbd38bAndreas Gampeextern "C" size_t MterpShouldSwitchInterpreters(); 391452bee8f06b9f76a333ddf4760e4beaa82f8099buzbee 40d47fd907c898e0b8d4a4e50742f9b2f3003b906fBill Buzbee// Poison value for TestExportPC. If we segfault with this value, it means that a mterp 41d47fd907c898e0b8d4a4e50742f9b2f3003b906fBill Buzbee// handler for a recent opcode failed to export the Dalvik PC prior to a possible exit from 42d47fd907c898e0b8d4a4e50742f9b2f3003b906fBill Buzbee// the mterp environment. 43d47fd907c898e0b8d4a4e50742f9b2f3003b906fBill Buzbeeconstexpr uintptr_t kExportPCPoison = 0xdead00ff; 44d47fd907c898e0b8d4a4e50742f9b2f3003b906fBill Buzbee// Set true to enable poison testing of ExportPC. Uses Alt interpreter. 45d47fd907c898e0b8d4a4e50742f9b2f3003b906fBill Buzbeeconstexpr bool kTestExportPC = false; 46d47fd907c898e0b8d4a4e50742f9b2f3003b906fBill Buzbee 471452bee8f06b9f76a333ddf4760e4beaa82f8099buzbee} // namespace interpreter 481452bee8f06b9f76a333ddf4760e4beaa82f8099buzbee} // namespace art 491452bee8f06b9f76a333ddf4760e4beaa82f8099buzbee 501452bee8f06b9f76a333ddf4760e4beaa82f8099buzbee#endif // ART_RUNTIME_INTERPRETER_MTERP_MTERP_H_ 51