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

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

Issue 12881006: Add the native intrinsic TypedData_setRange to optimize the setRange call when the destination and … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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/bootstrap_natives.h ('k') | runtime/vm/object.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 #ifndef VM_OBJECT_H_ 5 #ifndef VM_OBJECT_H_
6 #define VM_OBJECT_H_ 6 #define VM_OBJECT_H_
7 7
8 #include "include/dart_api.h" 8 #include "include/dart_api.h"
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "platform/utils.h" 10 #include "platform/utils.h"
(...skipping 4973 matching lines...) Expand 10 before | Expand all | Expand 10 after
4984 4984
4985 static intptr_t MaxElements(intptr_t class_id) { 4985 static intptr_t MaxElements(intptr_t class_id) {
4986 ASSERT(RawObject::IsTypedDataClassId(class_id)); 4986 ASSERT(RawObject::IsTypedDataClassId(class_id));
4987 return (kSmiMax / ElementSizeInBytes(class_id)); 4987 return (kSmiMax / ElementSizeInBytes(class_id));
4988 } 4988 }
4989 4989
4990 static RawTypedData* New(intptr_t class_id, 4990 static RawTypedData* New(intptr_t class_id,
4991 intptr_t len, 4991 intptr_t len,
4992 Heap::Space space = Heap::kNew); 4992 Heap::Space space = Heap::kNew);
4993 4993
4994 static void Copy(const TypedData& dst,
4995 intptr_t dst_offset_in_bytes,
4996 const TypedData& src,
4997 intptr_t src_offset_in_bytes,
4998 intptr_t length_in_bytes);
4999
4994 protected: 5000 protected:
4995 void SetLength(intptr_t value) const { 5001 void SetLength(intptr_t value) const {
4996 raw_ptr()->length_ = Smi::New(value); 5002 raw_ptr()->length_ = Smi::New(value);
4997 } 5003 }
4998 5004
4999 private: 5005 private:
5000 static const intptr_t element_size[]; 5006 static const intptr_t element_size[];
5001 5007
5002 FINAL_HEAP_OBJECT_IMPLEMENTATION(TypedData, Instance); 5008 FINAL_HEAP_OBJECT_IMPLEMENTATION(TypedData, Instance);
5003 friend class Class; 5009 friend class Class;
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
5072 static intptr_t MaxElements(intptr_t class_id) { 5078 static intptr_t MaxElements(intptr_t class_id) {
5073 ASSERT(RawObject::IsExternalTypedDataClassId(class_id)); 5079 ASSERT(RawObject::IsExternalTypedDataClassId(class_id));
5074 return (kSmiMax / ElementSizeInBytes(class_id)); 5080 return (kSmiMax / ElementSizeInBytes(class_id));
5075 } 5081 }
5076 5082
5077 static RawExternalTypedData* New(intptr_t class_id, 5083 static RawExternalTypedData* New(intptr_t class_id,
5078 uint8_t* data, 5084 uint8_t* data,
5079 intptr_t len, 5085 intptr_t len,
5080 Heap::Space space = Heap::kNew); 5086 Heap::Space space = Heap::kNew);
5081 5087
5088 static void Copy(const ExternalTypedData& dst,
5089 intptr_t dst_offset_in_bytes,
5090 const ExternalTypedData& src,
5091 intptr_t src_offset_in_bytes,
5092 intptr_t length_in_bytes);
5093
5082 protected: 5094 protected:
5083 void SetLength(intptr_t value) const { 5095 void SetLength(intptr_t value) const {
5084 raw_ptr()->length_ = Smi::New(value); 5096 raw_ptr()->length_ = Smi::New(value);
5085 } 5097 }
5086 5098
5087 void SetData(uint8_t* data) const { 5099 void SetData(uint8_t* data) const {
5088 raw_ptr()->data_ = data; 5100 raw_ptr()->data_ = data;
5089 } 5101 }
5090 5102
5091 void SetPeer(void* peer) const { 5103 void SetPeer(void* peer) const {
(...skipping 1741 matching lines...) Expand 10 before | Expand all | Expand 10 after
6833 6845
6834 6846
6835 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 6847 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
6836 intptr_t index) { 6848 intptr_t index) {
6837 return array.At((index * kEntryLength) + kTargetFunctionIndex); 6849 return array.At((index * kEntryLength) + kTargetFunctionIndex);
6838 } 6850 }
6839 6851
6840 } // namespace dart 6852 } // namespace dart
6841 6853
6842 #endif // VM_OBJECT_H_ 6854 #endif // VM_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/bootstrap_natives.h ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698