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

Side by Side Diff: test/unittests/compiler/js-create-lowering-unittest.cc

Issue 2381523002: [Turbofan] Introduce OtherNumberConstant. (Closed)
Patch Set: Better DCHECK in HeapConstantType(). Created 4 years, 2 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 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 4
5 #include "src/compiler/js-create-lowering.h" 5 #include "src/compiler/js-create-lowering.h"
6 #include "src/code-factory.h" 6 #include "src/code-factory.h"
7 #include "src/compilation-dependencies.h" 7 #include "src/compilation-dependencies.h"
8 #include "src/compiler/access-builder.h" 8 #include "src/compiler/access-builder.h"
9 #include "src/compiler/js-graph.h" 9 #include "src/compiler/js-graph.h"
10 #include "src/compiler/js-operator.h" 10 #include "src/compiler/js-operator.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 JSOperatorBuilder* javascript() { return &javascript_; } 59 JSOperatorBuilder* javascript() { return &javascript_; }
60 60
61 private: 61 private:
62 JSOperatorBuilder javascript_; 62 JSOperatorBuilder javascript_;
63 CompilationDependencies deps_; 63 CompilationDependencies deps_;
64 }; 64 };
65 65
66 TEST_F(JSCreateLoweringTest, JSCreate) { 66 TEST_F(JSCreateLoweringTest, JSCreate) {
67 Handle<JSFunction> function = isolate()->object_function(); 67 Handle<JSFunction> function = isolate()->object_function();
68 Node* const target = Parameter(Type::Constant(function, graph()->zone())); 68 Node* const target = Parameter(Type::HeapConstant(function, graph()->zone()));
69 Node* const context = Parameter(Type::Any()); 69 Node* const context = Parameter(Type::Any());
70 Node* const effect = graph()->start(); 70 Node* const effect = graph()->start();
71 Reduction r = Reduce(graph()->NewNode(javascript()->Create(), target, target, 71 Reduction r = Reduce(graph()->NewNode(javascript()->Create(), target, target,
72 context, EmptyFrameState(), effect)); 72 context, EmptyFrameState(), effect));
73 ASSERT_TRUE(r.Changed()); 73 ASSERT_TRUE(r.Changed());
74 EXPECT_THAT( 74 EXPECT_THAT(
75 r.replacement(), 75 r.replacement(),
76 IsFinishRegion( 76 IsFinishRegion(
77 IsAllocate(IsNumberConstant(function->initial_map()->instance_size()), 77 IsAllocate(IsNumberConstant(function->initial_map()->instance_size()),
78 IsBeginRegion(effect), _), 78 IsBeginRegion(effect), _),
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 EXPECT_THAT(r.replacement(), 210 EXPECT_THAT(r.replacement(),
211 IsFinishRegion(IsAllocate(IsNumberConstant(Context::SizeFor( 211 IsFinishRegion(IsAllocate(IsNumberConstant(Context::SizeFor(
212 Context::MIN_CONTEXT_SLOTS + 1)), 212 Context::MIN_CONTEXT_SLOTS + 1)),
213 IsBeginRegion(_), control), 213 IsBeginRegion(_), control),
214 _)); 214 _));
215 } 215 }
216 216
217 } // namespace compiler 217 } // namespace compiler
218 } // namespace internal 218 } // namespace internal
219 } // namespace v8 219 } // namespace v8
OLDNEW
« no previous file with comments | « test/unittests/compiler/graph-unittest.cc ('k') | test/unittests/compiler/typed-optimization-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698