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

Side by Side Diff: src/runtime/runtime-date.cc

Issue 983623002: Made the entries of the various *_FUNCTION_LISTs disjoint. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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
« no previous file with comments | « src/runtime/runtime-classes.cc ('k') | src/runtime/runtime-debug.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/date.h" 8 #include "src/date.h"
9 #include "src/dateparser-inl.h" 9 #include "src/dateparser-inl.h"
10 #include "src/runtime/runtime-utils.h" 10 #include "src/runtime/runtime-utils.h"
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 Handle<FixedArray>::cast(isolate->eternal_handles()->GetSingleton( 163 Handle<FixedArray>::cast(isolate->eternal_handles()->GetSingleton(
164 EternalHandles::DATE_CACHE_VERSION)); 164 EternalHandles::DATE_CACHE_VERSION));
165 // Return result as a JS array. 165 // Return result as a JS array.
166 Handle<JSObject> result = 166 Handle<JSObject> result =
167 isolate->factory()->NewJSObject(isolate->array_function()); 167 isolate->factory()->NewJSObject(isolate->array_function());
168 JSArray::SetContent(Handle<JSArray>::cast(result), date_cache_version); 168 JSArray::SetContent(Handle<JSArray>::cast(result), date_cache_version);
169 return *result; 169 return *result;
170 } 170 }
171 171
172 172
173 RUNTIME_FUNCTION(RuntimeReference_DateField) { 173 RUNTIME_FUNCTION(Runtime_DateField) {
174 SealHandleScope shs(isolate); 174 SealHandleScope shs(isolate);
175 DCHECK(args.length() == 2); 175 DCHECK(args.length() == 2);
176 CONVERT_ARG_CHECKED(Object, obj, 0); 176 CONVERT_ARG_CHECKED(Object, obj, 0);
177 CONVERT_SMI_ARG_CHECKED(index, 1); 177 CONVERT_SMI_ARG_CHECKED(index, 1);
178 if (!obj->IsJSDate()) { 178 if (!obj->IsJSDate()) {
179 HandleScope scope(isolate); 179 HandleScope scope(isolate);
180 THROW_NEW_ERROR_RETURN_FAILURE( 180 THROW_NEW_ERROR_RETURN_FAILURE(
181 isolate, 181 isolate,
182 NewTypeError("not_date_object", HandleVector<Object>(NULL, 0))); 182 NewTypeError("not_date_object", HandleVector<Object>(NULL, 0)));
183 } 183 }
184 JSDate* date = JSDate::cast(obj); 184 JSDate* date = JSDate::cast(obj);
185 if (index == 0) return date->value(); 185 if (index == 0) return date->value();
186 return JSDate::GetField(date, Smi::FromInt(index)); 186 return JSDate::GetField(date, Smi::FromInt(index));
187 } 187 }
188 } 188 }
189 } // namespace v8::internal 189 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime/runtime-classes.cc ('k') | src/runtime/runtime-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698