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

Side by Side Diff: runtime/vm/dart_api_impl.cc

Issue 2992783002: [vm] Rename Integer::IsValidUint64 to IsValueInRange for clarity (Closed)
Patch Set: Created 3 years, 4 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
« no previous file with comments | « no previous file | runtime/vm/object.h » ('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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 #include "include/dart_api.h" 5 #include "include/dart_api.h"
6 #include "include/dart_mirrors_api.h" 6 #include "include/dart_mirrors_api.h"
7 #include "include/dart_native_api.h" 7 #include "include/dart_native_api.h"
8 8
9 #include "lib/stacktrace.h" 9 #include "lib/stacktrace.h"
10 #include "platform/assert.h" 10 #include "platform/assert.h"
(...skipping 2072 matching lines...) Expand 10 before | Expand all | Expand 10 after
2083 // Slow path for Mints and Bigints. 2083 // Slow path for Mints and Bigints.
2084 DARTSCOPE(thread); 2084 DARTSCOPE(thread);
2085 CHECK_CALLBACK_STATE(thread); 2085 CHECK_CALLBACK_STATE(thread);
2086 return Api::NewHandle(thread, Integer::New(value)); 2086 return Api::NewHandle(thread, Integer::New(value));
2087 } 2087 }
2088 2088
2089 DART_EXPORT Dart_Handle Dart_NewIntegerFromUint64(uint64_t value) { 2089 DART_EXPORT Dart_Handle Dart_NewIntegerFromUint64(uint64_t value) {
2090 DARTSCOPE(Thread::Current()); 2090 DARTSCOPE(Thread::Current());
2091 CHECK_CALLBACK_STATE(T); 2091 CHECK_CALLBACK_STATE(T);
2092 API_TIMELINE_DURATION; 2092 API_TIMELINE_DURATION;
2093 if (Integer::IsValidUint64(value)) { 2093 if (Integer::IsValueInRange(value)) {
2094 return Api::NewHandle(T, Integer::NewFromUint64(value)); 2094 return Api::NewHandle(T, Integer::NewFromUint64(value));
2095 } 2095 }
2096 return Api::NewError("%s: Cannot create Dart integer from value %" Pu64, 2096 return Api::NewError("%s: Cannot create Dart integer from value %" Pu64,
2097 CURRENT_FUNC, value); 2097 CURRENT_FUNC, value);
2098 } 2098 }
2099 2099
2100 DART_EXPORT Dart_Handle Dart_NewIntegerFromHexCString(const char* str) { 2100 DART_EXPORT Dart_Handle Dart_NewIntegerFromHexCString(const char* str) {
2101 DARTSCOPE(Thread::Current()); 2101 DARTSCOPE(Thread::Current());
2102 CHECK_CALLBACK_STATE(T); 2102 CHECK_CALLBACK_STATE(T);
2103 API_TIMELINE_DURATION; 2103 API_TIMELINE_DURATION;
(...skipping 4641 matching lines...) Expand 10 before | Expand all | Expand 10 after
6745 #endif 6745 #endif
6746 } 6746 }
6747 6747
6748 DART_EXPORT void Dart_DumpNativeStackTrace(void* context) { 6748 DART_EXPORT void Dart_DumpNativeStackTrace(void* context) {
6749 #ifndef PRODUCT 6749 #ifndef PRODUCT
6750 Profiler::DumpStackTrace(context); 6750 Profiler::DumpStackTrace(context);
6751 #endif 6751 #endif
6752 } 6752 }
6753 6753
6754 } // namespace dart 6754 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698