OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/base/utils/random-number-generator.h" | 5 #include "src/base/utils/random-number-generator.h" |
6 #include "src/builtins/builtins-promise.h" | 6 #include "src/builtins/builtins-promise.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/compiler/node.h" | 9 #include "src/compiler/node.h" |
10 #include "src/isolate.h" | 10 #include "src/isolate.h" |
(...skipping 1910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1921 CHECK(result->IsPromiseReactionJobInfo()); | 1921 CHECK(result->IsPromiseReactionJobInfo()); |
1922 Handle<PromiseReactionJobInfo> promise_info = | 1922 Handle<PromiseReactionJobInfo> promise_info = |
1923 Handle<PromiseReactionJobInfo>::cast(result); | 1923 Handle<PromiseReactionJobInfo>::cast(result); |
1924 CHECK_EQ(Smi::FromInt(1), promise_info->value()); | 1924 CHECK_EQ(Smi::FromInt(1), promise_info->value()); |
1925 CHECK(promise_info->promise()->IsJSPromise()); | 1925 CHECK(promise_info->promise()->IsJSPromise()); |
1926 CHECK(promise_info->tasks()->IsFixedArray()); | 1926 CHECK(promise_info->tasks()->IsFixedArray()); |
1927 CHECK(promise_info->deferred_promise()->IsFixedArray()); | 1927 CHECK(promise_info->deferred_promise()->IsFixedArray()); |
1928 CHECK(promise_info->deferred_on_resolve()->IsUndefined(isolate)); | 1928 CHECK(promise_info->deferred_on_resolve()->IsUndefined(isolate)); |
1929 CHECK(promise_info->deferred_on_reject()->IsUndefined(isolate)); | 1929 CHECK(promise_info->deferred_on_reject()->IsUndefined(isolate)); |
1930 CHECK(promise_info->context()->IsContext()); | 1930 CHECK(promise_info->context()->IsContext()); |
1931 CHECK(promise_info->debug_id()->IsUndefined(isolate)); | 1931 CHECK_EQ(DEBUG_PROMISE_DEFAULT_ID, promise_info->debug_id()); |
1932 CHECK(promise_info->debug_name()->IsUndefined(isolate)); | 1932 CHECK_EQ(DEBUG_NOT_ACTIVE, promise_info->debug_name()); |
1933 } | 1933 } |
1934 | 1934 |
1935 TEST(IsSymbol) { | 1935 TEST(IsSymbol) { |
1936 Isolate* isolate(CcTest::InitIsolateOnce()); | 1936 Isolate* isolate(CcTest::InitIsolateOnce()); |
1937 | 1937 |
1938 const int kNumParams = 1; | 1938 const int kNumParams = 1; |
1939 CodeAssemblerTester data(isolate, kNumParams); | 1939 CodeAssemblerTester data(isolate, kNumParams); |
1940 CodeStubAssembler m(data.state()); | 1940 CodeStubAssembler m(data.state()); |
1941 | 1941 |
1942 Node* const symbol = m.Parameter(0); | 1942 Node* const symbol = m.Parameter(0); |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2097 CHECK_EQ(isolate->heap()->empty_fixed_array(), fun->elements()); | 2097 CHECK_EQ(isolate->heap()->empty_fixed_array(), fun->elements()); |
2098 CHECK_EQ(isolate->heap()->empty_literals_array(), fun->literals()); | 2098 CHECK_EQ(isolate->heap()->empty_literals_array(), fun->literals()); |
2099 CHECK_EQ(isolate->heap()->the_hole_value(), fun->prototype_or_initial_map()); | 2099 CHECK_EQ(isolate->heap()->the_hole_value(), fun->prototype_or_initial_map()); |
2100 CHECK_EQ(*isolate->promise_resolve_shared_fun(), fun->shared()); | 2100 CHECK_EQ(*isolate->promise_resolve_shared_fun(), fun->shared()); |
2101 CHECK_EQ(isolate->promise_resolve_shared_fun()->code(), fun->code()); | 2101 CHECK_EQ(isolate->promise_resolve_shared_fun()->code(), fun->code()); |
2102 CHECK_EQ(isolate->heap()->undefined_value(), fun->next_function_link()); | 2102 CHECK_EQ(isolate->heap()->undefined_value(), fun->next_function_link()); |
2103 } | 2103 } |
2104 | 2104 |
2105 } // namespace internal | 2105 } // namespace internal |
2106 } // namespace v8 | 2106 } // namespace v8 |
OLD | NEW |