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

Side by Side Diff: src/IceMemoryRegion.cpp

Issue 643903006: Subzero: Do class definition cleanups for assembler files too. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: stuff Created 6 years, 2 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
« no previous file with comments | « src/IceMemoryRegion.h ('k') | src/assembler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceMemoryRegion.cpp - Memory region --------------------===//
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 2 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 3 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 4 // BSD-style license that can be found in the LICENSE file.
4 // 5 //
5 // Modified by the Subzero authors. 6 // Modified by the Subzero authors.
6 // 7 //
7 //===- subzero/src/IceMemoryRegion.cpp - Memory region --------------------===// 8 //===----------------------------------------------------------------------===//
8 // 9 //
9 // The Subzero Code Generator 10 // The Subzero Code Generator
10 // 11 //
11 // This file is distributed under the University of Illinois Open Source 12 // This file is distributed under the University of Illinois Open Source
12 // License. See LICENSE.TXT for details. 13 // License. See LICENSE.TXT for details.
13 // 14 //
14 //===----------------------------------------------------------------------===// 15 //===----------------------------------------------------------------------===//
15 // 16 //
16 // This file defines the MemoryRegion class. It tracks a pointer plus its 17 // This file defines the MemoryRegion class. It tracks a pointer plus its
17 // bounds for bounds-checking in debug mode. 18 // bounds for bounds-checking in debug mode.
18 //===----------------------------------------------------------------------===// 19 //===----------------------------------------------------------------------===//
19 20
20 #include "IceMemoryRegion.h" 21 #include "IceMemoryRegion.h"
21 22
22 namespace Ice { 23 namespace Ice {
23 24
24 void MemoryRegion::CopyFrom(uintptr_t offset, const MemoryRegion &from) const { 25 void MemoryRegion::CopyFrom(uintptr_t offset, const MemoryRegion &from) const {
25 assert(from.pointer() != NULL && from.size() > 0); 26 assert(from.pointer() != NULL && from.size() > 0);
26 assert(this->size() >= from.size()); 27 assert(this->size() >= from.size());
27 assert(offset <= this->size() - from.size()); 28 assert(offset <= this->size() - from.size());
28 memmove(reinterpret_cast<void *>(start() + offset), from.pointer(), 29 memmove(reinterpret_cast<void *>(start() + offset), from.pointer(),
29 from.size()); 30 from.size());
30 } 31 }
31 32
32 } // end of namespace Ice 33 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceMemoryRegion.h ('k') | src/assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698