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-promise.h" | 5 #include "src/builtins/builtins-promise.h" |
6 #include "src/builtins/builtins-utils.h" | 6 #include "src/builtins/builtins-utils.h" |
7 #include "src/builtins/builtins.h" | 7 #include "src/builtins/builtins.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stub-assembler.h" | 9 #include "src/code-stub-assembler.h" |
10 #include "src/promise-utils.h" | 10 #include "src/promise-utils.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 Bind(&out); | 87 Bind(&out); |
88 return var_value_map.value(); | 88 return var_value_map.value(); |
89 } | 89 } |
90 | 90 |
91 Node* PromiseBuiltinsAssembler::PromiseHasHandler(Node* promise) { | 91 Node* PromiseBuiltinsAssembler::PromiseHasHandler(Node* promise) { |
92 Node* const flags = LoadObjectField(promise, JSPromise::kFlagsOffset); | 92 Node* const flags = LoadObjectField(promise, JSPromise::kFlagsOffset); |
93 return IsSetWord(SmiUntag(flags), 1 << JSPromise::kHasHandlerBit); | 93 return IsSetWord(SmiUntag(flags), 1 << JSPromise::kHasHandlerBit); |
94 } | 94 } |
95 | 95 |
96 void PromiseBuiltinsAssembler::PromiseSetHasHandler(Node* promise) { | 96 void PromiseBuiltinsAssembler::PromiseSetHasHandler(Node* promise) { |
97 Node* const flags = | 97 Node* const flags = LoadObjectField(promise, JSPromise::kFlagsOffset); |
98 SmiUntag(LoadObjectField(promise, JSPromise::kFlagsOffset)); | |
99 Node* const new_flags = | 98 Node* const new_flags = |
100 WordOr(flags, IntPtrConstant(1 << JSPromise::kHasHandlerBit)); | 99 SmiOr(flags, SmiConstant(1 << JSPromise::kHasHandlerBit)); |
101 StoreObjectField(promise, JSPromise::kFlagsOffset, SmiTag(new_flags)); | 100 StoreObjectFieldNoWriteBarrier(promise, JSPromise::kFlagsOffset, new_flags); |
102 } | 101 } |
103 | 102 |
104 Node* PromiseBuiltinsAssembler::SpeciesConstructor(Node* context, Node* object, | 103 Node* PromiseBuiltinsAssembler::SpeciesConstructor(Node* context, Node* object, |
105 Node* default_constructor) { | 104 Node* default_constructor) { |
106 Isolate* isolate = this->isolate(); | 105 Isolate* isolate = this->isolate(); |
107 Variable var_result(this, MachineRepresentation::kTagged); | 106 Variable var_result(this, MachineRepresentation::kTagged); |
108 var_result.Bind(default_constructor); | 107 var_result.Bind(default_constructor); |
109 | 108 |
110 // 2. Let C be ? Get(O, "constructor"). | 109 // 2. Let C be ? Get(O, "constructor"). |
111 Node* const constructor_str = | 110 Node* const constructor_str = |
(...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
986 CallRuntime(Runtime::kDebugPopPromise, context); | 985 CallRuntime(Runtime::kDebugPopPromise, context); |
987 Goto(&out); | 986 Goto(&out); |
988 | 987 |
989 Bind(&out); | 988 Bind(&out); |
990 Return(UndefinedConstant()); | 989 Return(UndefinedConstant()); |
991 } | 990 } |
992 } | 991 } |
993 | 992 |
994 } // namespace internal | 993 } // namespace internal |
995 } // namespace v8 | 994 } // namespace v8 |
OLD | NEW |