OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/builtins/builtins-utils.h" | 5 #include "src/builtins/builtins-utils.h" |
6 #include "src/builtins/builtins.h" | 6 #include "src/builtins/builtins.h" |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stub-assembler.h" | 8 #include "src/code-stub-assembler.h" |
9 #include "src/promise-utils.h" | 9 #include "src/promise-utils.h" |
10 | 10 |
(...skipping 25 matching lines...) Expand all Loading... |
36 return isolate->heap()->undefined_value(); | 36 return isolate->heap()->undefined_value(); |
37 } | 37 } |
38 | 38 |
39 // ES#sec-createresolvingfunctions | 39 // ES#sec-createresolvingfunctions |
40 // CreateResolvingFunctions ( promise ) | 40 // CreateResolvingFunctions ( promise ) |
41 BUILTIN(CreateResolvingFunctions) { | 41 BUILTIN(CreateResolvingFunctions) { |
42 HandleScope scope(isolate); | 42 HandleScope scope(isolate); |
43 DCHECK_EQ(3, args.length()); | 43 DCHECK_EQ(3, args.length()); |
44 | 44 |
45 Handle<JSObject> promise = args.at<JSObject>(1); | 45 Handle<JSObject> promise = args.at<JSObject>(1); |
46 Handle<Object> debug_event = args.at<Object>(2); | 46 Handle<Object> debug_event = args.at(2); |
47 Handle<JSFunction> resolve, reject; | 47 Handle<JSFunction> resolve, reject; |
48 | 48 |
49 PromiseUtils::CreateResolvingFunctions(isolate, promise, debug_event, | 49 PromiseUtils::CreateResolvingFunctions(isolate, promise, debug_event, |
50 &resolve, &reject); | 50 &resolve, &reject); |
51 | 51 |
52 Handle<FixedArray> result = isolate->factory()->NewFixedArray(2); | 52 Handle<FixedArray> result = isolate->factory()->NewFixedArray(2); |
53 result->set(0, *resolve); | 53 result->set(0, *resolve); |
54 result->set(1, *reject); | 54 result->set(1, *reject); |
55 | 55 |
56 return *isolate->factory()->NewJSArrayWithElements(result, FAST_ELEMENTS, 2, | 56 return *isolate->factory()->NewJSArrayWithElements(result, FAST_ELEMENTS, 2, |
(...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
985 a.CallRuntime(Runtime::kDebugPopPromise, context); | 985 a.CallRuntime(Runtime::kDebugPopPromise, context); |
986 a.Goto(&out); | 986 a.Goto(&out); |
987 | 987 |
988 a.Bind(&out); | 988 a.Bind(&out); |
989 a.Return(a.UndefinedConstant()); | 989 a.Return(a.UndefinedConstant()); |
990 } | 990 } |
991 } | 991 } |
992 | 992 |
993 } // namespace internal | 993 } // namespace internal |
994 } // namespace v8 | 994 } // namespace v8 |
OLD | NEW |