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

Side by Side Diff: lib/byte_array.cc

Issue 12052033: Added macros OBJECT_IMPLEMENTATION and FINAL_OBJECT_IMPLEMENTATION (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 7 years, 11 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
« no previous file with comments | « no previous file | lib/integers.cc » ('j') | vm/object.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/bootstrap_natives.h" 5 #include "vm/bootstrap_natives.h"
6 6
7 #include "vm/bigint_operations.h" 7 #include "vm/bigint_operations.h"
8 #include "vm/exceptions.h" 8 #include "vm/exceptions.h"
9 #include "vm/native_entry.h" 9 #include "vm/native_entry.h"
10 #include "vm/object.h" 10 #include "vm/object.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 uint64_t value; \ 112 uint64_t value; \
113 ByteArray::Copy(&value, array, index.Value(), sizeof(uint64_t)); \ 113 ByteArray::Copy(&value, array, index.Value(), sizeof(uint64_t)); \
114 Integer& result = Integer::Handle(); \ 114 Integer& result = Integer::Handle(); \
115 UINT64_TO_INTEGER(value, result); \ 115 UINT64_TO_INTEGER(value, result); \
116 return result.raw(); 116 return result.raw();
117 117
118 118
119 #define INTEGER_TO_UINT64(integer, uint64) \ 119 #define INTEGER_TO_UINT64(integer, uint64) \
120 if (integer.IsBigint()) { \ 120 if (integer.IsBigint()) { \
121 Bigint& bigint = Bigint::Handle(); \ 121 Bigint& bigint = Bigint::Handle(); \
122 bigint |= integer.raw(); \ 122 bigint ^= integer.raw(); \
123 ASSERT(BigintOperations::FitsIntoUint64(bigint)); \ 123 ASSERT(BigintOperations::FitsIntoUint64(bigint)); \
124 value = BigintOperations::AbsToUint64(bigint); \ 124 value = BigintOperations::AbsToUint64(bigint); \
125 } else { \ 125 } else { \
126 ASSERT(integer.IsMint() || integer.IsSmi()); \ 126 ASSERT(integer.IsMint() || integer.IsSmi()); \
127 value = integer.AsInt64Value(); \ 127 value = integer.AsInt64Value(); \
128 } \ 128 } \
129 129
130 130
131 #define SETTER_UINT64(ArrayT) \ 131 #define SETTER_UINT64(ArrayT) \
132 SETTER_ARGUMENTS(ArrayT, Integer, uint64_t); \ 132 SETTER_ARGUMENTS(ArrayT, Integer, uint64_t); \
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after
775 DEFINE_NATIVE_ENTRY(ExternalFloat64Array_getIndexed, 2) { 775 DEFINE_NATIVE_ENTRY(ExternalFloat64Array_getIndexed, 2) {
776 GETTER(ExternalFloat64Array, Double, double); 776 GETTER(ExternalFloat64Array, Double, double);
777 } 777 }
778 778
779 779
780 DEFINE_NATIVE_ENTRY(ExternalFloat64Array_setIndexed, 3) { 780 DEFINE_NATIVE_ENTRY(ExternalFloat64Array_setIndexed, 3) {
781 SETTER(ExternalFloat64Array, Double, value, double); 781 SETTER(ExternalFloat64Array, Double, value, double);
782 } 782 }
783 783
784 } // namespace dart 784 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | lib/integers.cc » ('j') | vm/object.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698