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

Side by Side Diff: runtime/vm/dart_api_message.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/dart_api_impl_test.cc ('k') | runtime/vm/intermediate_language_ia32.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 (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/dart_api_message.h" 5 #include "vm/dart_api_message.h"
6 #include "vm/object.h" 6 #include "vm/object.h"
7 #include "vm/snapshot_ids.h" 7 #include "vm/snapshot_ids.h"
8 #include "vm/symbols.h" 8 #include "vm/symbols.h"
9 #include "vm/unicode.h" 9 #include "vm/unicode.h"
10 10
(...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after
863 // to other processes. 863 // to other processes.
864 864
865 // Write out serialization header value for this object. 865 // Write out serialization header value for this object.
866 WriteInlinedHeader(object); 866 WriteInlinedHeader(object);
867 // Write out the class and tag information. 867 // Write out the class and tag information.
868 WriteIndexedObject(kExternalUint8ArrayCid); 868 WriteIndexedObject(kExternalUint8ArrayCid);
869 WriteIntptrValue(0); 869 WriteIntptrValue(0);
870 int length = object->value.as_external_byte_array.length; 870 int length = object->value.as_external_byte_array.length;
871 uint8_t* data = object->value.as_external_byte_array.data; 871 uint8_t* data = object->value.as_external_byte_array.data;
872 void* peer = object->value.as_external_byte_array.peer; 872 void* peer = object->value.as_external_byte_array.peer;
873 Dart_PeerFinalizer callback = 873 Dart_WeakPersistentHandleFinalizer callback =
874 object->value.as_external_byte_array.callback; 874 object->value.as_external_byte_array.callback;
875 WriteSmi(length); 875 WriteSmi(length);
876 WriteIntptrValue(reinterpret_cast<intptr_t>(data)); 876 WriteIntptrValue(reinterpret_cast<intptr_t>(data));
877 WriteIntptrValue(reinterpret_cast<intptr_t>(peer)); 877 WriteIntptrValue(reinterpret_cast<intptr_t>(peer));
878 WriteIntptrValue(reinterpret_cast<intptr_t>(callback)); 878 WriteIntptrValue(reinterpret_cast<intptr_t>(callback));
879 break; 879 break;
880 } 880 }
881 default: 881 default:
882 UNREACHABLE(); 882 UNREACHABLE();
883 } 883 }
(...skipping 16 matching lines...) Expand all
900 if (!success) { 900 if (!success) {
901 UnmarkAllCObjects(object); 901 UnmarkAllCObjects(object);
902 return false; 902 return false;
903 } 903 }
904 } 904 }
905 UnmarkAllCObjects(object); 905 UnmarkAllCObjects(object);
906 return true; 906 return true;
907 } 907 }
908 908
909 } // namespace dart 909 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698