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

Side by Side Diff: runtime/vm/raw_object.h

Issue 10891036: Reworked previous CL (ExternalStringGetPeer speed up) to avoid the (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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.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 #ifndef VM_RAW_OBJECT_H_ 5 #ifndef VM_RAW_OBJECT_H_
6 #define VM_RAW_OBJECT_H_ 6 #define VM_RAW_OBJECT_H_
7 7
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/globals.h" 9 #include "vm/globals.h"
10 #include "vm/token.h" 10 #include "vm/token.h"
(...skipping 1105 matching lines...) Expand 10 before | Expand all | Expand 10 after
1116 return peer_; 1116 return peer_;
1117 } 1117 }
1118 1118
1119 private: 1119 private:
1120 const T* data_; 1120 const T* data_;
1121 void* peer_; 1121 void* peer_;
1122 Dart_PeerFinalizer callback_; 1122 Dart_PeerFinalizer callback_;
1123 }; 1123 };
1124 1124
1125 1125
1126 DART_EXTERN_C {
1127 Dart_Handle Dart_ExternalStringGetPeer(Dart_Handle, void**);
1128 }
1129
1130
1131 class RawExternalOneByteString : public RawString { 1126 class RawExternalOneByteString : public RawString {
1132 RAW_HEAP_OBJECT_IMPLEMENTATION(ExternalOneByteString); 1127 RAW_HEAP_OBJECT_IMPLEMENTATION(ExternalOneByteString);
1133 1128
1134 ExternalStringData<uint8_t>* external_data_; 1129 ExternalStringData<uint8_t>* external_data_;
1135 friend Dart_Handle Dart_ExternalStringGetPeer(Dart_Handle, void**); 1130 friend bool ExternalStringGetPeerHelper(Dart_Handle, void**);
1136 }; 1131 };
1137 1132
1138 1133
1139 class RawExternalTwoByteString : public RawString { 1134 class RawExternalTwoByteString : public RawString {
1140 RAW_HEAP_OBJECT_IMPLEMENTATION(ExternalTwoByteString); 1135 RAW_HEAP_OBJECT_IMPLEMENTATION(ExternalTwoByteString);
1141 1136
1142 ExternalStringData<uint16_t>* external_data_; 1137 ExternalStringData<uint16_t>* external_data_;
1143 friend Dart_Handle Dart_ExternalStringGetPeer(Dart_Handle, void**); 1138 friend bool ExternalStringGetPeerHelper(Dart_Handle, void**);
1144 }; 1139 };
1145 1140
1146 1141
1147 class RawExternalFourByteString : public RawString { 1142 class RawExternalFourByteString : public RawString {
1148 RAW_HEAP_OBJECT_IMPLEMENTATION(ExternalFourByteString); 1143 RAW_HEAP_OBJECT_IMPLEMENTATION(ExternalFourByteString);
1149 1144
1150 ExternalStringData<uint32_t>* external_data_; 1145 ExternalStringData<uint32_t>* external_data_;
1151 friend Dart_Handle Dart_ExternalStringGetPeer(Dart_Handle, void**); 1146 friend bool ExternalStringGetPeerHelper(Dart_Handle, void**);
1152 }; 1147 };
1153 1148
1154 1149
1155 class RawBool : public RawInstance { 1150 class RawBool : public RawInstance {
1156 RAW_HEAP_OBJECT_IMPLEMENTATION(Bool); 1151 RAW_HEAP_OBJECT_IMPLEMENTATION(Bool);
1157 1152
1158 bool value_; 1153 bool value_;
1159 }; 1154 };
1160 1155
1161 1156
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
1588 kExternalUint64ArrayCid == kByteArrayCid + 18 && 1583 kExternalUint64ArrayCid == kByteArrayCid + 18 &&
1589 kExternalFloat32ArrayCid == kByteArrayCid + 19 && 1584 kExternalFloat32ArrayCid == kByteArrayCid + 19 &&
1590 kExternalFloat64ArrayCid == kByteArrayCid + 20 && 1585 kExternalFloat64ArrayCid == kByteArrayCid + 20 &&
1591 kStacktraceCid == kByteArrayCid + 21); 1586 kStacktraceCid == kByteArrayCid + 21);
1592 return (index >= kByteArrayCid && index <= kExternalFloat64ArrayCid); 1587 return (index >= kByteArrayCid && index <= kExternalFloat64ArrayCid);
1593 } 1588 }
1594 1589
1595 } // namespace dart 1590 } // namespace dart
1596 1591
1597 #endif // VM_RAW_OBJECT_H_ 1592 #endif // VM_RAW_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698