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

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

Issue 10897014: Performance improvement for the Dart VM runtime method (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
« runtime/vm/dart_api_impl.cc ('K') | « 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 Dart_Handle Dart_ExternalStringGetPeer(Dart_Handle, void**);
1129 Dart_Handle Dart_ExternalStringGetPeer(Dart_Handle, void**);
1130 }
1131
1132
1126 class RawExternalOneByteString : public RawString { 1133 class RawExternalOneByteString : public RawString {
1127 RAW_HEAP_OBJECT_IMPLEMENTATION(ExternalOneByteString); 1134 RAW_HEAP_OBJECT_IMPLEMENTATION(ExternalOneByteString);
1128 1135
1129 ExternalStringData<uint8_t>* external_data_; 1136 ExternalStringData<uint8_t>* external_data_;
1137 friend Dart_Handle Dart_ExternalStringGetPeer(Dart_Handle o, void**);
Ivan Posva 2012/08/28 22:21:20 Please remove the o to be consistent. Also can you
Tom Ball 2012/08/29 00:16:39 The 'o' is removed, but I think the block declarat
1130 }; 1138 };
1131 1139
1132 1140
1133 class RawExternalTwoByteString : public RawString { 1141 class RawExternalTwoByteString : public RawString {
1134 RAW_HEAP_OBJECT_IMPLEMENTATION(ExternalTwoByteString); 1142 RAW_HEAP_OBJECT_IMPLEMENTATION(ExternalTwoByteString);
1135 1143
1136 ExternalStringData<uint16_t>* external_data_; 1144 ExternalStringData<uint16_t>* external_data_;
1145 friend Dart_Handle Dart_ExternalStringGetPeer(Dart_Handle, void**);
1137 }; 1146 };
1138 1147
1139 1148
1140 class RawExternalFourByteString : public RawString { 1149 class RawExternalFourByteString : public RawString {
1141 RAW_HEAP_OBJECT_IMPLEMENTATION(ExternalFourByteString); 1150 RAW_HEAP_OBJECT_IMPLEMENTATION(ExternalFourByteString);
1142 1151
1143 ExternalStringData<uint32_t>* external_data_; 1152 ExternalStringData<uint32_t>* external_data_;
1153 friend Dart_Handle Dart_ExternalStringGetPeer(Dart_Handle, void**);
1144 }; 1154 };
1145 1155
1146 1156
1147 class RawBool : public RawInstance { 1157 class RawBool : public RawInstance {
1148 RAW_HEAP_OBJECT_IMPLEMENTATION(Bool); 1158 RAW_HEAP_OBJECT_IMPLEMENTATION(Bool);
1149 1159
1150 bool value_; 1160 bool value_;
1151 }; 1161 };
1152 1162
1153 1163
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
1580 kExternalUint64ArrayCid == kByteArrayCid + 18 && 1590 kExternalUint64ArrayCid == kByteArrayCid + 18 &&
1581 kExternalFloat32ArrayCid == kByteArrayCid + 19 && 1591 kExternalFloat32ArrayCid == kByteArrayCid + 19 &&
1582 kExternalFloat64ArrayCid == kByteArrayCid + 20 && 1592 kExternalFloat64ArrayCid == kByteArrayCid + 20 &&
1583 kStacktraceCid == kByteArrayCid + 21); 1593 kStacktraceCid == kByteArrayCid + 21);
1584 return (index >= kByteArrayCid && index <= kExternalFloat64ArrayCid); 1594 return (index >= kByteArrayCid && index <= kExternalFloat64ArrayCid);
1585 } 1595 }
1586 1596
1587 } // namespace dart 1597 } // namespace dart
1588 1598
1589 #endif // VM_RAW_OBJECT_H_ 1599 #endif // VM_RAW_OBJECT_H_
OLDNEW
« runtime/vm/dart_api_impl.cc ('K') | « runtime/vm/dart_api_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698