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 1825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1836 Builtins::kDatePrototypeToPrimitive, | 1836 Builtins::kDatePrototypeToPrimitive, |
1837 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY)); | 1837 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY)); |
1838 | 1838 |
1839 // Set the expected parameters for @@toPrimitive to 1; required by builtin. | 1839 // Set the expected parameters for @@toPrimitive to 1; required by builtin. |
1840 to_primitive->shared()->set_internal_formal_parameter_count(1); | 1840 to_primitive->shared()->set_internal_formal_parameter_count(1); |
1841 | 1841 |
1842 // Set the length for the function to satisfy ECMA-262. | 1842 // Set the length for the function to satisfy ECMA-262. |
1843 to_primitive->shared()->set_length(1); | 1843 to_primitive->shared()->set_length(1); |
1844 } | 1844 } |
1845 | 1845 |
1846 { | |
1847 Handle<Code> code = handle( | |
1848 isolate->builtins()->builtin(Builtins::kPromiseGetCapabilitiesExecutor), | |
1849 isolate); | |
gsathya
2016/12/21 01:02:33
Handle<Code> code = isolate->builtins()->PromiseGe
caitp
2016/12/21 21:01:13
Done.
| |
1850 Handle<SharedFunctionInfo> info = | |
1851 factory->NewSharedFunctionInfo(factory->empty_string(), code, true); | |
1852 info->SetConstructStub(*isolate->builtins()->JSBuiltinsConstructStub()); | |
1853 info->set_instance_class_name(isolate->heap()->Object_string()); | |
1854 info->set_internal_formal_parameter_count(2); | |
1855 info->set_length(2); | |
1856 native_context()->set_promise_get_capabilities_executor_shared_fun(*info); | |
1857 | |
1858 // %new_internal_promise_capability(debugEvent) | |
1859 Handle<JSFunction> new_internal_promise_capability = | |
1860 SimpleCreateFunction(isolate, factory->empty_string(), | |
1861 Builtins::kNewInternalPromiseCapability, 1, false); | |
1862 InstallWithIntrinsicDefaultProto( | |
1863 isolate, new_internal_promise_capability, | |
1864 Context::NEW_INTERNAL_PROMISE_CAPABILITY_INDEX); | |
1865 | |
1866 // %new_promise_capability(C, debugEvent) | |
1867 Handle<JSFunction> new_promise_capability = | |
1868 SimpleCreateFunction(isolate, factory->empty_string(), | |
1869 Builtins::kNewPromiseCapability, 2, false); | |
1870 InstallWithIntrinsicDefaultProto(isolate, new_promise_capability, | |
1871 Context::NEW_PROMISE_CAPABILITY_INDEX); | |
1872 } | |
1873 | |
1846 { // -- P r o m i s e | 1874 { // -- P r o m i s e |
1847 // Set catch prediction | 1875 // Set catch prediction |
1848 Handle<Code> promise_code = isolate->builtins()->PromiseConstructor(); | 1876 Handle<Code> promise_code = isolate->builtins()->PromiseConstructor(); |
1849 promise_code->set_is_promise_rejection(true); | 1877 promise_code->set_is_promise_rejection(true); |
1850 | 1878 |
1851 Handle<JSObject> prototype = | 1879 Handle<JSObject> prototype = |
1852 factory->NewJSObject(isolate->object_function(), TENURED); | 1880 factory->NewJSObject(isolate->object_function(), TENURED); |
1853 Handle<JSFunction> promise_fun = | 1881 Handle<JSFunction> promise_fun = |
1854 InstallFunction(global, "Promise", JS_PROMISE_TYPE, JSPromise::kSize, | 1882 InstallFunction(global, "Promise", JS_PROMISE_TYPE, JSPromise::kSize, |
1855 prototype, Builtins::kPromiseConstructor); | 1883 prototype, Builtins::kPromiseConstructor); |
(...skipping 2800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4656 } | 4684 } |
4657 | 4685 |
4658 | 4686 |
4659 // Called when the top-level V8 mutex is destroyed. | 4687 // Called when the top-level V8 mutex is destroyed. |
4660 void Bootstrapper::FreeThreadResources() { | 4688 void Bootstrapper::FreeThreadResources() { |
4661 DCHECK(!IsActive()); | 4689 DCHECK(!IsActive()); |
4662 } | 4690 } |
4663 | 4691 |
4664 } // namespace internal | 4692 } // namespace internal |
4665 } // namespace v8 | 4693 } // namespace v8 |
OLD | NEW |