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

Side by Side Diff: test/unittests/compiler/js-builtin-reducer-unittest.cc

Issue 1775973002: Add GetProperty/GetElement to JSReceiver and use it where possible (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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 | « test/cctest/test-parsing.cc ('k') | no next file » | 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/compiler/js-builtin-reducer.h" 5 #include "src/compiler/js-builtin-reducer.h"
6 #include "src/compiler/js-graph.h" 6 #include "src/compiler/js-graph.h"
7 #include "src/compiler/node-properties.h" 7 #include "src/compiler/node-properties.h"
8 #include "src/compiler/simplified-operator.h" 8 #include "src/compiler/simplified-operator.h"
9 #include "src/compiler/typer.h" 9 #include "src/compiler/typer.h"
10 #include "src/isolate-inl.h" 10 #include "src/isolate-inl.h"
(...skipping 25 matching lines...) Expand all
36 JSBuiltinReducer reducer(&graph_reducer, &jsgraph); 36 JSBuiltinReducer reducer(&graph_reducer, &jsgraph);
37 return reducer.Reduce(node); 37 return reducer.Reduce(node);
38 } 38 }
39 39
40 Node* MathFunction(const char* name) { 40 Node* MathFunction(const char* name) {
41 Handle<Object> m = 41 Handle<Object> m =
42 JSObject::GetProperty(isolate()->global_object(), 42 JSObject::GetProperty(isolate()->global_object(),
43 isolate()->factory()->NewStringFromAsciiChecked( 43 isolate()->factory()->NewStringFromAsciiChecked(
44 "Math")).ToHandleChecked(); 44 "Math")).ToHandleChecked();
45 Handle<JSFunction> f = Handle<JSFunction>::cast( 45 Handle<JSFunction> f = Handle<JSFunction>::cast(
46 JSObject::GetProperty( 46 Object::GetProperty(
47 m, isolate()->factory()->NewStringFromAsciiChecked(name)) 47 m, isolate()->factory()->NewStringFromAsciiChecked(name))
48 .ToHandleChecked()); 48 .ToHandleChecked());
49 return HeapConstant(f); 49 return HeapConstant(f);
50 } 50 }
51 51
52 JSOperatorBuilder* javascript() { return &javascript_; } 52 JSOperatorBuilder* javascript() { return &javascript_; }
53 53
54 private: 54 private:
55 JSOperatorBuilder javascript_; 55 JSOperatorBuilder javascript_;
56 }; 56 };
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 Reduction r = Reduce(call); 184 Reduction r = Reduce(call);
185 185
186 ASSERT_TRUE(r.Changed()); 186 ASSERT_TRUE(r.Changed());
187 EXPECT_THAT(r.replacement(), IsTruncateFloat64ToFloat32(p0)); 187 EXPECT_THAT(r.replacement(), IsTruncateFloat64ToFloat32(p0));
188 } 188 }
189 } 189 }
190 190
191 } // namespace compiler 191 } // namespace compiler
192 } // namespace internal 192 } // namespace internal
193 } // namespace v8 193 } // namespace v8
OLDNEW
« no previous file with comments | « test/cctest/test-parsing.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698