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

Side by Side Diff: src/bootstrapper.cc

Issue 1567353002: [date] Migrate Date field accessors to native builtins. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Moar work. ports. Created 4 years, 11 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/arm64/builtins-arm64.cc ('k') | src/builtins.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 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/bootstrapper.h" 5 #include "src/bootstrapper.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api-natives.h" 8 #include "src/api-natives.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/extensions/externalize-string-extension.h" 10 #include "src/extensions/externalize-string-extension.h"
(...skipping 2531 matching lines...) Expand 10 before | Expand all | Expand 10 after
2542 SimpleInstallFunction(date_fun, "parse", Builtins::kDateParse, 1, false); 2542 SimpleInstallFunction(date_fun, "parse", Builtins::kDateParse, 1, false);
2543 SimpleInstallFunction(date_fun, "UTC", Builtins::kDateUTC, 7, false); 2543 SimpleInstallFunction(date_fun, "UTC", Builtins::kDateUTC, 7, false);
2544 2544
2545 // Install the "constructor" property on the {prototype}. 2545 // Install the "constructor" property on the {prototype}.
2546 JSObject::AddProperty(prototype, factory()->constructor_string(), date_fun, 2546 JSObject::AddProperty(prototype, factory()->constructor_string(), date_fun,
2547 DONT_ENUM); 2547 DONT_ENUM);
2548 2548
2549 // Install the toISOString and valueOf functions. 2549 // Install the toISOString and valueOf functions.
2550 SimpleInstallFunction(prototype, "toISOString", 2550 SimpleInstallFunction(prototype, "toISOString",
2551 Builtins::kDatePrototypeToISOString, 0, false); 2551 Builtins::kDatePrototypeToISOString, 0, false);
2552 SimpleInstallFunction(prototype, "getDate", Builtins::kDatePrototypeGetDate,
2553 0, true);
2554 SimpleInstallFunction(prototype, "getDay", Builtins::kDatePrototypeGetDay,
2555 0, true);
2556 SimpleInstallFunction(prototype, "getFullYear",
2557 Builtins::kDatePrototypeGetFullYear, 0, true);
2558 SimpleInstallFunction(prototype, "getHours",
2559 Builtins::kDatePrototypeGetHours, 0, true);
2560 SimpleInstallFunction(prototype, "getMilliseconds",
2561 Builtins::kDatePrototypeGetMilliseconds, 0, true);
2562 SimpleInstallFunction(prototype, "getMinutes",
2563 Builtins::kDatePrototypeGetMinutes, 0, true);
2564 SimpleInstallFunction(prototype, "getMonth",
2565 Builtins::kDatePrototypeGetMonth, 0, true);
2566 SimpleInstallFunction(prototype, "getSeconds",
2567 Builtins::kDatePrototypeGetSeconds, 0, true);
2568 SimpleInstallFunction(prototype, "getTime", Builtins::kDatePrototypeGetTime,
2569 0, true);
2570 SimpleInstallFunction(prototype, "getTimezoneOffset",
2571 Builtins::kDatePrototypeGetTimezoneOffset, 0, true);
2572 SimpleInstallFunction(prototype, "getUTCDate",
2573 Builtins::kDatePrototypeGetUTCDate, 0, true);
2574 SimpleInstallFunction(prototype, "getUTCDay",
2575 Builtins::kDatePrototypeGetUTCDay, 0, true);
2576 SimpleInstallFunction(prototype, "getUTCFullYear",
2577 Builtins::kDatePrototypeGetUTCFullYear, 0, true);
2578 SimpleInstallFunction(prototype, "getUTCHours",
2579 Builtins::kDatePrototypeGetUTCHours, 0, true);
2580 SimpleInstallFunction(prototype, "getUTCMilliseconds",
2581 Builtins::kDatePrototypeGetUTCMilliseconds, 0, true);
2582 SimpleInstallFunction(prototype, "getUTCMinutes",
2583 Builtins::kDatePrototypeGetUTCMinutes, 0, true);
2584 SimpleInstallFunction(prototype, "getUTCMonth",
2585 Builtins::kDatePrototypeGetUTCMonth, 0, true);
2586 SimpleInstallFunction(prototype, "getUTCSeconds",
2587 Builtins::kDatePrototypeGetUTCSeconds, 0, true);
2552 SimpleInstallFunction(prototype, "valueOf", Builtins::kDatePrototypeValueOf, 2588 SimpleInstallFunction(prototype, "valueOf", Builtins::kDatePrototypeValueOf,
2553 0, false); 2589 0, false);
2554 2590
2555 // Install the @@toPrimitive function. 2591 // Install the @@toPrimitive function.
2556 Handle<JSFunction> to_primitive = InstallFunction( 2592 Handle<JSFunction> to_primitive = InstallFunction(
2557 prototype, factory()->to_primitive_symbol(), JS_OBJECT_TYPE, 2593 prototype, factory()->to_primitive_symbol(), JS_OBJECT_TYPE,
2558 JSObject::kHeaderSize, MaybeHandle<JSObject>(), 2594 JSObject::kHeaderSize, MaybeHandle<JSObject>(),
2559 Builtins::kDatePrototypeToPrimitive, 2595 Builtins::kDatePrototypeToPrimitive,
2560 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY)); 2596 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY));
2561 2597
(...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after
3432 } 3468 }
3433 3469
3434 3470
3435 // Called when the top-level V8 mutex is destroyed. 3471 // Called when the top-level V8 mutex is destroyed.
3436 void Bootstrapper::FreeThreadResources() { 3472 void Bootstrapper::FreeThreadResources() {
3437 DCHECK(!IsActive()); 3473 DCHECK(!IsActive());
3438 } 3474 }
3439 3475
3440 } // namespace internal 3476 } // namespace internal
3441 } // namespace v8 3477 } // namespace v8
OLDNEW
« no previous file with comments | « src/arm64/builtins-arm64.cc ('k') | src/builtins.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698