buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2011 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Elliott Hughes | 11d1b0c | 2012-01-23 16:57:47 -0800 | [diff] [blame] | 17 | namespace art { |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 18 | |
| 19 | /* |
| 20 | * Determine the initial instruction set to be used for this trace. |
| 21 | * Later components may decide to change this. |
| 22 | */ |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 23 | InstructionSet oatInstructionSet() |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 24 | { |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 25 | return kThumb2; |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 26 | } |
| 27 | |
| 28 | /* Architecture-specific initializations and checks go here */ |
| 29 | bool oatArchVariantInit(void) |
| 30 | { |
| 31 | return true; |
| 32 | } |
| 33 | |
| 34 | int oatTargetOptHint(int key) |
| 35 | { |
| 36 | int res = 0; |
| 37 | switch (key) { |
| 38 | case kMaxHoistDistance: |
| 39 | res = 7; |
| 40 | break; |
| 41 | default: |
| 42 | LOG(FATAL) << "Unknown target optimization hint key: " << key; |
| 43 | } |
| 44 | return res; |
| 45 | } |
| 46 | |
| 47 | void oatGenMemBarrier(CompilationUnit* cUnit, int barrierKind) |
| 48 | { |
| 49 | #if ANDROID_SMP != 0 |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 50 | LIR* dmb = newLIR1(cUnit, kThumb2Dmb, barrierKind); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 51 | dmb->defMask = ENCODE_ALL; |
| 52 | #endif |
| 53 | } |
Elliott Hughes | 11d1b0c | 2012-01-23 16:57:47 -0800 | [diff] [blame] | 54 | |
| 55 | } // namespace art |