| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/builtins.h" | 5 #include "src/builtins.h" |
| 6 | 6 |
| 7 #include "src/api.h" | 7 #include "src/api.h" |
| 8 #include "src/api-natives.h" | 8 #include "src/api-natives.h" |
| 9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
| 10 #include "src/base/once.h" | 10 #include "src/base/once.h" |
| (...skipping 2336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2347 DCHECK_EQ(2, args.length()); | 2347 DCHECK_EQ(2, args.length()); |
| 2348 CHECK_RECEIVER(JSReceiver, receiver, "Date.prototype [ @@toPrimitive ]"); | 2348 CHECK_RECEIVER(JSReceiver, receiver, "Date.prototype [ @@toPrimitive ]"); |
| 2349 Handle<Object> hint = args.at<Object>(1); | 2349 Handle<Object> hint = args.at<Object>(1); |
| 2350 Handle<Object> result; | 2350 Handle<Object> result; |
| 2351 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, | 2351 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, |
| 2352 JSDate::ToPrimitive(receiver, hint)); | 2352 JSDate::ToPrimitive(receiver, hint)); |
| 2353 return *result; | 2353 return *result; |
| 2354 } | 2354 } |
| 2355 | 2355 |
| 2356 | 2356 |
| 2357 // static |
| 2358 void Builtins::Generate_DatePrototypeGetDate(MacroAssembler* masm) { |
| 2359 Generate_DatePrototype_GetField(masm, JSDate::kDay); |
| 2360 } |
| 2361 |
| 2362 |
| 2363 // static |
| 2364 void Builtins::Generate_DatePrototypeGetDay(MacroAssembler* masm) { |
| 2365 Generate_DatePrototype_GetField(masm, JSDate::kWeekday); |
| 2366 } |
| 2367 |
| 2368 |
| 2369 // static |
| 2370 void Builtins::Generate_DatePrototypeGetFullYear(MacroAssembler* masm) { |
| 2371 Generate_DatePrototype_GetField(masm, JSDate::kYear); |
| 2372 } |
| 2373 |
| 2374 |
| 2375 // static |
| 2376 void Builtins::Generate_DatePrototypeGetHours(MacroAssembler* masm) { |
| 2377 Generate_DatePrototype_GetField(masm, JSDate::kHour); |
| 2378 } |
| 2379 |
| 2380 |
| 2381 // static |
| 2382 void Builtins::Generate_DatePrototypeGetMilliseconds(MacroAssembler* masm) { |
| 2383 Generate_DatePrototype_GetField(masm, JSDate::kMillisecond); |
| 2384 } |
| 2385 |
| 2386 |
| 2387 // static |
| 2388 void Builtins::Generate_DatePrototypeGetMinutes(MacroAssembler* masm) { |
| 2389 Generate_DatePrototype_GetField(masm, JSDate::kMinute); |
| 2390 } |
| 2391 |
| 2392 |
| 2393 // static |
| 2394 void Builtins::Generate_DatePrototypeGetMonth(MacroAssembler* masm) { |
| 2395 Generate_DatePrototype_GetField(masm, JSDate::kMonth); |
| 2396 } |
| 2397 |
| 2398 |
| 2399 // static |
| 2400 void Builtins::Generate_DatePrototypeGetSeconds(MacroAssembler* masm) { |
| 2401 Generate_DatePrototype_GetField(masm, JSDate::kSecond); |
| 2402 } |
| 2403 |
| 2404 |
| 2405 // static |
| 2406 void Builtins::Generate_DatePrototypeGetTime(MacroAssembler* masm) { |
| 2407 Generate_DatePrototype_GetField(masm, JSDate::kDateValue); |
| 2408 } |
| 2409 |
| 2410 |
| 2411 // static |
| 2412 void Builtins::Generate_DatePrototypeGetTimezoneOffset(MacroAssembler* masm) { |
| 2413 Generate_DatePrototype_GetField(masm, JSDate::kTimezoneOffset); |
| 2414 } |
| 2415 |
| 2416 |
| 2417 // static |
| 2418 void Builtins::Generate_DatePrototypeGetUTCDate(MacroAssembler* masm) { |
| 2419 Generate_DatePrototype_GetField(masm, JSDate::kDayUTC); |
| 2420 } |
| 2421 |
| 2422 |
| 2423 // static |
| 2424 void Builtins::Generate_DatePrototypeGetUTCDay(MacroAssembler* masm) { |
| 2425 Generate_DatePrototype_GetField(masm, JSDate::kWeekdayUTC); |
| 2426 } |
| 2427 |
| 2428 |
| 2429 // static |
| 2430 void Builtins::Generate_DatePrototypeGetUTCFullYear(MacroAssembler* masm) { |
| 2431 Generate_DatePrototype_GetField(masm, JSDate::kYearUTC); |
| 2432 } |
| 2433 |
| 2434 |
| 2435 // static |
| 2436 void Builtins::Generate_DatePrototypeGetUTCHours(MacroAssembler* masm) { |
| 2437 Generate_DatePrototype_GetField(masm, JSDate::kHourUTC); |
| 2438 } |
| 2439 |
| 2440 |
| 2441 // static |
| 2442 void Builtins::Generate_DatePrototypeGetUTCMilliseconds(MacroAssembler* masm) { |
| 2443 Generate_DatePrototype_GetField(masm, JSDate::kMillisecondUTC); |
| 2444 } |
| 2445 |
| 2446 |
| 2447 // static |
| 2448 void Builtins::Generate_DatePrototypeGetUTCMinutes(MacroAssembler* masm) { |
| 2449 Generate_DatePrototype_GetField(masm, JSDate::kMinuteUTC); |
| 2450 } |
| 2451 |
| 2452 |
| 2453 // static |
| 2454 void Builtins::Generate_DatePrototypeGetUTCMonth(MacroAssembler* masm) { |
| 2455 Generate_DatePrototype_GetField(masm, JSDate::kMonthUTC); |
| 2456 } |
| 2457 |
| 2458 |
| 2459 // static |
| 2460 void Builtins::Generate_DatePrototypeGetUTCSeconds(MacroAssembler* masm) { |
| 2461 Generate_DatePrototype_GetField(masm, JSDate::kSecondUTC); |
| 2462 } |
| 2463 |
| 2464 |
| 2357 namespace { | 2465 namespace { |
| 2358 | 2466 |
| 2359 // ES6 section 19.2.1.1.1 CreateDynamicFunction | 2467 // ES6 section 19.2.1.1.1 CreateDynamicFunction |
| 2360 MaybeHandle<JSFunction> CreateDynamicFunction( | 2468 MaybeHandle<JSFunction> CreateDynamicFunction( |
| 2361 Isolate* isolate, | 2469 Isolate* isolate, |
| 2362 BuiltinArguments<BuiltinExtraArguments::kTargetAndNewTarget> args, | 2470 BuiltinArguments<BuiltinExtraArguments::kTargetAndNewTarget> args, |
| 2363 const char* token) { | 2471 const char* token) { |
| 2364 // Compute number of arguments, ignoring the receiver. | 2472 // Compute number of arguments, ignoring the receiver. |
| 2365 DCHECK_LE(1, args.length()); | 2473 DCHECK_LE(1, args.length()); |
| 2366 int const argc = args.length() - 1; | 2474 int const argc = args.length() - 1; |
| (...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3311 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) | 3419 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) |
| 3312 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) | 3420 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) |
| 3313 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) | 3421 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) |
| 3314 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) | 3422 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) |
| 3315 #undef DEFINE_BUILTIN_ACCESSOR_C | 3423 #undef DEFINE_BUILTIN_ACCESSOR_C |
| 3316 #undef DEFINE_BUILTIN_ACCESSOR_A | 3424 #undef DEFINE_BUILTIN_ACCESSOR_A |
| 3317 | 3425 |
| 3318 | 3426 |
| 3319 } // namespace internal | 3427 } // namespace internal |
| 3320 } // namespace v8 | 3428 } // namespace v8 |
| OLD | NEW |