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

Side by Side Diff: test/cctest/test-code-stub-assembler.cc

Issue 2655853010: [TypeFeedbackVector] Combine the literals array and the feedback vector. (Closed)
Patch Set: more comments. Created 3 years, 10 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
OLDNEW
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 2098 matching lines...) Expand 10 before | Expand all | Expand 10 after
2109 Handle<Code> code = data.GenerateCode(); 2109 Handle<Code> code = data.GenerateCode();
2110 CHECK(!code.is_null()); 2110 CHECK(!code.is_null());
2111 2111
2112 FunctionTester ft(code, kNumParams); 2112 FunctionTester ft(code, kNumParams);
2113 Handle<Object> result_obj = 2113 Handle<Object> result_obj =
2114 ft.Call(isolate->factory()->undefined_value()).ToHandleChecked(); 2114 ft.Call(isolate->factory()->undefined_value()).ToHandleChecked();
2115 CHECK(result_obj->IsJSFunction()); 2115 CHECK(result_obj->IsJSFunction());
2116 Handle<JSFunction> fun = Handle<JSFunction>::cast(result_obj); 2116 Handle<JSFunction> fun = Handle<JSFunction>::cast(result_obj);
2117 CHECK_EQ(isolate->heap()->empty_fixed_array(), fun->properties()); 2117 CHECK_EQ(isolate->heap()->empty_fixed_array(), fun->properties());
2118 CHECK_EQ(isolate->heap()->empty_fixed_array(), fun->elements()); 2118 CHECK_EQ(isolate->heap()->empty_fixed_array(), fun->elements());
2119 CHECK_EQ(isolate->heap()->empty_literals_array(), fun->literals()); 2119 CHECK_EQ(isolate->heap()->empty_type_feedback_vector(),
2120 fun->feedback_vector());
2120 CHECK_EQ(isolate->heap()->the_hole_value(), fun->prototype_or_initial_map()); 2121 CHECK_EQ(isolate->heap()->the_hole_value(), fun->prototype_or_initial_map());
2121 CHECK_EQ(*isolate->promise_resolve_shared_fun(), fun->shared()); 2122 CHECK_EQ(*isolate->promise_resolve_shared_fun(), fun->shared());
2122 CHECK_EQ(isolate->promise_resolve_shared_fun()->code(), fun->code()); 2123 CHECK_EQ(isolate->promise_resolve_shared_fun()->code(), fun->code());
2123 CHECK_EQ(isolate->heap()->undefined_value(), fun->next_function_link()); 2124 CHECK_EQ(isolate->heap()->undefined_value(), fun->next_function_link());
2124 } 2125 }
2125 2126
2126 TEST(CreatePromiseGetCapabilitiesExecutorContext) { 2127 TEST(CreatePromiseGetCapabilitiesExecutorContext) {
2127 Isolate* isolate(CcTest::InitIsolateOnce()); 2128 Isolate* isolate(CcTest::InitIsolateOnce());
2128 2129
2129 const int kNumParams = 1; 2130 const int kNumParams = 1;
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
2455 m.Return(m.SmiConstant(0)); 2456 m.Return(m.SmiConstant(0));
2456 2457
2457 Handle<Code> code = data.GenerateCode(); 2458 Handle<Code> code = data.GenerateCode();
2458 CHECK(!code.is_null()); 2459 CHECK(!code.is_null());
2459 FunctionTester ft(code, kNumParams); 2460 FunctionTester ft(code, kNumParams);
2460 CHECK_EQ(1, Handle<Smi>::cast(ft.Call().ToHandleChecked())->value()); 2461 CHECK_EQ(1, Handle<Smi>::cast(ft.Call().ToHandleChecked())->value());
2461 } 2462 }
2462 2463
2463 } // namespace internal 2464 } // namespace internal
2464 } // namespace v8 2465 } // namespace v8
OLDNEW
« no previous file with comments | « test/cctest/interpreter/bytecode_expectations/WithStatement.golden ('k') | test/cctest/test-feedback-vector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698