Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1227)

Side by Side Diff: src/mips/cpu-mips.cc

Issue 6709022: Re-establish mips basic infrastructure. (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 21 matching lines...) Expand all
32 32
33 #ifdef __mips 33 #ifdef __mips
34 #include <asm/cachectl.h> 34 #include <asm/cachectl.h>
35 #endif // #ifdef __mips 35 #endif // #ifdef __mips
36 36
37 #include "v8.h" 37 #include "v8.h"
38 38
39 #if defined(V8_TARGET_ARCH_MIPS) 39 #if defined(V8_TARGET_ARCH_MIPS)
40 40
41 #include "cpu.h" 41 #include "cpu.h"
42 #include "macro-assembler.h"
43
44 #include "simulator.h" // for cache flushing.
Søren Thygesen Gjesse 2011/03/21 16:05:19 Please start comment with uppercase letter.
Paul Lind 2011/03/23 01:55:43 Done.
42 45
43 namespace v8 { 46 namespace v8 {
44 namespace internal { 47 namespace internal {
45 48
49
46 void CPU::Setup() { 50 void CPU::Setup() {
47 // Nothing to do. 51 CpuFeatures::Probe(true);
52 // For now just disable lithium/crankshaft.
53 if (true || !CpuFeatures::IsSupported(FPU) || Serializer::enabled()) {
Søren Thygesen Gjesse 2011/03/21 16:05:19 Please remove the true here. Disabling crankshaft
Paul Lind 2011/03/23 01:55:43 Done.
54 V8::DisableCrankshaft();
55 }
48 } 56 }
49 57
58
50 void CPU::FlushICache(void* start, size_t size) { 59 void CPU::FlushICache(void* start, size_t size) {
51 #ifdef __mips 60 #if !defined (USE_SIMULATOR)
52 int res; 61 int res;
53 62
54 // See http://www.linux-mips.org/wiki/Cacheflush_Syscall 63 // See http://www.linux-mips.org/wiki/Cacheflush_Syscall
55 res = syscall(__NR_cacheflush, start, size, ICACHE); 64 res = syscall(__NR_cacheflush, start, size, ICACHE);
56 65
57 if (res) { 66 if (res) {
58 V8_Fatal(__FILE__, __LINE__, "Failed to flush the instruction cache"); 67 V8_Fatal(__FILE__, __LINE__, "Failed to flush the instruction cache");
59 } 68 }
60 69
70 #else // simulator mode
Søren Thygesen Gjesse 2011/03/21 16:05:19 #else comment should match the #if
Paul Lind 2011/03/23 01:55:43 Done.
71 // Not generating mips instructions for C-code. This means that we are
72 // building a mips emulator based target. We should notify the simulator
73 // that the Icache was flushed.
74 // None of this code ends up in the snapshot so there are no issues
75 // around whether or not to generate the code when building snapshots.
76 Simulator::FlushICache(start, size);
61 #endif // #ifdef __mips 77 #endif // #ifdef __mips
Søren Thygesen Gjesse 2011/03/21 16:05:19 #endif comment should match the #if
Paul Lind 2011/03/23 01:55:43 Done.
62 } 78 }
63 79
64 80
65 void CPU::DebugBreak() { 81 void CPU::DebugBreak() {
66 #ifdef __mips 82 #ifdef __mips
67 asm volatile("break"); 83 asm volatile("break");
68 #endif // #ifdef __mips 84 #endif // #ifdef __mips
69 } 85 }
70 86
87
71 } } // namespace v8::internal 88 } } // namespace v8::internal
72 89
73 #endif // V8_TARGET_ARCH_MIPS 90 #endif // V8_TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698