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

Side by Side Diff: src/runtime/runtime-test.cc

Issue 2752043002: [promises] Add %WaitForPromise runtime call to allow tests to reliably wait for promises to be fini… (Closed)
Patch Set: Don't touch runtime-promise.cc Created 3 years, 9 months 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/runtime/runtime.h ('k') | test/mjsunit/basic-promise.js » ('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 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/runtime/runtime-utils.h" 5 #include "src/runtime/runtime-utils.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "src/arguments.h" 9 #include "src/arguments.h"
10 #include "src/assembler-inl.h" 10 #include "src/assembler-inl.h"
(...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after
941 HandleScope scope(isolate); 941 HandleScope scope(isolate);
942 CONVERT_ARG_HANDLE_CHECKED(JSObject, instance_obj, 0); 942 CONVERT_ARG_HANDLE_CHECKED(JSObject, instance_obj, 0);
943 CHECK(WasmInstanceObject::IsWasmInstanceObject(*instance_obj)); 943 CHECK(WasmInstanceObject::IsWasmInstanceObject(*instance_obj));
944 Handle<WasmInstanceObject> instance = 944 Handle<WasmInstanceObject> instance =
945 Handle<WasmInstanceObject>::cast(instance_obj); 945 Handle<WasmInstanceObject>::cast(instance_obj);
946 if (!instance->has_debug_info()) return 0; 946 if (!instance->has_debug_info()) return 0;
947 uint64_t num = instance->debug_info()->NumInterpretedCalls(); 947 uint64_t num = instance->debug_info()->NumInterpretedCalls();
948 return *isolate->factory()->NewNumberFromSize(static_cast<size_t>(num)); 948 return *isolate->factory()->NewNumberFromSize(static_cast<size_t>(num));
949 } 949 }
950 950
951 RUNTIME_FUNCTION(Runtime_IncrementWaitCount) {
952 isolate->IncrementWaitCountForTesting();
953 return isolate->heap()->undefined_value();
954 }
955
956 RUNTIME_FUNCTION(Runtime_DecrementWaitCount) {
957 isolate->DecrementWaitCountForTesting();
958 return isolate->heap()->undefined_value();
959 }
951 } // namespace internal 960 } // namespace internal
952 } // namespace v8 961 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime.h ('k') | test/mjsunit/basic-promise.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698