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

Unified Diff: runtime/lib/byte_array.cc

Issue 10535178: Document the ByteArray types and reconcile with the implementation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: address review comments Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/lib/byte_array.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/byte_array.cc
diff --git a/runtime/lib/byte_array.cc b/runtime/lib/byte_array.cc
index f9a993a8e48a87e4a7f23ce898066bd11018d3aa..f105320b99dd47069bb946ab9410e9b11729f069 100644
--- a/runtime/lib/byte_array.cc
+++ b/runtime/lib/byte_array.cc
@@ -61,8 +61,11 @@ static void RangeCheck(const ByteArray& array,
#define UNALIGNED_SETTER(ArrayT, ObjectT, Getter, ValueT) \
SETTER_ARGUMENTS(ArrayT, ObjectT, ValueT); \
RangeCheck(array, index.Value(), sizeof(ValueT)); \
- ValueT src = value_object.Getter(); \
- ByteArray::Copy(array, index.Value(), &src, sizeof(ValueT));
+ ValueT src = value_object.Getter(); \
+ ByteArray::Copy(array, index.Value(), &src, sizeof(ValueT)); \
+ Integer& result = Integer::Handle(); \
+ result ^= Integer::New(index.Value() + sizeof(ValueT)); \
+ arguments->SetReturn(result);
#define UINT64_TO_INTEGER(value, integer) \
@@ -121,7 +124,10 @@ static void RangeCheck(const ByteArray& array,
RangeCheck(array, index.Value(), sizeof(uint64_t)); \
uint64_t value; \
INTEGER_TO_UINT64(value_object, value); \
- ByteArray::Copy(array, index.Value(), &value, sizeof(uint64_t));
+ ByteArray::Copy(array, index.Value(), &value, sizeof(uint64_t)); \
+ Integer& result = Integer::Handle(); \
+ result ^= Integer::New(index.Value() + sizeof(uint64_t)); \
+ arguments->SetReturn(result);
DEFINE_NATIVE_ENTRY(ByteArray_getLength, 1) {
« no previous file with comments | « no previous file | runtime/lib/byte_array.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698