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

Unified Diff: src/runtime.cc

Issue 501323002: Replace our homegrown ARRAY_SIZE() with Chrome's arraysize(). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« src/base/macros.h ('K') | « src/parser.cc ('k') | src/serialize.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index 63a57e96d0b2eb6c6d866edcf36b381bd73e46b0..0628ce44f3e06a38a7e8497839ab8239871de10c 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -290,7 +290,7 @@ MUST_USE_RESULT static MaybeHandle<Object> CreateObjectLiteralBoilerplate(
DCHECK(key->IsNumber());
double num = key->Number();
char arr[100];
- Vector<char> buffer(arr, ARRAY_SIZE(arr));
+ Vector<char> buffer(arr, arraysize(arr));
const char* str = DoubleToCString(num, buffer);
Handle<String> name = isolate->factory()->NewStringFromAsciiChecked(str);
maybe_result = JSObject::SetOwnPropertyIgnoreAttributes(boilerplate, name,
@@ -14333,7 +14333,7 @@ RUNTIME_FUNCTION(Runtime_StringNormalize) {
CONVERT_ARG_HANDLE_CHECKED(String, stringValue, 0);
CONVERT_NUMBER_CHECKED(int, form_id, Int32, args[1]);
RUNTIME_ASSERT(form_id >= 0 &&
- static_cast<size_t>(form_id) < ARRAY_SIZE(normalizationForms));
+ static_cast<size_t>(form_id) < arraysize(normalizationForms));
v8::String::Value string_value(v8::Utils::ToLocal(stringValue));
const UChar* u_value = reinterpret_cast<const UChar*>(*string_value);
@@ -14719,7 +14719,7 @@ RUNTIME_FUNCTION(Runtime_GetFromCache) {
Handle<Object> argv[] = { key_handle };
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
isolate, value,
- Execution::Call(isolate, factory, receiver, ARRAY_SIZE(argv), argv));
+ Execution::Call(isolate, factory, receiver, arraysize(argv), argv));
}
#ifdef VERIFY_HEAP
@@ -15643,7 +15643,7 @@ const Runtime::Function* Runtime::FunctionForName(Handle<String> name) {
const Runtime::Function* Runtime::FunctionForEntry(Address entry) {
- for (size_t i = 0; i < ARRAY_SIZE(kIntrinsicFunctions); ++i) {
+ for (size_t i = 0; i < arraysize(kIntrinsicFunctions); ++i) {
if (entry == kIntrinsicFunctions[i].entry) {
return &(kIntrinsicFunctions[i]);
}
« src/base/macros.h ('K') | « src/parser.cc ('k') | src/serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698