• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
3 // found in the LICENSE file.
4 
5 #include "src/runtime/runtime-utils.h"
6 
7 #include "src/arguments.h"
8 #include "src/conversions-inl.h"
9 #include "src/date.h"
10 #include "src/heap/factory.h"
11 #include "src/isolate-inl.h"
12 #include "src/messages.h"
13 
14 namespace v8 {
15 namespace internal {
16 
RUNTIME_FUNCTION(Runtime_IsDate)17 RUNTIME_FUNCTION(Runtime_IsDate) {
18   SealHandleScope shs(isolate);
19   DCHECK_EQ(1, args.length());
20   CONVERT_ARG_CHECKED(Object, obj, 0);
21   return isolate->heap()->ToBoolean(obj->IsJSDate());
22 }
23 
RUNTIME_FUNCTION(Runtime_DateCurrentTime)24 RUNTIME_FUNCTION(Runtime_DateCurrentTime) {
25   HandleScope scope(isolate);
26   DCHECK_EQ(0, args.length());
27   return *isolate->factory()->NewNumber(JSDate::CurrentTimeValue(isolate));
28 }
29 
30 }  // namespace internal
31 }  // namespace v8
32