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

Side by Side Diff: src/base/macros.h

Issue 1098863003: Import Reversed adapter from Chromium and use it in v8. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed feedback. Rebased. Created 5 years, 8 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/base/adapters.h ('k') | src/compiler/arm/instruction-selector-arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_BASE_MACROS_H_ 5 #ifndef V8_BASE_MACROS_H_
6 #define V8_BASE_MACROS_H_ 6 #define V8_BASE_MACROS_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 template <class Dest, class Source> 221 template <class Dest, class Source>
222 V8_INLINE Dest bit_cast(Source const& source) { 222 V8_INLINE Dest bit_cast(Source const& source) {
223 COMPILE_ASSERT(sizeof(Dest) == sizeof(Source), VerifySizesAreEqual); 223 COMPILE_ASSERT(sizeof(Dest) == sizeof(Source), VerifySizesAreEqual);
224 224
225 Dest dest; 225 Dest dest;
226 memcpy(&dest, &source, sizeof(dest)); 226 memcpy(&dest, &source, sizeof(dest));
227 return dest; 227 return dest;
228 } 228 }
229 229
230 230
231 // Put this in the private: declarations for a class to be unassignable.
232 #define DISALLOW_ASSIGN(TypeName) void operator=(const TypeName&)
233
234
231 // A macro to disallow the evil copy constructor and operator= functions 235 // A macro to disallow the evil copy constructor and operator= functions
232 // This should be used in the private: declarations for a class 236 // This should be used in the private: declarations for a class
233 #define DISALLOW_COPY_AND_ASSIGN(TypeName) \ 237 #define DISALLOW_COPY_AND_ASSIGN(TypeName) \
234 TypeName(const TypeName&) V8_DELETE; \ 238 TypeName(const TypeName&) V8_DELETE; \
235 void operator=(const TypeName&) V8_DELETE 239 void operator=(const TypeName&) V8_DELETE
236 240
237 241
238 // A macro to disallow all the implicit constructors, namely the 242 // A macro to disallow all the implicit constructors, namely the
239 // default constructor, copy constructor and operator= functions. 243 // default constructor, copy constructor and operator= functions.
240 // 244 //
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 } 417 }
414 418
415 template <> 419 template <>
416 inline bool is_fundamental<uint8_t>() { 420 inline bool is_fundamental<uint8_t>() {
417 return true; 421 return true;
418 } 422 }
419 } 423 }
420 } // namespace v8::base 424 } // namespace v8::base
421 425
422 #endif // V8_BASE_MACROS_H_ 426 #endif // V8_BASE_MACROS_H_
OLDNEW
« no previous file with comments | « src/base/adapters.h ('k') | src/compiler/arm/instruction-selector-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698