| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 24 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 #if defined(V8_TARGET_ARCH_IA32) | 36 #if defined(V8_TARGET_ARCH_IA32) |
| 37 | 37 |
| 38 #include "cpu.h" | 38 #include "cpu.h" |
| 39 #include "macro-assembler.h" | 39 #include "macro-assembler.h" |
| 40 | 40 |
| 41 namespace v8 { | 41 namespace v8 { |
| 42 namespace internal { | 42 namespace internal { |
| 43 | 43 |
| 44 void CPU::Setup() { | 44 void CPU::Setup() { |
| 45 CpuFeatures* cpu_features = Isolate::Current()->cpu_features(); | 45 CpuFeatures::Probe(true); |
| 46 cpu_features->Clear(); | |
| 47 cpu_features->Probe(true); | |
| 48 if (!cpu_features->IsSupported(SSE2) || Serializer::enabled()) { | |
| 49 V8::DisableCrankshaft(); | |
| 50 } | |
| 51 } | 46 } |
| 52 | 47 |
| 53 | 48 |
| 49 bool CPU::SupportsCrankshaft() { |
| 50 return CpuFeatures::IsSupported(SSE2); |
| 51 } |
| 52 |
| 53 |
| 54 void CPU::FlushICache(void* start, size_t size) { | 54 void CPU::FlushICache(void* start, size_t size) { |
| 55 // No need to flush the instruction cache on Intel. On Intel instruction | 55 // No need to flush the instruction cache on Intel. On Intel instruction |
| 56 // cache flushing is only necessary when multiple cores running the same | 56 // cache flushing is only necessary when multiple cores running the same |
| 57 // code simultaneously. V8 (and JavaScript) is single threaded and when code | 57 // code simultaneously. V8 (and JavaScript) is single threaded and when code |
| 58 // is patched on an intel CPU the core performing the patching will have its | 58 // is patched on an intel CPU the core performing the patching will have its |
| 59 // own instruction cache updated automatically. | 59 // own instruction cache updated automatically. |
| 60 | 60 |
| 61 // If flushing of the instruction cache becomes necessary Windows has the | 61 // If flushing of the instruction cache becomes necessary Windows has the |
| 62 // API function FlushInstructionCache. | 62 // API function FlushInstructionCache. |
| 63 | 63 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 79 // __asm { int 3 } | 79 // __asm { int 3 } |
| 80 __debugbreak(); | 80 __debugbreak(); |
| 81 #else | 81 #else |
| 82 asm("int $3"); | 82 asm("int $3"); |
| 83 #endif | 83 #endif |
| 84 } | 84 } |
| 85 | 85 |
| 86 } } // namespace v8::internal | 86 } } // namespace v8::internal |
| 87 | 87 |
| 88 #endif // V8_TARGET_ARCH_IA32 | 88 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |