| OLD | NEW |
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 #ifdef __arm__ | 29 #ifdef __arm__ |
| 30 #include <sys/syscall.h> // for cache flushing. | 30 #include <sys/syscall.h> // for cache flushing. |
| 31 #endif | 31 #endif |
| 32 | 32 |
| 33 #include "v8.h" | 33 #include "v8.h" |
| 34 | 34 |
| 35 #if defined(V8_TARGET_ARCH_ARM) | 35 #if defined(V8_TARGET_ARCH_ARM) |
| 36 | 36 |
| 37 #include "cpu.h" | 37 #include "cpu.h" |
| 38 #include "macro-assembler.h" | 38 #include "macro-assembler.h" |
| 39 | 39 #include "simulator.h" // for cache flushing. |
| 40 #ifndef __arm__ | |
| 41 #include "simulator-arm.h" // for cache flushing. | |
| 42 #endif | |
| 43 | 40 |
| 44 namespace v8 { | 41 namespace v8 { |
| 45 namespace internal { | 42 namespace internal { |
| 46 | 43 |
| 47 void CPU::Setup() { | 44 void CPU::Setup() { |
| 48 CpuFeatures::Probe(); | 45 CpuFeatures::Probe(); |
| 49 } | 46 } |
| 50 | 47 |
| 51 | 48 |
| 52 void CPU::FlushICache(void* start, size_t size) { | 49 void CPU::FlushICache(void* start, size_t size) { |
| 53 #if !defined (__arm__) | 50 #if defined (USE_SIMULATOR) |
| 54 // Not generating ARM instructions for C-code. This means that we are | 51 // Not generating ARM instructions for C-code. This means that we are |
| 55 // building an ARM emulator based target. We should notify the simulator | 52 // building an ARM emulator based target. We should notify the simulator |
| 56 // that the Icache was flushed. | 53 // that the Icache was flushed. |
| 57 // None of this code ends up in the snapshot so there are no issues | 54 // None of this code ends up in the snapshot so there are no issues |
| 58 // around whether or not to generate the code when building snapshots. | 55 // around whether or not to generate the code when building snapshots. |
| 59 assembler::arm::Simulator::FlushICache(start, size); | 56 assembler::arm::Simulator::FlushICache(start, size); |
| 60 #else | 57 #else |
| 61 // Ideally, we would call | 58 // Ideally, we would call |
| 62 // syscall(__ARM_NR_cacheflush, start, | 59 // syscall(__ARM_NR_cacheflush, start, |
| 63 // reinterpret_cast<intptr_t>(start) + size, 0); | 60 // reinterpret_cast<intptr_t>(start) + size, 0); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 #if !defined (__arm__) || !defined(CAN_USE_ARMV5_INSTRUCTIONS) | 130 #if !defined (__arm__) || !defined(CAN_USE_ARMV5_INSTRUCTIONS) |
| 134 UNIMPLEMENTED(); // when building ARM emulator target | 131 UNIMPLEMENTED(); // when building ARM emulator target |
| 135 #else | 132 #else |
| 136 asm volatile("bkpt 0"); | 133 asm volatile("bkpt 0"); |
| 137 #endif | 134 #endif |
| 138 } | 135 } |
| 139 | 136 |
| 140 } } // namespace v8::internal | 137 } } // namespace v8::internal |
| 141 | 138 |
| 142 #endif // V8_TARGET_ARCH_ARM | 139 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |