code_generator_x86.h revision 175dc732c80e6f2afd83209348124df349290ba8
1d4dd255db1d110ceb5551f6d95ff31fb57420994Nicolas Geoffray/*
2d4dd255db1d110ceb5551f6d95ff31fb57420994Nicolas Geoffray * Copyright (C) 2014 The Android Open Source Project
3d4dd255db1d110ceb5551f6d95ff31fb57420994Nicolas Geoffray *
4d4dd255db1d110ceb5551f6d95ff31fb57420994Nicolas Geoffray * Licensed under the Apache License, Version 2.0 (the "License");
5d4dd255db1d110ceb5551f6d95ff31fb57420994Nicolas Geoffray * you may not use this file except in compliance with the License.
6d4dd255db1d110ceb5551f6d95ff31fb57420994Nicolas Geoffray * You may obtain a copy of the License at
7d4dd255db1d110ceb5551f6d95ff31fb57420994Nicolas Geoffray *
8d4dd255db1d110ceb5551f6d95ff31fb57420994Nicolas Geoffray *      http://www.apache.org/licenses/LICENSE-2.0
9d4dd255db1d110ceb5551f6d95ff31fb57420994Nicolas Geoffray *
10d4dd255db1d110ceb5551f6d95ff31fb57420994Nicolas Geoffray * Unless required by applicable law or agreed to in writing, software
11d4dd255db1d110ceb5551f6d95ff31fb57420994Nicolas Geoffray * distributed under the License is distributed on an "AS IS" BASIS,
12d4dd255db1d110ceb5551f6d95ff31fb57420994Nicolas Geoffray * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13d4dd255db1d110ceb5551f6d95ff31fb57420994Nicolas Geoffray * See the License for the specific language governing permissions and
14d4dd255db1d110ceb5551f6d95ff31fb57420994Nicolas Geoffray * limitations under the License.
15d4dd255db1d110ceb5551f6d95ff31fb57420994Nicolas Geoffray */
16d4dd255db1d110ceb5551f6d95ff31fb57420994Nicolas Geoffray
17d4dd255db1d110ceb5551f6d95ff31fb57420994Nicolas Geoffray#ifndef ART_COMPILER_OPTIMIZING_CODE_GENERATOR_X86_H_
18d4dd255db1d110ceb5551f6d95ff31fb57420994Nicolas Geoffray#define ART_COMPILER_OPTIMIZING_CODE_GENERATOR_X86_H_
19d4dd255db1d110ceb5551f6d95ff31fb57420994Nicolas Geoffray
20d4dd255db1d110ceb5551f6d95ff31fb57420994Nicolas Geoffray#include "code_generator.h"
2152c489645b6e9ae33623f1ec24143cde5444906eCalin Juravle#include "dex/compiler_enums.h"
22cd6dffedf1bd8e6dfb3fb0c933551f9a90f7de3fCalin Juravle#include "driver/compiler_options.h"
23d4dd255db1d110ceb5551f6d95ff31fb57420994Nicolas Geoffray#include "nodes.h"
2486dbb9a12119273039ce272b41c809fa548b37b6Nicolas Geoffray#include "parallel_move_resolver.h"
25787c3076635cf117eb646c5a89a9014b2072fb44Nicolas Geoffray#include "utils/x86/assembler_x86.h"
26d4dd255db1d110ceb5551f6d95ff31fb57420994Nicolas Geoffray
27d4dd255db1d110ceb5551f6d95ff31fb57420994Nicolas Geoffraynamespace art {
28d4dd255db1d110ceb5551f6d95ff31fb57420994Nicolas Geoffraynamespace x86 {
29d4dd255db1d110ceb5551f6d95ff31fb57420994Nicolas Geoffray
3086a8d7afc7f00ff0f5ea7b8aaf4d50514250a4e6Nicolas Geoffray// Use a local definition to prevent copying mistakes.
3186a8d7afc7f00ff0f5ea7b8aaf4d50514250a4e6Nicolas Geoffraystatic constexpr size_t kX86WordSize = kX86PointerSize;
32707c809f661554713edfacf338365adca8dfd3a3Nicolas Geoffray
3301bc96d007b67fdb7fe349232a83e4b354ce3d08Nicolas Geoffrayclass CodeGeneratorX86;
34424f676379f2f872acd1478672022f19f3240fc1Nicolas Geoffrayclass SlowPathCodeX86;
3501bc96d007b67fdb7fe349232a83e4b354ce3d08Nicolas Geoffray
36a747a392fb5f88d2ecc4c6021edf9f1f6615ba16Nicolas Geoffraystatic constexpr Register kParameterCoreRegisters[] = { ECX, EDX, EBX };
37a747a392fb5f88d2ecc4c6021edf9f1f6615ba16Nicolas Geoffraystatic constexpr RegisterPair kParameterCorePairRegisters[] = { ECX_EDX, EDX_EBX };
38a747a392fb5f88d2ecc4c6021edf9f1f6615ba16Nicolas Geoffraystatic constexpr size_t kParameterCoreRegistersLength = arraysize(kParameterCoreRegisters);
39966c3ae95d3c699ee9fbdbccc1acdaaf02325fafMark P Mendellstatic constexpr XmmRegister kParameterFpuRegisters[] = { XMM0, XMM1, XMM2, XMM3 };
40966c3ae95d3c699ee9fbdbccc1acdaaf02325fafMark P Mendellstatic constexpr size_t kParameterFpuRegistersLength = arraysize(kParameterFpuRegisters);
41a747a392fb5f88d2ecc4c6021edf9f1f6615ba16Nicolas Geoffray
42d75948ac93a4a317feaf136cae78823071234ba5Nicolas Geoffraystatic constexpr Register kRuntimeParameterCoreRegisters[] = { EAX, ECX, EDX, EBX };
43d75948ac93a4a317feaf136cae78823071234ba5Nicolas Geoffraystatic constexpr size_t kRuntimeParameterCoreRegistersLength =
44d75948ac93a4a317feaf136cae78823071234ba5Nicolas Geoffray    arraysize(kRuntimeParameterCoreRegisters);
45d75948ac93a4a317feaf136cae78823071234ba5Nicolas Geoffraystatic constexpr XmmRegister kRuntimeParameterFpuRegisters[] = { XMM0, XMM1, XMM2, XMM3 };
46d75948ac93a4a317feaf136cae78823071234ba5Nicolas Geoffraystatic constexpr size_t kRuntimeParameterFpuRegistersLength =
47d75948ac93a4a317feaf136cae78823071234ba5Nicolas Geoffray    arraysize(kRuntimeParameterFpuRegisters);
48d75948ac93a4a317feaf136cae78823071234ba5Nicolas Geoffray
49d75948ac93a4a317feaf136cae78823071234ba5Nicolas Geoffrayclass InvokeRuntimeCallingConvention : public CallingConvention<Register, XmmRegister> {
50d75948ac93a4a317feaf136cae78823071234ba5Nicolas Geoffray public:
51d75948ac93a4a317feaf136cae78823071234ba5Nicolas Geoffray  InvokeRuntimeCallingConvention()
52d75948ac93a4a317feaf136cae78823071234ba5Nicolas Geoffray      : CallingConvention(kRuntimeParameterCoreRegisters,
53d75948ac93a4a317feaf136cae78823071234ba5Nicolas Geoffray                          kRuntimeParameterCoreRegistersLength,
54d75948ac93a4a317feaf136cae78823071234ba5Nicolas Geoffray                          kRuntimeParameterFpuRegisters,
55e401d146407d61eeb99f8d6176b2ac13c4df1e33Mathieu Chartier                          kRuntimeParameterFpuRegistersLength,
56e401d146407d61eeb99f8d6176b2ac13c4df1e33Mathieu Chartier                          kX86PointerSize) {}
57d75948ac93a4a317feaf136cae78823071234ba5Nicolas Geoffray
58d75948ac93a4a317feaf136cae78823071234ba5Nicolas Geoffray private:
59d75948ac93a4a317feaf136cae78823071234ba5Nicolas Geoffray  DISALLOW_COPY_AND_ASSIGN(InvokeRuntimeCallingConvention);
60d75948ac93a4a317feaf136cae78823071234ba5Nicolas Geoffray};
61d75948ac93a4a317feaf136cae78823071234ba5Nicolas Geoffray
627fb49da8ec62e8a10ed9419ade9f32c6b1174687Nicolas Geoffrayclass InvokeDexCallingConvention : public CallingConvention<Register, XmmRegister> {
63a747a392fb5f88d2ecc4c6021edf9f1f6615ba16Nicolas Geoffray public:
647fb49da8ec62e8a10ed9419ade9f32c6b1174687Nicolas Geoffray  InvokeDexCallingConvention() : CallingConvention(
657fb49da8ec62e8a10ed9419ade9f32c6b1174687Nicolas Geoffray      kParameterCoreRegisters,
667fb49da8ec62e8a10ed9419ade9f32c6b1174687Nicolas Geoffray      kParameterCoreRegistersLength,
677fb49da8ec62e8a10ed9419ade9f32c6b1174687Nicolas Geoffray      kParameterFpuRegisters,
68e401d146407d61eeb99f8d6176b2ac13c4df1e33Mathieu Chartier      kParameterFpuRegistersLength,
69e401d146407d61eeb99f8d6176b2ac13c4df1e33Mathieu Chartier      kX86PointerSize) {}
70a747a392fb5f88d2ecc4c6021edf9f1f6615ba16Nicolas Geoffray
71a747a392fb5f88d2ecc4c6021edf9f1f6615ba16Nicolas Geoffray  RegisterPair GetRegisterPairAt(size_t argument_index) {
72a747a392fb5f88d2ecc4c6021edf9f1f6615ba16Nicolas Geoffray    DCHECK_LT(argument_index + 1, GetNumberOfRegisters());
73a747a392fb5f88d2ecc4c6021edf9f1f6615ba16Nicolas Geoffray    return kParameterCorePairRegisters[argument_index];
74a747a392fb5f88d2ecc4c6021edf9f1f6615ba16Nicolas Geoffray  }
75a747a392fb5f88d2ecc4c6021edf9f1f6615ba16Nicolas Geoffray
76a747a392fb5f88d2ecc4c6021edf9f1f6615ba16Nicolas Geoffray private:
77a747a392fb5f88d2ecc4c6021edf9f1f6615ba16Nicolas Geoffray  DISALLOW_COPY_AND_ASSIGN(InvokeDexCallingConvention);
78a747a392fb5f88d2ecc4c6021edf9f1f6615ba16Nicolas Geoffray};
79a747a392fb5f88d2ecc4c6021edf9f1f6615ba16Nicolas Geoffray
802d27c8e338af7262dbd4aaa66127bb8fa1758b86Roland Levillainclass InvokeDexCallingConventionVisitorX86 : public InvokeDexCallingConventionVisitor {
81a747a392fb5f88d2ecc4c6021edf9f1f6615ba16Nicolas Geoffray public:
822d27c8e338af7262dbd4aaa66127bb8fa1758b86Roland Levillain  InvokeDexCallingConventionVisitorX86() {}
832d27c8e338af7262dbd4aaa66127bb8fa1758b86Roland Levillain  virtual ~InvokeDexCallingConventionVisitorX86() {}
84a747a392fb5f88d2ecc4c6021edf9f1f6615ba16Nicolas Geoffray
852d27c8e338af7262dbd4aaa66127bb8fa1758b86Roland Levillain  Location GetNextLocation(Primitive::Type type) OVERRIDE;
86fd88f16100cceafbfde1b4f095f17e89444d6fa8Nicolas Geoffray  Location GetReturnLocation(Primitive::Type type) const OVERRIDE;
87fd88f16100cceafbfde1b4f095f17e89444d6fa8Nicolas Geoffray  Location GetMethodLocation() const OVERRIDE;
88a747a392fb5f88d2ecc4c6021edf9f1f6615ba16Nicolas Geoffray
89a747a392fb5f88d2ecc4c6021edf9f1f6615ba16Nicolas Geoffray private:
90a747a392fb5f88d2ecc4c6021edf9f1f6615ba16Nicolas Geoffray  InvokeDexCallingConvention calling_convention;
912d27c8e338af7262dbd4aaa66127bb8fa1758b86Roland Levillain
922d27c8e338af7262dbd4aaa66127bb8fa1758b86Roland Levillain  DISALLOW_COPY_AND_ASSIGN(InvokeDexCallingConventionVisitorX86);
93a747a392fb5f88d2ecc4c6021edf9f1f6615ba16Nicolas Geoffray};
94a747a392fb5f88d2ecc4c6021edf9f1f6615ba16Nicolas Geoffray
95ad4450e5c3ffaa9566216cc6fafbf5c11186c467Zheng Xuclass ParallelMoveResolverX86 : public ParallelMoveResolverWithSwap {
9686dbb9a12119273039ce272b41c809fa548b37b6Nicolas Geoffray public:
9786dbb9a12119273039ce272b41c809fa548b37b6Nicolas Geoffray  ParallelMoveResolverX86(ArenaAllocator* allocator, CodeGeneratorX86* codegen)
98ad4450e5c3ffaa9566216cc6fafbf5c11186c467Zheng Xu      : ParallelMoveResolverWithSwap(allocator), codegen_(codegen) {}
9986dbb9a12119273039ce272b41c809fa548b37b6Nicolas Geoffray
100de58ab2c03ff8112b07ab827c8fa38f670dfc656Nicolas Geoffray  void EmitMove(size_t index) OVERRIDE;
101de58ab2c03ff8112b07ab827c8fa38f670dfc656Nicolas Geoffray  void EmitSwap(size_t index) OVERRIDE;
102de58ab2c03ff8112b07ab827c8fa38f670dfc656Nicolas Geoffray  void SpillScratch(int reg) OVERRIDE;
103de58ab2c03ff8112b07ab827c8fa38f670dfc656Nicolas Geoffray  void RestoreScratch(int reg) OVERRIDE;
10486dbb9a12119273039ce272b41c809fa548b37b6Nicolas Geoffray
10586dbb9a12119273039ce272b41c809fa548b37b6Nicolas Geoffray  X86Assembler* GetAssembler() const;
10686dbb9a12119273039ce272b41c809fa548b37b6Nicolas Geoffray
10786dbb9a12119273039ce272b41c809fa548b37b6Nicolas Geoffray private:
10886dbb9a12119273039ce272b41c809fa548b37b6Nicolas Geoffray  void Exchange(Register reg, int mem);
10986dbb9a12119273039ce272b41c809fa548b37b6Nicolas Geoffray  void Exchange(int mem1, int mem2);
1107c8d009552545e6f1fd6036721e4e42e3fd14697Mark Mendell  void Exchange32(XmmRegister reg, int mem);
1117c8d009552545e6f1fd6036721e4e42e3fd14697Mark Mendell  void MoveMemoryToMemory32(int dst, int src);
1127c8d009552545e6f1fd6036721e4e42e3fd14697Mark Mendell  void MoveMemoryToMemory64(int dst, int src);
11386dbb9a12119273039ce272b41c809fa548b37b6Nicolas Geoffray
11486dbb9a12119273039ce272b41c809fa548b37b6Nicolas Geoffray  CodeGeneratorX86* const codegen_;
11586dbb9a12119273039ce272b41c809fa548b37b6Nicolas Geoffray
11686dbb9a12119273039ce272b41c809fa548b37b6Nicolas Geoffray  DISALLOW_COPY_AND_ASSIGN(ParallelMoveResolverX86);
11786dbb9a12119273039ce272b41c809fa548b37b6Nicolas Geoffray};
11886dbb9a12119273039ce272b41c809fa548b37b6Nicolas Geoffray
119bab4ed7057799a4fadc6283108ab56f389d117d4Nicolas Geoffrayclass LocationsBuilderX86 : public HGraphVisitor {
120bab4ed7057799a4fadc6283108ab56f389d117d4Nicolas Geoffray public:
12101bc96d007b67fdb7fe349232a83e4b354ce3d08Nicolas Geoffray  LocationsBuilderX86(HGraph* graph, CodeGeneratorX86* codegen)
12201bc96d007b67fdb7fe349232a83e4b354ce3d08Nicolas Geoffray      : HGraphVisitor(graph), codegen_(codegen) {}
123bab4ed7057799a4fadc6283108ab56f389d117d4Nicolas Geoffray
124360231a056e796c36ffe62348507e904dc9efb9bNicolas Geoffray#define DECLARE_VISIT_INSTRUCTION(name, super)     \
125de58ab2c03ff8112b07ab827c8fa38f670dfc656Nicolas Geoffray  void Visit##name(H##name* instr) OVERRIDE;
126bab4ed7057799a4fadc6283108ab56f389d117d4Nicolas Geoffray
127ef20f71e16f035a39a329c8524d7e59ca6a11f04Alexandre Rames  FOR_EACH_CONCRETE_INSTRUCTION_COMMON(DECLARE_VISIT_INSTRUCTION)
128ef20f71e16f035a39a329c8524d7e59ca6a11f04Alexandre Rames  FOR_EACH_CONCRETE_INSTRUCTION_X86(DECLARE_VISIT_INSTRUCTION)
129bab4ed7057799a4fadc6283108ab56f389d117d4Nicolas Geoffray
130bab4ed7057799a4fadc6283108ab56f389d117d4Nicolas Geoffray#undef DECLARE_VISIT_INSTRUCTION
131bab4ed7057799a4fadc6283108ab56f389d117d4Nicolas Geoffray
132ef20f71e16f035a39a329c8524d7e59ca6a11f04Alexandre Rames  void VisitInstruction(HInstruction* instruction) OVERRIDE {
133ef20f71e16f035a39a329c8524d7e59ca6a11f04Alexandre Rames    LOG(FATAL) << "Unreachable instruction " << instruction->DebugName()
134ef20f71e16f035a39a329c8524d7e59ca6a11f04Alexandre Rames               << " (id " << instruction->GetId() << ")";
135ef20f71e16f035a39a329c8524d7e59ca6a11f04Alexandre Rames  }
136ef20f71e16f035a39a329c8524d7e59ca6a11f04Alexandre Rames
1379574c4b5f5ef039d694ac12c97e25ca02eca83c0Nicolas Geoffray private:
1389574c4b5f5ef039d694ac12c97e25ca02eca83c0Nicolas Geoffray  void HandleBitwiseOperation(HBinaryOperation* instruction);
139e982f0b8e809cece6f460fa2d8df25873aa69de4Nicolas Geoffray  void HandleInvoke(HInvoke* invoke);
1409aec02fc5df5518c16f1e5a9b6cb198a192db973Calin Juravle  void HandleShift(HBinaryOperation* instruction);
14152c489645b6e9ae33623f1ec24143cde5444906eCalin Juravle  void HandleFieldSet(HInstruction* instruction, const FieldInfo& field_info);
14252c489645b6e9ae33623f1ec24143cde5444906eCalin Juravle  void HandleFieldGet(HInstruction* instruction, const FieldInfo& field_info);
143e982f0b8e809cece6f460fa2d8df25873aa69de4Nicolas Geoffray
14401bc96d007b67fdb7fe349232a83e4b354ce3d08Nicolas Geoffray  CodeGeneratorX86* const codegen_;
1452d27c8e338af7262dbd4aaa66127bb8fa1758b86Roland Levillain  InvokeDexCallingConventionVisitorX86 parameter_visitor_;
14601bc96d007b67fdb7fe349232a83e4b354ce3d08Nicolas Geoffray
147bab4ed7057799a4fadc6283108ab56f389d117d4Nicolas Geoffray  DISALLOW_COPY_AND_ASSIGN(LocationsBuilderX86);
148bab4ed7057799a4fadc6283108ab56f389d117d4Nicolas Geoffray};
149bab4ed7057799a4fadc6283108ab56f389d117d4Nicolas Geoffray
150787c3076635cf117eb646c5a89a9014b2072fb44Nicolas Geoffrayclass InstructionCodeGeneratorX86 : public HGraphVisitor {
151d4dd255db1d110ceb5551f6d95ff31fb57420994Nicolas Geoffray public:
1524a34a428c6a2588e0857ef6baf88f1b73ce65958Nicolas Geoffray  InstructionCodeGeneratorX86(HGraph* graph, CodeGeneratorX86* codegen);
153d4dd255db1d110ceb5551f6d95ff31fb57420994Nicolas Geoffray
154360231a056e796c36ffe62348507e904dc9efb9bNicolas Geoffray#define DECLARE_VISIT_INSTRUCTION(name, super)     \
155de58ab2c03ff8112b07ab827c8fa38f670dfc656Nicolas Geoffray  void Visit##name(H##name* instr) OVERRIDE;
156d4dd255db1d110ceb5551f6d95ff31fb57420994Nicolas Geoffray
157ef20f71e16f035a39a329c8524d7e59ca6a11f04Alexandre Rames  FOR_EACH_CONCRETE_INSTRUCTION_COMMON(DECLARE_VISIT_INSTRUCTION)
158ef20f71e16f035a39a329c8524d7e59ca6a11f04Alexandre Rames  FOR_EACH_CONCRETE_INSTRUCTION_X86(DECLARE_VISIT_INSTRUCTION)
159d4dd255db1d110ceb5551f6d95ff31fb57420994Nicolas Geoffray
160d4dd255db1d110ceb5551f6d95ff31fb57420994Nicolas Geoffray#undef DECLARE_VISIT_INSTRUCTION
161d4dd255db1d110ceb5551f6d95ff31fb57420994Nicolas Geoffray
162ef20f71e16f035a39a329c8524d7e59ca6a11f04Alexandre Rames  void VisitInstruction(HInstruction* instruction) OVERRIDE {
163ef20f71e16f035a39a329c8524d7e59ca6a11f04Alexandre Rames    LOG(FATAL) << "Unreachable instruction " << instruction->DebugName()
164ef20f71e16f035a39a329c8524d7e59ca6a11f04Alexandre Rames               << " (id " << instruction->GetId() << ")";
165ef20f71e16f035a39a329c8524d7e59ca6a11f04Alexandre Rames  }
166ef20f71e16f035a39a329c8524d7e59ca6a11f04Alexandre Rames
1674a34a428c6a2588e0857ef6baf88f1b73ce65958Nicolas Geoffray  X86Assembler* GetAssembler() const { return assembler_; }
168787c3076635cf117eb646c5a89a9014b2072fb44Nicolas Geoffray
169787c3076635cf117eb646c5a89a9014b2072fb44Nicolas Geoffray private:
1703c04974a90b0e03f4b509010bff49f0b2a3da57fNicolas Geoffray  // Generate code for the given suspend check. If not null, `successor`
1713c04974a90b0e03f4b509010bff49f0b2a3da57fNicolas Geoffray  // is the block to branch to if the suspend check is not needed, and after
1723c04974a90b0e03f4b509010bff49f0b2a3da57fNicolas Geoffray  // the suspend call.
1733c04974a90b0e03f4b509010bff49f0b2a3da57fNicolas Geoffray  void GenerateSuspendCheck(HSuspendCheck* check, HBasicBlock* successor);
174424f676379f2f872acd1478672022f19f3240fc1Nicolas Geoffray  void GenerateClassInitializationCheck(SlowPathCodeX86* slow_path, Register class_reg);
1759574c4b5f5ef039d694ac12c97e25ca02eca83c0Nicolas Geoffray  void HandleBitwiseOperation(HBinaryOperation* instruction);
176bacfec30ee9f2f6fdfd190f11b105b609938efcaCalin Juravle  void GenerateDivRemIntegral(HBinaryOperation* instruction);
1770f88e87085b7cf6544dadff3f555773966a6853eGuillaume Sanchez  void DivRemOneOrMinusOne(HBinaryOperation* instruction);
178b19930c5cba3cf662dce5ee057fcc9829b4cbb9cGuillaume Sanchez  void DivByPowerOfTwo(HDiv* instruction);
1790f88e87085b7cf6544dadff3f555773966a6853eGuillaume Sanchez  void GenerateDivRemWithAnyConstant(HBinaryOperation* instruction);
180c470193cfc522fc818eb2eaab896aef9caf0c75aMark Mendell  void GenerateRemFP(HRem* rem);
1819aec02fc5df5518c16f1e5a9b6cb198a192db973Calin Juravle  void HandleShift(HBinaryOperation* instruction);
1829aec02fc5df5518c16f1e5a9b6cb198a192db973Calin Juravle  void GenerateShlLong(const Location& loc, Register shifter);
1839aec02fc5df5518c16f1e5a9b6cb198a192db973Calin Juravle  void GenerateShrLong(const Location& loc, Register shifter);
1849aec02fc5df5518c16f1e5a9b6cb198a192db973Calin Juravle  void GenerateUShrLong(const Location& loc, Register shifter);
1857394569c9252b277710b2d7d3fc35fb0dd48fc4bMark P Mendell  void GenerateShlLong(const Location& loc, int shift);
1867394569c9252b277710b2d7d3fc35fb0dd48fc4bMark P Mendell  void GenerateShrLong(const Location& loc, int shift);
1877394569c9252b277710b2d7d3fc35fb0dd48fc4bMark P Mendell  void GenerateUShrLong(const Location& loc, int shift);
18852c489645b6e9ae33623f1ec24143cde5444906eCalin Juravle  void GenerateMemoryBarrier(MemBarrierKind kind);
18907276db28d654594e0e86e9e467cad393f752e6eNicolas Geoffray  void HandleFieldSet(HInstruction* instruction,
19007276db28d654594e0e86e9e467cad393f752e6eNicolas Geoffray                      const FieldInfo& field_info,
19107276db28d654594e0e86e9e467cad393f752e6eNicolas Geoffray                      bool value_can_be_null);
19252c489645b6e9ae33623f1ec24143cde5444906eCalin Juravle  void HandleFieldGet(HInstruction* instruction, const FieldInfo& field_info);
193232ade0b9401404ad4b61b1003551b58b96195a8Roland Levillain  // Push value to FPU stack. `is_fp` specifies whether the value is floating point or not.
194232ade0b9401404ad4b61b1003551b58b96195a8Roland Levillain  // `is_wide` specifies whether it is long/double or not.
19524f2dfae084b2382c053f5d688fd6bb26cb8a328Mark Mendell  void PushOntoFPStack(Location source, uint32_t temp_offset,
196232ade0b9401404ad4b61b1003551b58b96195a8Roland Levillain                       uint32_t stack_adjustment, bool is_fp, bool is_wide);
1973c04974a90b0e03f4b509010bff49f0b2a3da57fNicolas Geoffray
198cd6dffedf1bd8e6dfb3fb0c933551f9a90f7de3fCalin Juravle  void GenerateImplicitNullCheck(HNullCheck* instruction);
199cd6dffedf1bd8e6dfb3fb0c933551f9a90f7de3fCalin Juravle  void GenerateExplicitNullCheck(HNullCheck* instruction);
200d43b3ac88cd46b8815890188c9c2b9a3f1564648Mingyao Yang  void GenerateTestAndBranch(HInstruction* instruction,
201d43b3ac88cd46b8815890188c9c2b9a3f1564648Mingyao Yang                             Label* true_target,
202d43b3ac88cd46b8815890188c9c2b9a3f1564648Mingyao Yang                             Label* false_target,
203d43b3ac88cd46b8815890188c9c2b9a3f1564648Mingyao Yang                             Label* always_true_target);
204c470193cfc522fc818eb2eaab896aef9caf0c75aMark Mendell  void GenerateCompareTestAndBranch(HIf* if_inst,
205c470193cfc522fc818eb2eaab896aef9caf0c75aMark Mendell                                    HCondition* condition,
206c470193cfc522fc818eb2eaab896aef9caf0c75aMark Mendell                                    Label* true_target,
207c470193cfc522fc818eb2eaab896aef9caf0c75aMark Mendell                                    Label* false_target,
208c470193cfc522fc818eb2eaab896aef9caf0c75aMark Mendell                                    Label* always_true_target);
209c470193cfc522fc818eb2eaab896aef9caf0c75aMark Mendell  void GenerateFPJumps(HCondition* cond, Label* true_label, Label* false_label);
210c470193cfc522fc818eb2eaab896aef9caf0c75aMark Mendell  void GenerateLongComparesAndJumps(HCondition* cond, Label* true_label, Label* false_label);
211fc6a86ab2b70781e72b807c1798b83829ca7f931David Brazdil  void HandleGoto(HInstruction* got, HBasicBlock* successor);
212cd6dffedf1bd8e6dfb3fb0c933551f9a90f7de3fCalin Juravle
2134a34a428c6a2588e0857ef6baf88f1b73ce65958Nicolas Geoffray  X86Assembler* const assembler_;
2144a34a428c6a2588e0857ef6baf88f1b73ce65958Nicolas Geoffray  CodeGeneratorX86* const codegen_;
215787c3076635cf117eb646c5a89a9014b2072fb44Nicolas Geoffray
216787c3076635cf117eb646c5a89a9014b2072fb44Nicolas Geoffray  DISALLOW_COPY_AND_ASSIGN(InstructionCodeGeneratorX86);
217787c3076635cf117eb646c5a89a9014b2072fb44Nicolas Geoffray};
218787c3076635cf117eb646c5a89a9014b2072fb44Nicolas Geoffray
219787c3076635cf117eb646c5a89a9014b2072fb44Nicolas Geoffrayclass CodeGeneratorX86 : public CodeGenerator {
220787c3076635cf117eb646c5a89a9014b2072fb44Nicolas Geoffray public:
221fb8d279bc011b31d0765dc7ca59afea324fd0d0cMark Mendell  CodeGeneratorX86(HGraph* graph,
222fb8d279bc011b31d0765dc7ca59afea324fd0d0cMark Mendell                   const X86InstructionSetFeatures& isa_features,
223ecc4366670e12b4812ef1653f7c8d52234ca1b1fSerban Constantinescu                   const CompilerOptions& compiler_options,
224ecc4366670e12b4812ef1653f7c8d52234ca1b1fSerban Constantinescu                   OptimizingCompilerStats* stats = nullptr);
225f12feb8e0e857f2832545b3f28d31bad5a9d3903Nicolas Geoffray  virtual ~CodeGeneratorX86() {}
226787c3076635cf117eb646c5a89a9014b2072fb44Nicolas Geoffray
227de58ab2c03ff8112b07ab827c8fa38f670dfc656Nicolas Geoffray  void GenerateFrameEntry() OVERRIDE;
228de58ab2c03ff8112b07ab827c8fa38f670dfc656Nicolas Geoffray  void GenerateFrameExit() OVERRIDE;
229de58ab2c03ff8112b07ab827c8fa38f670dfc656Nicolas Geoffray  void Bind(HBasicBlock* block) OVERRIDE;
230de58ab2c03ff8112b07ab827c8fa38f670dfc656Nicolas Geoffray  void Move(HInstruction* instruction, Location location, HInstruction* move_for) OVERRIDE;
231175dc732c80e6f2afd83209348124df349290ba8Calin Juravle  void MoveConstant(Location destination, int32_t value) OVERRIDE;
232de58ab2c03ff8112b07ab827c8fa38f670dfc656Nicolas Geoffray  size_t SaveCoreRegister(size_t stack_index, uint32_t reg_id) OVERRIDE;
233de58ab2c03ff8112b07ab827c8fa38f670dfc656Nicolas Geoffray  size_t RestoreCoreRegister(size_t stack_index, uint32_t reg_id) OVERRIDE;
2347c8d009552545e6f1fd6036721e4e42e3fd14697Mark Mendell  size_t SaveFloatingPointRegister(size_t stack_index, uint32_t reg_id) OVERRIDE;
2357c8d009552545e6f1fd6036721e4e42e3fd14697Mark Mendell  size_t RestoreFloatingPointRegister(size_t stack_index, uint32_t reg_id) OVERRIDE;
236bab4ed7057799a4fadc6283108ab56f389d117d4Nicolas Geoffray
2378158f28b6689314213eb4dbbe14166073be71f7eAlexandre Rames  // Generate code to invoke a runtime entry point.
238175dc732c80e6f2afd83209348124df349290ba8Calin Juravle  void InvokeRuntime(QuickEntrypointEnum entrypoint,
239175dc732c80e6f2afd83209348124df349290ba8Calin Juravle                     HInstruction* instruction,
240175dc732c80e6f2afd83209348124df349290ba8Calin Juravle                     uint32_t dex_pc,
241175dc732c80e6f2afd83209348124df349290ba8Calin Juravle                     SlowPathCode* slow_path) OVERRIDE;
242175dc732c80e6f2afd83209348124df349290ba8Calin Juravle
243175dc732c80e6f2afd83209348124df349290ba8Calin Juravle  void InvokeRuntime(int32_t entry_point_offset,
2448158f28b6689314213eb4dbbe14166073be71f7eAlexandre Rames                     HInstruction* instruction,
2458158f28b6689314213eb4dbbe14166073be71f7eAlexandre Rames                     uint32_t dex_pc,
2468158f28b6689314213eb4dbbe14166073be71f7eAlexandre Rames                     SlowPathCode* slow_path);
2478158f28b6689314213eb4dbbe14166073be71f7eAlexandre Rames
248de58ab2c03ff8112b07ab827c8fa38f670dfc656Nicolas Geoffray  size_t GetWordSize() const OVERRIDE {
249707c809f661554713edfacf338365adca8dfd3a3Nicolas Geoffray    return kX86WordSize;
250707c809f661554713edfacf338365adca8dfd3a3Nicolas Geoffray  }
251707c809f661554713edfacf338365adca8dfd3a3Nicolas Geoffray
252f85a9ca9859ad843dc03d3a2b600afbaf2e9bbddMark Mendell  size_t GetFloatingPointSpillSlotSize() const OVERRIDE {
253f85a9ca9859ad843dc03d3a2b600afbaf2e9bbddMark Mendell    // 8 bytes == 2 words for each spill.
254f85a9ca9859ad843dc03d3a2b600afbaf2e9bbddMark Mendell    return 2 * kX86WordSize;
255f85a9ca9859ad843dc03d3a2b600afbaf2e9bbddMark Mendell  }
256f85a9ca9859ad843dc03d3a2b600afbaf2e9bbddMark Mendell
257de58ab2c03ff8112b07ab827c8fa38f670dfc656Nicolas Geoffray  HGraphVisitor* GetLocationBuilder() OVERRIDE {
258bab4ed7057799a4fadc6283108ab56f389d117d4Nicolas Geoffray    return &location_builder_;
259bab4ed7057799a4fadc6283108ab56f389d117d4Nicolas Geoffray  }
260bab4ed7057799a4fadc6283108ab56f389d117d4Nicolas Geoffray
261de58ab2c03ff8112b07ab827c8fa38f670dfc656Nicolas Geoffray  HGraphVisitor* GetInstructionVisitor() OVERRIDE {
262787c3076635cf117eb646c5a89a9014b2072fb44Nicolas Geoffray    return &instruction_visitor_;
263787c3076635cf117eb646c5a89a9014b2072fb44Nicolas Geoffray  }
264787c3076635cf117eb646c5a89a9014b2072fb44Nicolas Geoffray
265de58ab2c03ff8112b07ab827c8fa38f670dfc656Nicolas Geoffray  X86Assembler* GetAssembler() OVERRIDE {
266787c3076635cf117eb646c5a89a9014b2072fb44Nicolas Geoffray    return &assembler_;
267787c3076635cf117eb646c5a89a9014b2072fb44Nicolas Geoffray  }
268787c3076635cf117eb646c5a89a9014b2072fb44Nicolas Geoffray
269eb7b7399dbdb5e471b8ae00a567bf4f19edd3907Alexandre Rames  const X86Assembler& GetAssembler() const OVERRIDE {
270eb7b7399dbdb5e471b8ae00a567bf4f19edd3907Alexandre Rames    return assembler_;
271eb7b7399dbdb5e471b8ae00a567bf4f19edd3907Alexandre Rames  }
272eb7b7399dbdb5e471b8ae00a567bf4f19edd3907Alexandre Rames
273de58ab2c03ff8112b07ab827c8fa38f670dfc656Nicolas Geoffray  uintptr_t GetAddressOf(HBasicBlock* block) const OVERRIDE {
274de58ab2c03ff8112b07ab827c8fa38f670dfc656Nicolas Geoffray    return GetLabelOf(block)->Position();
275de58ab2c03ff8112b07ab827c8fa38f670dfc656Nicolas Geoffray  }
276de58ab2c03ff8112b07ab827c8fa38f670dfc656Nicolas Geoffray
277988939683c26c0b1c8808fc206add6337319509aNicolas Geoffray  void SetupBlockedRegisters(bool is_baseline) const OVERRIDE;
27834bacdf7eb46c0ffbf24ba7aa14a904bc9176fb2Calin Juravle
279de58ab2c03ff8112b07ab827c8fa38f670dfc656Nicolas Geoffray  Location AllocateFreeRegister(Primitive::Type type) const OVERRIDE;
280a7aca370a7d62ca04a1e24423d90e8020d6f1a58Nicolas Geoffray
281de58ab2c03ff8112b07ab827c8fa38f670dfc656Nicolas Geoffray  Location GetStackLocation(HLoadLocal* load) const OVERRIDE;
2824a34a428c6a2588e0857ef6baf88f1b73ce65958Nicolas Geoffray
283de58ab2c03ff8112b07ab827c8fa38f670dfc656Nicolas Geoffray  void DumpCoreRegister(std::ostream& stream, int reg) const OVERRIDE;
284de58ab2c03ff8112b07ab827c8fa38f670dfc656Nicolas Geoffray  void DumpFloatingPointRegister(std::ostream& stream, int reg) const OVERRIDE;
285a7062e05e6048c7f817d784a5b94e3122e25b1ecNicolas Geoffray
28634bacdf7eb46c0ffbf24ba7aa14a904bc9176fb2Calin Juravle  // Blocks all register pairs made out of blocked core registers.
28734bacdf7eb46c0ffbf24ba7aa14a904bc9176fb2Calin Juravle  void UpdateBlockedPairRegisters() const;
28834bacdf7eb46c0ffbf24ba7aa14a904bc9176fb2Calin Juravle
289f0e3937b87453234d0d7970b8712082062709b8dNicolas Geoffray  ParallelMoveResolverX86* GetMoveResolver() OVERRIDE {
29086dbb9a12119273039ce272b41c809fa548b37b6Nicolas Geoffray    return &move_resolver_;
29186dbb9a12119273039ce272b41c809fa548b37b6Nicolas Geoffray  }
29286dbb9a12119273039ce272b41c809fa548b37b6Nicolas Geoffray
293de58ab2c03ff8112b07ab827c8fa38f670dfc656Nicolas Geoffray  InstructionSet GetInstructionSet() const OVERRIDE {
294412f10cfed002ab617c78f2621d68446ca4dd8bdNicolas Geoffray    return InstructionSet::kX86;
295412f10cfed002ab617c78f2621d68446ca4dd8bdNicolas Geoffray  }
296412f10cfed002ab617c78f2621d68446ca4dd8bdNicolas Geoffray
29701bc96d007b67fdb7fe349232a83e4b354ce3d08Nicolas Geoffray  // Helper method to move a 32bits value between two locations.
29801bc96d007b67fdb7fe349232a83e4b354ce3d08Nicolas Geoffray  void Move32(Location destination, Location source);
29901bc96d007b67fdb7fe349232a83e4b354ce3d08Nicolas Geoffray  // Helper method to move a 64bits value between two locations.
30001bc96d007b67fdb7fe349232a83e4b354ce3d08Nicolas Geoffray  void Move64(Location destination, Location source);
30101bc96d007b67fdb7fe349232a83e4b354ce3d08Nicolas Geoffray
30209ed1a3125849ec6ac07cb886e3c502e1dcfada2Mark Mendell  // Generate a call to a static or direct method.
30338207af82afb6f99c687f64b15601ed20d82220aNicolas Geoffray  void GenerateStaticOrDirectCall(HInvokeStaticOrDirect* invoke, Location temp);
304bfb5ba90cd6425ce49c2125a87e3b12222cc2601Andreas Gampe  // Generate a call to a virtual method.
305bfb5ba90cd6425ce49c2125a87e3b12222cc2601Andreas Gampe  void GenerateVirtualCall(HInvokeVirtual* invoke, Location temp);
30609ed1a3125849ec6ac07cb886e3c502e1dcfada2Mark Mendell
307581550137ee3a068a14224870e71aeee924a0646Vladimir Marko  // Emit linker patches.
308581550137ee3a068a14224870e71aeee924a0646Vladimir Marko  void EmitLinkerPatches(ArenaVector<LinkerPatch>* linker_patches) OVERRIDE;
309581550137ee3a068a14224870e71aeee924a0646Vladimir Marko
3103c7bb98698f77af10372cf31824d3bb115d9bf0fNicolas Geoffray  // Emit a write barrier.
31107276db28d654594e0e86e9e467cad393f752e6eNicolas Geoffray  void MarkGCCard(Register temp,
31207276db28d654594e0e86e9e467cad393f752e6eNicolas Geoffray                  Register card,
31307276db28d654594e0e86e9e467cad393f752e6eNicolas Geoffray                  Register object,
31407276db28d654594e0e86e9e467cad393f752e6eNicolas Geoffray                  Register value,
31507276db28d654594e0e86e9e467cad393f752e6eNicolas Geoffray                  bool value_can_be_null);
3163c7bb98698f77af10372cf31824d3bb115d9bf0fNicolas Geoffray
31792a73aef279be78e3c2b04db1713076183933436Nicolas Geoffray  Label* GetLabelOf(HBasicBlock* block) const {
318dc23d8318db08cb42e20f1d16dbc416798951a8bNicolas Geoffray    return CommonGetLabelOf<Label>(block_labels_.GetRawStorage(), block);
31992a73aef279be78e3c2b04db1713076183933436Nicolas Geoffray  }
32092a73aef279be78e3c2b04db1713076183933436Nicolas Geoffray
321de58ab2c03ff8112b07ab827c8fa38f670dfc656Nicolas Geoffray  void Initialize() OVERRIDE {
322fa6b93c4b69e6d7ddfa2a4ed0aff01b0608c5a3aVladimir Marko    block_labels_.SetSize(GetGraph()->GetBlocks().size());
32392a73aef279be78e3c2b04db1713076183933436Nicolas Geoffray  }
32492a73aef279be78e3c2b04db1713076183933436Nicolas Geoffray
325840e5461a85f8908f51e7f6cd562a9129ff0e7ceNicolas Geoffray  bool NeedsTwoRegisters(Primitive::Type type) const OVERRIDE {
326840e5461a85f8908f51e7f6cd562a9129ff0e7ceNicolas Geoffray    return type == Primitive::kPrimLong;
327840e5461a85f8908f51e7f6cd562a9129ff0e7ceNicolas Geoffray  }
328840e5461a85f8908f51e7f6cd562a9129ff0e7ceNicolas Geoffray
329234d69d075d1608f80adb647f7935077b62b6376Nicolas Geoffray  bool ShouldSplitLongMoves() const OVERRIDE { return true; }
330234d69d075d1608f80adb647f7935077b62b6376Nicolas Geoffray
3311cf95287364948689f6a1a320567acd7728e94a3Nicolas Geoffray  Label* GetFrameEntryLabel() { return &frame_entry_label_; }
3321cf95287364948689f6a1a320567acd7728e94a3Nicolas Geoffray
333fb8d279bc011b31d0765dc7ca59afea324fd0d0cMark Mendell  const X86InstructionSetFeatures& GetInstructionSetFeatures() const {
334fb8d279bc011b31d0765dc7ca59afea324fd0d0cMark Mendell    return isa_features_;
335fb8d279bc011b31d0765dc7ca59afea324fd0d0cMark Mendell  }
336fb8d279bc011b31d0765dc7ca59afea324fd0d0cMark Mendell
3370616ae081e648f4b9b64b33e2624a943c5fce977Mark Mendell  void SetMethodAddressOffset(int32_t offset) {
3380616ae081e648f4b9b64b33e2624a943c5fce977Mark Mendell    method_address_offset_ = offset;
3390616ae081e648f4b9b64b33e2624a943c5fce977Mark Mendell  }
3400616ae081e648f4b9b64b33e2624a943c5fce977Mark Mendell
3410616ae081e648f4b9b64b33e2624a943c5fce977Mark Mendell  int32_t GetMethodAddressOffset() const {
3420616ae081e648f4b9b64b33e2624a943c5fce977Mark Mendell    return method_address_offset_;
3430616ae081e648f4b9b64b33e2624a943c5fce977Mark Mendell  }
3440616ae081e648f4b9b64b33e2624a943c5fce977Mark Mendell
3450616ae081e648f4b9b64b33e2624a943c5fce977Mark Mendell  int32_t ConstantAreaStart() const {
3460616ae081e648f4b9b64b33e2624a943c5fce977Mark Mendell    return constant_area_start_;
3470616ae081e648f4b9b64b33e2624a943c5fce977Mark Mendell  }
3480616ae081e648f4b9b64b33e2624a943c5fce977Mark Mendell
3490616ae081e648f4b9b64b33e2624a943c5fce977Mark Mendell  Address LiteralDoubleAddress(double v, Register reg);
3500616ae081e648f4b9b64b33e2624a943c5fce977Mark Mendell  Address LiteralFloatAddress(float v, Register reg);
3510616ae081e648f4b9b64b33e2624a943c5fce977Mark Mendell  Address LiteralInt32Address(int32_t v, Register reg);
3520616ae081e648f4b9b64b33e2624a943c5fce977Mark Mendell  Address LiteralInt64Address(int64_t v, Register reg);
3530616ae081e648f4b9b64b33e2624a943c5fce977Mark Mendell
3540616ae081e648f4b9b64b33e2624a943c5fce977Mark Mendell  void Finalize(CodeAllocator* allocator) OVERRIDE;
3550616ae081e648f4b9b64b33e2624a943c5fce977Mark Mendell
3563c7bb98698f77af10372cf31824d3bb115d9bf0fNicolas Geoffray private:
35792a73aef279be78e3c2b04db1713076183933436Nicolas Geoffray  // Labels for each block that will be compiled.
35892a73aef279be78e3c2b04db1713076183933436Nicolas Geoffray  GrowableArray<Label> block_labels_;
3591cf95287364948689f6a1a320567acd7728e94a3Nicolas Geoffray  Label frame_entry_label_;
360bab4ed7057799a4fadc6283108ab56f389d117d4Nicolas Geoffray  LocationsBuilderX86 location_builder_;
361787c3076635cf117eb646c5a89a9014b2072fb44Nicolas Geoffray  InstructionCodeGeneratorX86 instruction_visitor_;
36286dbb9a12119273039ce272b41c809fa548b37b6Nicolas Geoffray  ParallelMoveResolverX86 move_resolver_;
363787c3076635cf117eb646c5a89a9014b2072fb44Nicolas Geoffray  X86Assembler assembler_;
364fb8d279bc011b31d0765dc7ca59afea324fd0d0cMark Mendell  const X86InstructionSetFeatures& isa_features_;
365d4dd255db1d110ceb5551f6d95ff31fb57420994Nicolas Geoffray
366581550137ee3a068a14224870e71aeee924a0646Vladimir Marko  // Method patch info. Using ArenaDeque<> which retains element addresses on push/emplace_back().
367581550137ee3a068a14224870e71aeee924a0646Vladimir Marko  ArenaDeque<MethodPatchInfo<Label>> method_patches_;
368581550137ee3a068a14224870e71aeee924a0646Vladimir Marko  ArenaDeque<MethodPatchInfo<Label>> relative_call_patches_;
369581550137ee3a068a14224870e71aeee924a0646Vladimir Marko
3700616ae081e648f4b9b64b33e2624a943c5fce977Mark Mendell  // Offset to the start of the constant area in the assembled code.
3710616ae081e648f4b9b64b33e2624a943c5fce977Mark Mendell  // Used for fixups to the constant area.
3720616ae081e648f4b9b64b33e2624a943c5fce977Mark Mendell  int32_t constant_area_start_;
3730616ae081e648f4b9b64b33e2624a943c5fce977Mark Mendell
3740616ae081e648f4b9b64b33e2624a943c5fce977Mark Mendell  // If there is a HX86ComputeBaseMethodAddress instruction in the graph
3750616ae081e648f4b9b64b33e2624a943c5fce977Mark Mendell  // (which shall be the sole instruction of this kind), subtracting this offset
3760616ae081e648f4b9b64b33e2624a943c5fce977Mark Mendell  // from the value contained in the out register of this HX86ComputeBaseMethodAddress
3770616ae081e648f4b9b64b33e2624a943c5fce977Mark Mendell  // instruction gives the address of the start of this method.
3780616ae081e648f4b9b64b33e2624a943c5fce977Mark Mendell  int32_t method_address_offset_;
3790616ae081e648f4b9b64b33e2624a943c5fce977Mark Mendell
3800616ae081e648f4b9b64b33e2624a943c5fce977Mark Mendell  // When we don't know the proper offset for the value, we use kDummy32BitOffset.
3810616ae081e648f4b9b64b33e2624a943c5fce977Mark Mendell  // The correct value will be inserted when processing Assembler fixups.
3820616ae081e648f4b9b64b33e2624a943c5fce977Mark Mendell  static constexpr int32_t kDummy32BitOffset = 256;
3830616ae081e648f4b9b64b33e2624a943c5fce977Mark Mendell
384d4dd255db1d110ceb5551f6d95ff31fb57420994Nicolas Geoffray  DISALLOW_COPY_AND_ASSIGN(CodeGeneratorX86);
385d4dd255db1d110ceb5551f6d95ff31fb57420994Nicolas Geoffray};
386d4dd255db1d110ceb5551f6d95ff31fb57420994Nicolas Geoffray
38709ed1a3125849ec6ac07cb886e3c502e1dcfada2Mark Mendellclass SlowPathCodeX86 : public SlowPathCode {
38809ed1a3125849ec6ac07cb886e3c502e1dcfada2Mark Mendell public:
38909ed1a3125849ec6ac07cb886e3c502e1dcfada2Mark Mendell  SlowPathCodeX86() : entry_label_(), exit_label_() {}
39009ed1a3125849ec6ac07cb886e3c502e1dcfada2Mark Mendell
39109ed1a3125849ec6ac07cb886e3c502e1dcfada2Mark Mendell  Label* GetEntryLabel() { return &entry_label_; }
39209ed1a3125849ec6ac07cb886e3c502e1dcfada2Mark Mendell  Label* GetExitLabel() { return &exit_label_; }
39309ed1a3125849ec6ac07cb886e3c502e1dcfada2Mark Mendell
39409ed1a3125849ec6ac07cb886e3c502e1dcfada2Mark Mendell private:
39509ed1a3125849ec6ac07cb886e3c502e1dcfada2Mark Mendell  Label entry_label_;
39609ed1a3125849ec6ac07cb886e3c502e1dcfada2Mark Mendell  Label exit_label_;
39709ed1a3125849ec6ac07cb886e3c502e1dcfada2Mark Mendell
39809ed1a3125849ec6ac07cb886e3c502e1dcfada2Mark Mendell  DISALLOW_COPY_AND_ASSIGN(SlowPathCodeX86);
39909ed1a3125849ec6ac07cb886e3c502e1dcfada2Mark Mendell};
40009ed1a3125849ec6ac07cb886e3c502e1dcfada2Mark Mendell
401d4dd255db1d110ceb5551f6d95ff31fb57420994Nicolas Geoffray}  // namespace x86
402d4dd255db1d110ceb5551f6d95ff31fb57420994Nicolas Geoffray}  // namespace art
403d4dd255db1d110ceb5551f6d95ff31fb57420994Nicolas Geoffray
404d4dd255db1d110ceb5551f6d95ff31fb57420994Nicolas Geoffray#endif  // ART_COMPILER_OPTIMIZING_CODE_GENERATOR_X86_H_
405