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

Unified Diff: runtime/lib/typeddata.cc

Issue 12547018: Add the allocator intrinsics for dart:typeddata implementation. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/intrinsifier.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/typeddata.cc
===================================================================
--- runtime/lib/typeddata.cc (revision 19729)
+++ runtime/lib/typeddata.cc (working copy)
@@ -71,7 +71,7 @@
GET_NON_NULL_NATIVE_ARGUMENT(Smi, length, arguments->NativeArgAt(0)); \
intptr_t cid = kTypedData##name##Cid; \
intptr_t len = length.Value(); \
- intptr_t max = (kSmiMax / TypedData::ElementSizeInBytes(cid)); \
+ intptr_t max = TypedData::MaxElements(cid); \
LengthCheck(len, max); \
return TypedData::New(cid, len); \
} \
@@ -87,7 +87,7 @@
GET_NON_NULL_NATIVE_ARGUMENT(Smi, length, arguments->NativeArgAt(0)); \
intptr_t cid = kExternalTypedData##name##Cid; \
intptr_t len = length.Value(); \
- intptr_t max = (kSmiMax / ExternalTypedData::ElementSizeInBytes(cid)); \
+ intptr_t max = ExternalTypedData::MaxElements(cid); \
LengthCheck(len, max); \
intptr_t len_bytes = len * ExternalTypedData::ElementSizeInBytes(cid); \
uint8_t* data = OS::AllocateAlignedArray<uint8_t>(len_bytes, kAlignment); \
« no previous file with comments | « no previous file | runtime/vm/intrinsifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698