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

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

Issue 422063005: Contribution of PowerPC port. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: re-upload - catch up to 8/19 level Created 6 years, 3 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2006-2009 the V8 project authors. All rights reserved.
2 //
3 // Copyright IBM Corp. 2012, 2013. All rights reserved.
4 //
5 // Use of this source code is governed by a BSD-style license that can be
6 // found in the LICENSE file.
7
8 // CPU specific code for ppc independent of OS goes here.
9 #include "src/v8.h"
10
11 #if V8_TARGET_ARCH_PPC
12
13 #include "src/assembler.h"
14 #include "src/macro-assembler.h"
15 #include "src/simulator.h" // for cache flushing.
16
17 namespace v8 {
18 namespace internal {
19
20 void CpuFeatures::FlushICache(void* buffer, size_t size) {
21 // Nothing to do flushing no instructions.
22 if (size == 0) {
23 return;
24 }
25
26 #if defined(USE_SIMULATOR)
27 // Not generating PPC instructions for C-code. This means that we are
28 // building an PPC emulator based target. We should notify the simulator
29 // that the Icache was flushed.
30 // None of this code ends up in the snapshot so there are no issues
31 // around whether or not to generate the code when building snapshots.
32 Simulator::FlushICache(Isolate::Current()->simulator_i_cache(), buffer, size);
33 #else
34
35 const int kCacheLineSize = CpuFeatures::cache_line_size();
36 intptr_t mask = kCacheLineSize - 1;
37 byte *start =
38 reinterpret_cast<byte *>(reinterpret_cast<intptr_t>(buffer) & ~mask);
39 byte *end = static_cast<byte *>(buffer) + size;
40 for (byte *pointer = start; pointer < end; pointer += kCacheLineSize) {
41 __asm__(
42 "dcbf 0, %0 \n"
43 "sync \n"
44 "icbi 0, %0 \n"
45 "isync \n"
46 : /* no output */
47 : "r"(pointer));
48 }
49
50 #endif // USE_SIMULATOR
51 }
52 }
53 } // namespace v8::internal
54
55 #endif // V8_TARGET_ARCH_PPC
OLDNEW
« src/hydrogen-bch.cc ('K') | « src/ppc/constants-ppc.cc ('k') | src/ppc/debug-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698