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

Unified Diff: runtime/lib/typed_data.cc

Issue 1782003002: Simplify the VM's typed_data constructors. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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/lib/typed_data.dart » ('j') | runtime/lib/typed_data.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/typed_data.cc
diff --git a/runtime/lib/typed_data.cc b/runtime/lib/typed_data.cc
index 28b8147f0ffc5632a0b21b299b560454d5c550e7..f1389231a9b2b1dcfbb3c1e04cadc1e7c2b09444 100644
--- a/runtime/lib/typed_data.cc
+++ b/runtime/lib/typed_data.cc
@@ -164,8 +164,8 @@ DEFINE_NATIVE_ENTRY(TypedData_setRange, 7) {
// maximum possible length is a scaled value of kSmiMax which is set up based
// on whether the underlying architecture is 32-bit or 64-bit.
#define TYPED_DATA_NEW(name) \
-DEFINE_NATIVE_ENTRY(TypedData_##name##_new, 1) { \
- GET_NON_NULL_NATIVE_ARGUMENT(Smi, length, arguments->NativeArgAt(0)); \
+DEFINE_NATIVE_ENTRY(TypedData_##name##_new, 2) { \
+ GET_NON_NULL_NATIVE_ARGUMENT(Smi, length, arguments->NativeArgAt(1)); \
siva 2016/03/10 08:22:53 Can you add a comment that the first argument is t
Florian Schneider 2016/03/10 08:37:17 Done.
intptr_t cid = kTypedData##name##Cid; \
intptr_t len = length.Value(); \
intptr_t max = TypedData::MaxElements(cid); \
@@ -179,9 +179,9 @@ DEFINE_NATIVE_ENTRY(TypedData_##name##_new, 1) { \
// maximum possible length is a scaled value of kSmiMax which is set up based
// on whether the underlying architecture is 32-bit or 64-bit.
#define EXT_TYPED_DATA_NEW(name) \
-DEFINE_NATIVE_ENTRY(ExternalTypedData_##name##_new, 1) { \
+DEFINE_NATIVE_ENTRY(ExternalTypedData_##name##_new, 2) { \
const int kAlignment = 16; \
- GET_NON_NULL_NATIVE_ARGUMENT(Smi, length, arguments->NativeArgAt(0)); \
+ GET_NON_NULL_NATIVE_ARGUMENT(Smi, length, arguments->NativeArgAt(1)); \
intptr_t cid = kExternalTypedData##name##Cid; \
intptr_t len = length.Value(); \
intptr_t max = ExternalTypedData::MaxElements(cid); \
« no previous file with comments | « no previous file | runtime/lib/typed_data.dart » ('j') | runtime/lib/typed_data.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698