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

Side by Side Diff: runtime/vm/snapshot_test.cc

Issue 12093071: - Change the layout of external typed array objects to avoid the extra indirection when accessing e… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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 | « runtime/vm/snapshot.cc ('k') | no next file » | no next file with comments »
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 "include/dart_debugger_api.h" 5 #include "include/dart_debugger_api.h"
6 #include "platform/assert.h" 6 #include "platform/assert.h"
7 #include "vm/bigint_operations.h" 7 #include "vm/bigint_operations.h"
8 #include "vm/class_finalizer.h" 8 #include "vm/class_finalizer.h"
9 #include "vm/dart_api_impl.h" 9 #include "vm/dart_api_impl.h"
10 #include "vm/dart_api_message.h" 10 #include "vm/dart_api_message.h"
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 } \ 662 } \
663 } 663 }
664 664
665 665
666 #define TEST_EXTERNAL_TYPED_ARRAY(darttype, ctype) \ 666 #define TEST_EXTERNAL_TYPED_ARRAY(darttype, ctype) \
667 { \ 667 { \
668 StackZone zone(Isolate::Current()); \ 668 StackZone zone(Isolate::Current()); \
669 ctype data[] = { 0, 11, 22, 33, 44, 55, 66, 77 }; \ 669 ctype data[] = { 0, 11, 22, 33, 44, 55, 66, 77 }; \
670 intptr_t length = ARRAY_SIZE(data); \ 670 intptr_t length = ARRAY_SIZE(data); \
671 External##darttype& array = External##darttype::Handle( \ 671 External##darttype& array = External##darttype::Handle( \
672 External##darttype::New(data, length, NULL, NULL)); \ 672 External##darttype::New(data, length)); \
673 uint8_t* buffer; \ 673 uint8_t* buffer; \
674 MessageWriter writer(&buffer, &zone_allocator); \ 674 MessageWriter writer(&buffer, &zone_allocator); \
675 writer.WriteMessage(array); \ 675 writer.WriteMessage(array); \
676 intptr_t buffer_len = writer.BytesWritten(); \ 676 intptr_t buffer_len = writer.BytesWritten(); \
677 SnapshotReader reader(buffer, buffer_len, \ 677 SnapshotReader reader(buffer, buffer_len, \
678 Snapshot::kMessage, Isolate::Current()); \ 678 Snapshot::kMessage, Isolate::Current()); \
679 darttype& serialized_array = darttype::Handle(); \ 679 darttype& serialized_array = darttype::Handle(); \
680 serialized_array ^= reader.ReadObject(); \ 680 serialized_array ^= reader.ReadObject(); \
681 for (int i = 0; i < length; i++) { \ 681 for (int i = 0; i < length; i++) { \
682 EXPECT_EQ(static_cast<ctype>(data[i]), serialized_array.At(i)); \ 682 EXPECT_EQ(static_cast<ctype>(data[i]), serialized_array.At(i)); \
(...skipping 1513 matching lines...) Expand 10 before | Expand all | Expand 10 after
2196 EXPECT(Dart_ErrorHasException(result)); 2196 EXPECT(Dart_ErrorHasException(result));
2197 EXPECT_SUBSTRING("Exception: nulltruefalse123456æøå3.14[]100123456789\n", 2197 EXPECT_SUBSTRING("Exception: nulltruefalse123456æøå3.14[]100123456789\n",
2198 Dart_GetError(result)); 2198 Dart_GetError(result));
2199 2199
2200 Dart_ExitScope(); 2200 Dart_ExitScope();
2201 } 2201 }
2202 2202
2203 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). 2203 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64).
2204 2204
2205 } // namespace dart 2205 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/snapshot.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698