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

Side by Side Diff: src/bootstrapper.cc

Issue 2731273002: [debug] add exception predictions to builtins where missing. (Closed)
Patch Set: Created 3 years, 9 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/builtins/builtins-promise.cc » ('j') | src/builtins/builtins-promise.cc » ('J')
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/base/ieee754.h" 9 #include "src/base/ieee754.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 2093 matching lines...) Expand 10 before | Expand all | Expand 10 after
2104 Builtins::kInternalPromiseReject, 3, true); 2104 Builtins::kInternalPromiseReject, 3, true);
2105 function->shared()->set_native(false); 2105 function->shared()->set_native(false);
2106 InstallWithIntrinsicDefaultProto(isolate, function, 2106 InstallWithIntrinsicDefaultProto(isolate, function,
2107 Context::PROMISE_INTERNAL_REJECT_INDEX); 2107 Context::PROMISE_INTERNAL_REJECT_INDEX);
2108 } 2108 }
2109 2109
2110 { 2110 {
2111 Handle<Code> code = 2111 Handle<Code> code =
2112 handle(isolate->builtins()->builtin(Builtins::kPromiseResolveClosure), 2112 handle(isolate->builtins()->builtin(Builtins::kPromiseResolveClosure),
2113 isolate); 2113 isolate);
2114 code->set_is_promise_rejection(true);
2114 Handle<SharedFunctionInfo> info = 2115 Handle<SharedFunctionInfo> info =
2115 factory->NewSharedFunctionInfo(factory->empty_string(), code, false); 2116 factory->NewSharedFunctionInfo(factory->empty_string(), code, false);
2116 info->set_internal_formal_parameter_count(1); 2117 info->set_internal_formal_parameter_count(1);
2117 info->set_length(1); 2118 info->set_length(1);
2118 native_context()->set_promise_resolve_shared_fun(*info); 2119 native_context()->set_promise_resolve_shared_fun(*info);
2119 2120
2120 code = 2121 code =
2121 handle(isolate->builtins()->builtin(Builtins::kPromiseRejectClosure), 2122 handle(isolate->builtins()->builtin(Builtins::kPromiseRejectClosure),
2122 isolate); 2123 isolate);
2123 info = 2124 info =
(...skipping 1395 matching lines...) Expand 10 before | Expand all | Expand 10 after
3519 async_function_constructor, 3520 async_function_constructor,
3520 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY)); 3521 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY));
3521 3522
3522 JSFunction::SetPrototype(async_function_constructor, 3523 JSFunction::SetPrototype(async_function_constructor,
3523 async_function_prototype); 3524 async_function_prototype);
3524 3525
3525 { 3526 {
3526 Handle<JSFunction> function = 3527 Handle<JSFunction> function =
3527 SimpleCreateFunction(isolate, factory->empty_string(), 3528 SimpleCreateFunction(isolate, factory->empty_string(),
3528 Builtins::kAsyncFunctionAwaitCaught, 3, false); 3529 Builtins::kAsyncFunctionAwaitCaught, 3, false);
3530 isolate->builtins()->AsyncFunctionAwaitCaught()->set_is_promise_rejection(
3531 true);
3529 InstallWithIntrinsicDefaultProto( 3532 InstallWithIntrinsicDefaultProto(
3530 isolate, function, Context::ASYNC_FUNCTION_AWAIT_CAUGHT_INDEX); 3533 isolate, function, Context::ASYNC_FUNCTION_AWAIT_CAUGHT_INDEX);
3531 } 3534 }
3532 3535
3533 { 3536 {
3534 Handle<JSFunction> function = 3537 Handle<JSFunction> function =
3535 SimpleCreateFunction(isolate, factory->empty_string(), 3538 SimpleCreateFunction(isolate, factory->empty_string(),
3536 Builtins::kAsyncFunctionAwaitUncaught, 3, false); 3539 Builtins::kAsyncFunctionAwaitUncaught, 3, false);
3540 isolate->builtins()
3541 ->AsyncFunctionAwaitUncaught()
3542 ->set_is_promise_rejection(true);
3537 InstallWithIntrinsicDefaultProto( 3543 InstallWithIntrinsicDefaultProto(
3538 isolate, function, Context::ASYNC_FUNCTION_AWAIT_UNCAUGHT_INDEX); 3544 isolate, function, Context::ASYNC_FUNCTION_AWAIT_UNCAUGHT_INDEX);
3539 } 3545 }
3540 3546
3541 { 3547 {
3542 Handle<Code> code = 3548 Handle<Code> code =
3543 isolate->builtins()->AsyncFunctionAwaitRejectClosure(); 3549 isolate->builtins()->AsyncFunctionAwaitRejectClosure();
3544 Handle<SharedFunctionInfo> info = 3550 Handle<SharedFunctionInfo> info =
3545 factory->NewSharedFunctionInfo(factory->empty_string(), code, false); 3551 factory->NewSharedFunctionInfo(factory->empty_string(), code, false);
3546 info->set_internal_formal_parameter_count(1); 3552 info->set_internal_formal_parameter_count(1);
(...skipping 1560 matching lines...) Expand 10 before | Expand all | Expand 10 after
5107 } 5113 }
5108 5114
5109 5115
5110 // Called when the top-level V8 mutex is destroyed. 5116 // Called when the top-level V8 mutex is destroyed.
5111 void Bootstrapper::FreeThreadResources() { 5117 void Bootstrapper::FreeThreadResources() {
5112 DCHECK(!IsActive()); 5118 DCHECK(!IsActive());
5113 } 5119 }
5114 5120
5115 } // namespace internal 5121 } // namespace internal
5116 } // namespace v8 5122 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/builtins/builtins-promise.cc » ('j') | src/builtins/builtins-promise.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698