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

Side by Side Diff: src/api.cc

Issue 1556333002: [runtime] Migrate several Date builtins to C++. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comments 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 | « no previous file | src/bootstrapper.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 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/api.h" 5 #include "src/api.h"
6 6
7 #include <string.h> // For memcpy, strlen. 7 #include <string.h> // For memcpy, strlen.
8 #ifdef V8_USE_ADDRESS_SANITIZER 8 #ifdef V8_USE_ADDRESS_SANITIZER
9 #include <sanitizer/asan_interface.h> 9 #include <sanitizer/asan_interface.h>
10 #endif // V8_USE_ADDRESS_SANITIZER 10 #endif // V8_USE_ADDRESS_SANITIZER
(...skipping 6025 matching lines...) Expand 10 before | Expand all | Expand 10 after
6036 } 6036 }
6037 6037
6038 6038
6039 MaybeLocal<v8::Value> v8::Date::New(Local<Context> context, double time) { 6039 MaybeLocal<v8::Value> v8::Date::New(Local<Context> context, double time) {
6040 if (std::isnan(time)) { 6040 if (std::isnan(time)) {
6041 // Introduce only canonical NaN value into the VM, to avoid signaling NaNs. 6041 // Introduce only canonical NaN value into the VM, to avoid signaling NaNs.
6042 time = std::numeric_limits<double>::quiet_NaN(); 6042 time = std::numeric_limits<double>::quiet_NaN();
6043 } 6043 }
6044 PREPARE_FOR_EXECUTION(context, "Date::New", Value); 6044 PREPARE_FOR_EXECUTION(context, "Date::New", Value);
6045 Local<Value> result; 6045 Local<Value> result;
6046 has_pending_exception = 6046 has_pending_exception = !ToLocal<Value>(
6047 !ToLocal<Value>(i::Execution::NewDate(isolate, time), &result); 6047 i::JSDate::New(isolate->date_function(), isolate->date_function(), time),
6048 &result);
6048 RETURN_ON_FAILED_EXECUTION(Value); 6049 RETURN_ON_FAILED_EXECUTION(Value);
6049 RETURN_ESCAPED(result); 6050 RETURN_ESCAPED(result);
6050 } 6051 }
6051 6052
6052 6053
6053 Local<v8::Value> v8::Date::New(Isolate* isolate, double time) { 6054 Local<v8::Value> v8::Date::New(Isolate* isolate, double time) {
6054 auto context = isolate->GetCurrentContext(); 6055 auto context = isolate->GetCurrentContext();
6055 RETURN_TO_LOCAL_UNCHECKED(New(context, time), Value); 6056 RETURN_TO_LOCAL_UNCHECKED(New(context, time), Value);
6056 } 6057 }
6057 6058
(...skipping 2479 matching lines...) Expand 10 before | Expand all | Expand 10 after
8537 Address callback_address = 8538 Address callback_address =
8538 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 8539 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
8539 VMState<EXTERNAL> state(isolate); 8540 VMState<EXTERNAL> state(isolate);
8540 ExternalCallbackScope call_scope(isolate, callback_address); 8541 ExternalCallbackScope call_scope(isolate, callback_address);
8541 callback(info); 8542 callback(info);
8542 } 8543 }
8543 8544
8544 8545
8545 } // namespace internal 8546 } // namespace internal
8546 } // namespace v8 8547 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/bootstrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698