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

Side by Side Diff: src/api.cc

Issue 2630593004: [promises] Remove runtime call from fastpath in PromiseReject (Closed)
Patch Set: remove helper Created 3 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 7249 matching lines...) Expand 10 before | Expand all | Expand 10 after
7260 void Promise::Resolver::Resolve(Local<Value> value) { 7260 void Promise::Resolver::Resolve(Local<Value> value) {
7261 auto context = ContextFromHeapObject(Utils::OpenHandle(this)); 7261 auto context = ContextFromHeapObject(Utils::OpenHandle(this));
7262 USE(Resolve(context, value)); 7262 USE(Resolve(context, value));
7263 } 7263 }
7264 7264
7265 7265
7266 Maybe<bool> Promise::Resolver::Reject(Local<Context> context, 7266 Maybe<bool> Promise::Resolver::Reject(Local<Context> context,
7267 Local<Value> value) { 7267 Local<Value> value) {
7268 PREPARE_FOR_EXECUTION_PRIMITIVE(context, Promise_Resolver, Resolve, bool); 7268 PREPARE_FOR_EXECUTION_PRIMITIVE(context, Promise_Resolver, Resolve, bool);
7269 auto self = Utils::OpenHandle(this); 7269 auto self = Utils::OpenHandle(this);
7270 i::Handle<i::Object> argv[] = {self, Utils::OpenHandle(*value)}; 7270
7271 // We pass true to trigger the debugger's on exception handler.
7272 i::Handle<i::Object> argv[] = {self, Utils::OpenHandle(*value),
7273 isolate->factory()->ToBoolean(true)};
7271 has_pending_exception = 7274 has_pending_exception =
7272 i::Execution::Call(isolate, isolate->promise_reject(), 7275 i::Execution::Call(isolate, isolate->promise_internal_reject(),
7273 isolate->factory()->undefined_value(), arraysize(argv), 7276 isolate->factory()->undefined_value(), arraysize(argv),
7274 argv) 7277 argv)
7275 .is_null(); 7278 .is_null();
7276 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool); 7279 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool);
7277 return Just(true); 7280 return Just(true);
7278 } 7281 }
7279 7282
7280 7283
7281 void Promise::Resolver::Reject(Local<Value> value) { 7284 void Promise::Resolver::Reject(Local<Value> value) {
7282 auto context = ContextFromHeapObject(Utils::OpenHandle(this)); 7285 auto context = ContextFromHeapObject(Utils::OpenHandle(this));
(...skipping 2713 matching lines...) Expand 10 before | Expand all | Expand 10 after
9996 Address callback_address = 9999 Address callback_address =
9997 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 10000 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
9998 VMState<EXTERNAL> state(isolate); 10001 VMState<EXTERNAL> state(isolate);
9999 ExternalCallbackScope call_scope(isolate, callback_address); 10002 ExternalCallbackScope call_scope(isolate, callback_address);
10000 callback(info); 10003 callback(info);
10001 } 10004 }
10002 10005
10003 10006
10004 } // namespace internal 10007 } // namespace internal
10005 } // namespace v8 10008 } // 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