diff options
Diffstat (limited to 'deps/v8/src/mips/cpu-mips.cc')
-rw-r--r-- | deps/v8/src/mips/cpu-mips.cc | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/deps/v8/src/mips/cpu-mips.cc b/deps/v8/src/mips/cpu-mips.cc index 659fc01ce0..26e95fb24c 100644 --- a/deps/v8/src/mips/cpu-mips.cc +++ b/deps/v8/src/mips/cpu-mips.cc @@ -1,4 +1,4 @@ -// Copyright 2010 the V8 project authors. All rights reserved. +// Copyright 2011 the V8 project authors. All rights reserved. // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: @@ -39,26 +39,48 @@ #if defined(V8_TARGET_ARCH_MIPS) #include "cpu.h" +#include "macro-assembler.h" + +#include "simulator.h" // For cache flushing. namespace v8 { namespace internal { + void CPU::Setup() { - // Nothing to do. + CpuFeatures::Probe(); +} + + +bool CPU::SupportsCrankshaft() { + return CpuFeatures::IsSupported(FPU); } + void CPU::FlushICache(void* start, size_t size) { -#ifdef __mips + // Nothing to do, flushing no instructions. + if (size == 0) { + return; + } + +#if !defined (USE_SIMULATOR) int res; - // See http://www.linux-mips.org/wiki/Cacheflush_Syscall + // See http://www.linux-mips.org/wiki/Cacheflush_Syscall. res = syscall(__NR_cacheflush, start, size, ICACHE); if (res) { V8_Fatal(__FILE__, __LINE__, "Failed to flush the instruction cache"); } -#endif // #ifdef __mips +#else // USE_SIMULATOR. + // Not generating mips instructions for C-code. This means that we are + // building a mips emulator based target. We should notify the simulator + // that the Icache was flushed. + // None of this code ends up in the snapshot so there are no issues + // around whether or not to generate the code when building snapshots. + Simulator::FlushICache(Isolate::Current()->simulator_i_cache(), start, size); +#endif // USE_SIMULATOR. } @@ -68,6 +90,7 @@ void CPU::DebugBreak() { #endif // #ifdef __mips } + } } // namespace v8::internal #endif // V8_TARGET_ARCH_MIPS |