OLD | NEW |
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 2088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2099 Handle<JSFunction> new_promise_capability = | 2099 Handle<JSFunction> new_promise_capability = |
2100 SimpleCreateFunction(isolate, factory->empty_string(), | 2100 SimpleCreateFunction(isolate, factory->empty_string(), |
2101 Builtins::kNewPromiseCapability, 2, false); | 2101 Builtins::kNewPromiseCapability, 2, false); |
2102 InstallWithIntrinsicDefaultProto(isolate, new_promise_capability, | 2102 InstallWithIntrinsicDefaultProto(isolate, new_promise_capability, |
2103 Context::NEW_PROMISE_CAPABILITY_INDEX); | 2103 Context::NEW_PROMISE_CAPABILITY_INDEX); |
2104 } | 2104 } |
2105 | 2105 |
2106 { // -- P r o m i s e | 2106 { // -- P r o m i s e |
2107 Handle<JSObject> prototype = | 2107 Handle<JSObject> prototype = |
2108 factory->NewJSObject(isolate->object_function(), TENURED); | 2108 factory->NewJSObject(isolate->object_function(), TENURED); |
2109 Handle<JSFunction> promise_fun = | 2109 Handle<JSFunction> promise_fun = InstallFunction( |
2110 InstallFunction(global, "Promise", JS_PROMISE_TYPE, JSPromise::kSize, | 2110 global, "Promise", JS_PROMISE_TYPE, JSPromise::kSizeWithEmbedderFields, |
2111 prototype, Builtins::kPromiseConstructor); | 2111 prototype, Builtins::kPromiseConstructor); |
2112 InstallWithIntrinsicDefaultProto(isolate, promise_fun, | 2112 InstallWithIntrinsicDefaultProto(isolate, promise_fun, |
2113 Context::PROMISE_FUNCTION_INDEX); | 2113 Context::PROMISE_FUNCTION_INDEX); |
2114 | 2114 |
2115 Handle<SharedFunctionInfo> shared(promise_fun->shared(), isolate); | 2115 Handle<SharedFunctionInfo> shared(promise_fun->shared(), isolate); |
2116 shared->SetConstructStub(*isolate->builtins()->JSBuiltinsConstructStub()); | 2116 shared->SetConstructStub(*isolate->builtins()->JSBuiltinsConstructStub()); |
2117 shared->set_instance_class_name(isolate->heap()->Object_string()); | 2117 shared->set_instance_class_name(isolate->heap()->Object_string()); |
2118 shared->set_internal_formal_parameter_count(1); | 2118 shared->set_internal_formal_parameter_count(1); |
2119 shared->set_length(1); | 2119 shared->set_length(1); |
2120 | 2120 |
2121 // Install the "constructor" property on the {prototype}. | 2121 // Install the "constructor" property on the {prototype}. |
(...skipping 3161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5283 } | 5283 } |
5284 | 5284 |
5285 | 5285 |
5286 // Called when the top-level V8 mutex is destroyed. | 5286 // Called when the top-level V8 mutex is destroyed. |
5287 void Bootstrapper::FreeThreadResources() { | 5287 void Bootstrapper::FreeThreadResources() { |
5288 DCHECK(!IsActive()); | 5288 DCHECK(!IsActive()); |
5289 } | 5289 } |
5290 | 5290 |
5291 } // namespace internal | 5291 } // namespace internal |
5292 } // namespace v8 | 5292 } // namespace v8 |
OLD | NEW |