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

Side by Side Diff: test/unittests/compiler/js-type-feedback-unittest.cc

Issue 1409993002: [turbofan] Move SimplifiedOperatorBuilder into JSGraph. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 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/compiler.h" 5 #include "src/compiler.h"
6 6
7 #include "src/compiler/access-builder.h" 7 #include "src/compiler/access-builder.h"
8 #include "src/compiler/js-graph.h" 8 #include "src/compiler/js-graph.h"
9 #include "src/compiler/js-operator.h" 9 #include "src/compiler/js-operator.h"
10 #include "src/compiler/js-type-feedback.h" 10 #include "src/compiler/js-type-feedback.h"
(...skipping 22 matching lines...) Expand all
33 dependencies_(isolate(), zone()) {} 33 dependencies_(isolate(), zone()) {}
34 ~JSTypeFeedbackTest() override { dependencies_.Rollback(); } 34 ~JSTypeFeedbackTest() override { dependencies_.Rollback(); }
35 35
36 protected: 36 protected:
37 Reduction Reduce(Node* node, 37 Reduction Reduce(Node* node,
38 JSTypeFeedbackSpecializer::DeoptimizationMode mode) { 38 JSTypeFeedbackSpecializer::DeoptimizationMode mode) {
39 Handle<GlobalObject> global_object( 39 Handle<GlobalObject> global_object(
40 isolate()->native_context()->global_object(), isolate()); 40 isolate()->native_context()->global_object(), isolate());
41 41
42 MachineOperatorBuilder machine(zone()); 42 MachineOperatorBuilder machine(zone());
43 JSGraph jsgraph(isolate(), graph(), common(), javascript(), &machine); 43 JSGraph jsgraph(isolate(), graph(), common(), javascript(), nullptr,
44 &machine);
44 JSTypeFeedbackTable table(zone()); 45 JSTypeFeedbackTable table(zone());
45 // TODO(titzer): mock the GraphReducer here for better unit testing. 46 // TODO(titzer): mock the GraphReducer here for better unit testing.
46 GraphReducer graph_reducer(zone(), graph()); 47 GraphReducer graph_reducer(zone(), graph());
47 JSTypeFeedbackSpecializer reducer(&graph_reducer, &jsgraph, &table, nullptr, 48 JSTypeFeedbackSpecializer reducer(&graph_reducer, &jsgraph, &table, nullptr,
48 global_object, mode, &dependencies_); 49 global_object, mode, &dependencies_);
49 return reducer.Reduce(node); 50 return reducer.Reduce(node);
50 } 51 }
51 52
52 Node* EmptyFrameState() { 53 Node* EmptyFrameState() {
53 MachineOperatorBuilder machine(zone()); 54 MachineOperatorBuilder machine(zone());
54 JSGraph jsgraph(isolate(), graph(), common(), javascript(), &machine); 55 JSGraph jsgraph(isolate(), graph(), common(), javascript(), nullptr,
56 &machine);
55 return jsgraph.EmptyFrameState(); 57 return jsgraph.EmptyFrameState();
56 } 58 }
57 59
58 JSOperatorBuilder* javascript() { return &javascript_; } 60 JSOperatorBuilder* javascript() { return &javascript_; }
59 61
60 void SetGlobalProperty(const char* string, int value) { 62 void SetGlobalProperty(const char* string, int value) {
61 SetGlobalProperty(string, Handle<Smi>(Smi::FromInt(value), isolate())); 63 SetGlobalProperty(string, Handle<Smi>(Smi::FromInt(value), isolate()));
62 } 64 }
63 65
64 void SetGlobalProperty(const char* string, double value) { 66 void SetGlobalProperty(const char* string, double value) {
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 IsReturn(load_field_match, load_field_match, graph()->start())); 328 IsReturn(load_field_match, load_field_match, graph()->start()));
327 EXPECT_THAT(graph()->end(), IsEnd(ret)); 329 EXPECT_THAT(graph()->end(), IsEnd(ret));
328 330
329 EXPECT_FALSE(dependencies()->IsEmpty()); 331 EXPECT_FALSE(dependencies()->IsEmpty());
330 dependencies()->Rollback(); 332 dependencies()->Rollback();
331 } 333 }
332 334
333 } // namespace compiler 335 } // namespace compiler
334 } // namespace internal 336 } // namespace internal
335 } // namespace v8 337 } // namespace v8
OLDNEW
« no previous file with comments | « test/unittests/compiler/js-intrinsic-lowering-unittest.cc ('k') | test/unittests/compiler/js-typed-lowering-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698