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

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

Issue 2575313002: [promisehook] Implement PromiseHook (Closed)
Patch Set: rebase + add comments 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
« no previous file with comments | « src/builtins/builtins-promise.cc ('k') | src/external-reference-table.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8229 matching lines...) Expand 10 before | Expand all | Expand 10 after
8240 } 8240 }
8241 8241
8242 Node* CodeStubAssembler::IsDebugActive() { 8242 Node* CodeStubAssembler::IsDebugActive() {
8243 Node* is_debug_active = Load( 8243 Node* is_debug_active = Load(
8244 MachineType::Uint8(), 8244 MachineType::Uint8(),
8245 ExternalConstant(ExternalReference::debug_is_active_address(isolate()))); 8245 ExternalConstant(ExternalReference::debug_is_active_address(isolate())));
8246 return Word32NotEqual(is_debug_active, Int32Constant(0)); 8246 return Word32NotEqual(is_debug_active, Int32Constant(0));
8247 } 8247 }
8248 8248
8249 Node* CodeStubAssembler::IsPromiseHookEnabled() { 8249 Node* CodeStubAssembler::IsPromiseHookEnabled() {
8250 Node* const is_promisehook_enabled = 8250 Node* const promise_hook = Load(
8251 Load(MachineType::Uint8(), 8251 MachineType::Pointer(),
8252 ExternalConstant( 8252 ExternalConstant(ExternalReference::promise_hook_address(isolate())));
8253 ExternalReference::is_promisehook_enabled_address(isolate()))); 8253 return WordNotEqual(promise_hook, IntPtrConstant(0));
8254 return Word32NotEqual(is_promisehook_enabled, Int32Constant(0));
8255 } 8254 }
8256 8255
8257 Node* CodeStubAssembler::AllocateJSPromise(Node* context) { 8256 Node* CodeStubAssembler::AllocateJSPromise(Node* context) {
8258 Node* const native_context = LoadNativeContext(context); 8257 Node* const native_context = LoadNativeContext(context);
8259 Node* const promise_fun = 8258 Node* const promise_fun =
8260 LoadContextElement(native_context, Context::PROMISE_FUNCTION_INDEX); 8259 LoadContextElement(native_context, Context::PROMISE_FUNCTION_INDEX);
8261 Node* const initial_map = 8260 Node* const initial_map =
8262 LoadObjectField(promise_fun, JSFunction::kPrototypeOrInitialMapOffset); 8261 LoadObjectField(promise_fun, JSFunction::kPrototypeOrInitialMapOffset);
8263 Node* const instance = AllocateJSObjectFromMap(initial_map); 8262 Node* const instance = AllocateJSObjectFromMap(initial_map);
8264 8263
(...skipping 29 matching lines...) Expand all
8294 Heap::kUndefinedValueRootIndex); 8293 Heap::kUndefinedValueRootIndex);
8295 StoreObjectFieldRoot(result, PromiseReactionJobInfo::kDebugNameOffset, 8294 StoreObjectFieldRoot(result, PromiseReactionJobInfo::kDebugNameOffset,
8296 Heap::kUndefinedValueRootIndex); 8295 Heap::kUndefinedValueRootIndex);
8297 StoreObjectFieldNoWriteBarrier(result, PromiseReactionJobInfo::kContextOffset, 8296 StoreObjectFieldNoWriteBarrier(result, PromiseReactionJobInfo::kContextOffset,
8298 context); 8297 context);
8299 return result; 8298 return result;
8300 } 8299 }
8301 8300
8302 } // namespace internal 8301 } // namespace internal
8303 } // namespace v8 8302 } // namespace v8
OLDNEW
« no previous file with comments | « src/builtins/builtins-promise.cc ('k') | src/external-reference-table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698