OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/builtins.h" | 5 #include "src/builtins/builtins.h" |
6 #include "src/builtins/builtins-utils.h" | 6 #include "src/builtins/builtins-utils.h" |
7 | 7 |
8 #include "src/dateparser-inl.h" | 8 #include "src/dateparser-inl.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
912 void Builtins::Generate_DatePrototype_GetField(CodeStubAssembler* assembler, | 912 void Builtins::Generate_DatePrototype_GetField(CodeStubAssembler* assembler, |
913 int field_index) { | 913 int field_index) { |
914 typedef CodeStubAssembler::Label Label; | 914 typedef CodeStubAssembler::Label Label; |
915 typedef compiler::Node Node; | 915 typedef compiler::Node Node; |
916 | 916 |
917 Node* receiver = assembler->Parameter(0); | 917 Node* receiver = assembler->Parameter(0); |
918 Node* context = assembler->Parameter(3); | 918 Node* context = assembler->Parameter(3); |
919 | 919 |
920 Label receiver_not_date(assembler, Label::kDeferred); | 920 Label receiver_not_date(assembler, Label::kDeferred); |
921 | 921 |
922 assembler->GotoIf(assembler->WordIsSmi(receiver), &receiver_not_date); | 922 assembler->GotoIf(assembler->TaggedIsSmi(receiver), &receiver_not_date); |
923 Node* receiver_instance_type = assembler->LoadInstanceType(receiver); | 923 Node* receiver_instance_type = assembler->LoadInstanceType(receiver); |
924 assembler->GotoIf( | 924 assembler->GotoIf( |
925 assembler->Word32NotEqual(receiver_instance_type, | 925 assembler->Word32NotEqual(receiver_instance_type, |
926 assembler->Int32Constant(JS_DATE_TYPE)), | 926 assembler->Int32Constant(JS_DATE_TYPE)), |
927 &receiver_not_date); | 927 &receiver_not_date); |
928 | 928 |
929 // Load the specified date field, falling back to the runtime as necessary. | 929 // Load the specified date field, falling back to the runtime as necessary. |
930 if (field_index == JSDate::kDateValue) { | 930 if (field_index == JSDate::kDateValue) { |
931 assembler->Return( | 931 assembler->Return( |
932 assembler->LoadObjectField(receiver, JSDate::kValueOffset)); | 932 assembler->LoadObjectField(receiver, JSDate::kValueOffset)); |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1056 } | 1056 } |
1057 | 1057 |
1058 // static | 1058 // static |
1059 void Builtins::Generate_DatePrototypeGetUTCSeconds( | 1059 void Builtins::Generate_DatePrototypeGetUTCSeconds( |
1060 CodeStubAssembler* assembler) { | 1060 CodeStubAssembler* assembler) { |
1061 Generate_DatePrototype_GetField(assembler, JSDate::kSecondUTC); | 1061 Generate_DatePrototype_GetField(assembler, JSDate::kSecondUTC); |
1062 } | 1062 } |
1063 | 1063 |
1064 } // namespace internal | 1064 } // namespace internal |
1065 } // namespace v8 | 1065 } // namespace v8 |
OLD | NEW |