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

Side by Side Diff: src/code-stub-assembler.cc

Issue 2581503003: [promisehook] Store promise in PromiseReactionJob (Closed)
Patch Set: rebase correctly Created 4 years 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
OLDNEW
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 #include "src/code-stub-assembler.h" 4 #include "src/code-stub-assembler.h"
5 #include "src/code-factory.h" 5 #include "src/code-factory.h"
6 #include "src/frames-inl.h" 6 #include "src/frames-inl.h"
7 #include "src/frames.h" 7 #include "src/frames.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 8255 matching lines...) Expand 10 before | Expand all | Expand 10 after
8266 StoreObjectField(promise, JSPromise::kFlagsOffset, SmiConstant(0)); 8266 StoreObjectField(promise, JSPromise::kFlagsOffset, SmiConstant(0));
8267 } 8267 }
8268 8268
8269 void CodeStubAssembler::PromiseSet(Node* promise, Node* status, Node* result) { 8269 void CodeStubAssembler::PromiseSet(Node* promise, Node* status, Node* result) {
8270 CSA_ASSERT(this, TaggedIsSmi(status)); 8270 CSA_ASSERT(this, TaggedIsSmi(status));
8271 StoreObjectField(promise, JSPromise::kStatusOffset, status); 8271 StoreObjectField(promise, JSPromise::kStatusOffset, status);
8272 StoreObjectField(promise, JSPromise::kResultOffset, result); 8272 StoreObjectField(promise, JSPromise::kResultOffset, result);
8273 StoreObjectField(promise, JSPromise::kFlagsOffset, SmiConstant(0)); 8273 StoreObjectField(promise, JSPromise::kFlagsOffset, SmiConstant(0));
8274 } 8274 }
8275 8275
8276 Node* CodeStubAssembler::AllocatePromiseReactionJobInfo(Node* value, 8276 Node* CodeStubAssembler::AllocatePromiseReactionJobInfo(
8277 Node* tasks, 8277 Node* value, Node* promise, Node* tasks, Node* deferred, Node* context) {
8278 Node* deferred,
8279 Node* context) {
8280 Node* const result = Allocate(PromiseReactionJobInfo::kSize); 8278 Node* const result = Allocate(PromiseReactionJobInfo::kSize);
8281 StoreMapNoWriteBarrier(result, Heap::kPromiseReactionJobInfoMapRootIndex); 8279 StoreMapNoWriteBarrier(result, Heap::kPromiseReactionJobInfoMapRootIndex);
8280 StoreObjectFieldNoWriteBarrier(result, PromiseReactionJobInfo::kPromiseOffset,
8281 promise);
8282 StoreObjectFieldNoWriteBarrier(result, PromiseReactionJobInfo::kValueOffset, 8282 StoreObjectFieldNoWriteBarrier(result, PromiseReactionJobInfo::kValueOffset,
8283 value); 8283 value);
8284 StoreObjectFieldNoWriteBarrier(result, PromiseReactionJobInfo::kTasksOffset, 8284 StoreObjectFieldNoWriteBarrier(result, PromiseReactionJobInfo::kTasksOffset,
8285 tasks); 8285 tasks);
8286 StoreObjectFieldNoWriteBarrier( 8286 StoreObjectFieldNoWriteBarrier(
8287 result, PromiseReactionJobInfo::kDeferredOffset, deferred); 8287 result, PromiseReactionJobInfo::kDeferredOffset, deferred);
8288 StoreObjectFieldRoot(result, PromiseReactionJobInfo::kDebugIdOffset, 8288 StoreObjectFieldRoot(result, PromiseReactionJobInfo::kDebugIdOffset,
8289 Heap::kUndefinedValueRootIndex); 8289 Heap::kUndefinedValueRootIndex);
8290 StoreObjectFieldRoot(result, PromiseReactionJobInfo::kDebugNameOffset, 8290 StoreObjectFieldRoot(result, PromiseReactionJobInfo::kDebugNameOffset,
8291 Heap::kUndefinedValueRootIndex); 8291 Heap::kUndefinedValueRootIndex);
8292 StoreObjectFieldNoWriteBarrier(result, PromiseReactionJobInfo::kContextOffset, 8292 StoreObjectFieldNoWriteBarrier(result, PromiseReactionJobInfo::kContextOffset,
8293 context); 8293 context);
8294 return result; 8294 return result;
8295 } 8295 }
8296 8296
8297 } // namespace internal 8297 } // namespace internal
8298 } // namespace v8 8298 } // namespace v8
OLDNEW
« src/builtins/builtins-promise.cc ('K') | « src/code-stub-assembler.h ('k') | src/factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698