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

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

Issue 1809993002: Provide optimized support for the %GetOrdinaryHasInstance intrinsic. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@bare-4774-fix
Patch Set: REBASE and nit. 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 | « src/full-codegen/x64/full-codegen-x64.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 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/access-builder.h" 5 #include "src/compiler/access-builder.h"
6 #include "src/compiler/diamond.h" 6 #include "src/compiler/diamond.h"
7 #include "src/compiler/js-graph.h" 7 #include "src/compiler/js-graph.h"
8 #include "src/compiler/js-intrinsic-lowering.h" 8 #include "src/compiler/js-intrinsic-lowering.h"
9 #include "src/compiler/js-operator.h" 9 #include "src/compiler/js-operator.h"
10 #include "test/unittests/compiler/graph-unittest.h" 10 #include "test/unittests/compiler/graph-unittest.h"
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 graph()->NewNode(javascript()->CallRuntime(Runtime::kInlineMathSqrt, 1), 270 graph()->NewNode(javascript()->CallRuntime(Runtime::kInlineMathSqrt, 1),
271 input, context, effect, control)); 271 input, context, effect, control));
272 ASSERT_TRUE(r.Changed()); 272 ASSERT_TRUE(r.Changed());
273 EXPECT_THAT(r.replacement(), IsFloat64Sqrt(input)); 273 EXPECT_THAT(r.replacement(), IsFloat64Sqrt(input));
274 } 274 }
275 275
276 276
277 // ----------------------------------------------------------------------------- 277 // -----------------------------------------------------------------------------
278 // %_MathClz32 278 // %_MathClz32
279 279
280
281 TEST_F(JSIntrinsicLoweringTest, InlineMathClz32) { 280 TEST_F(JSIntrinsicLoweringTest, InlineMathClz32) {
282 Node* const input = Parameter(0); 281 Node* const input = Parameter(0);
283 Node* const context = Parameter(1); 282 Node* const context = Parameter(1);
284 Node* const effect = graph()->start(); 283 Node* const effect = graph()->start();
285 Node* const control = graph()->start(); 284 Node* const control = graph()->start();
286 Reduction const r = Reduce( 285 Reduction const r = Reduce(
287 graph()->NewNode(javascript()->CallRuntime(Runtime::kInlineMathClz32, 1), 286 graph()->NewNode(javascript()->CallRuntime(Runtime::kInlineMathClz32, 1),
288 input, context, effect, control)); 287 input, context, effect, control));
289 ASSERT_TRUE(r.Changed()); 288 ASSERT_TRUE(r.Changed());
290 EXPECT_THAT(r.replacement(), IsWord32Clz(input)); 289 EXPECT_THAT(r.replacement(), IsWord32Clz(input));
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 effect, CaptureEq(&if_false0)), 326 effect, CaptureEq(&if_false0)),
328 effect, _), 327 effect, _),
329 IsInt32Constant(JS_VALUE_TYPE)), 328 IsInt32Constant(JS_VALUE_TYPE)),
330 CaptureEq(&if_false0)))))), 329 CaptureEq(&if_false0)))))),
331 IsMerge( 330 IsMerge(
332 IsIfTrue(AllOf(CaptureEq(&branch0), 331 IsIfTrue(AllOf(CaptureEq(&branch0),
333 IsBranch(IsObjectIsSmi(input), control))), 332 IsBranch(IsObjectIsSmi(input), control))),
334 AllOf(CaptureEq(&if_false0), IsIfFalse(CaptureEq(&branch0)))))); 333 AllOf(CaptureEq(&if_false0), IsIfFalse(CaptureEq(&branch0))))));
335 } 334 }
336 335
336 // -----------------------------------------------------------------------------
337 // %_GetOrdinaryHasInstance
338
339 TEST_F(JSIntrinsicLoweringTest, InlineGetOrdinaryHasInstance) {
340 Node* const context = Parameter(0);
341 Node* const effect = graph()->start();
342 Node* const control = graph()->start();
343 Reduction const r = Reduce(graph()->NewNode(
344 javascript()->CallRuntime(Runtime::kInlineGetOrdinaryHasInstance, 0),
345 context, effect, control));
346 ASSERT_TRUE(r.Changed());
347 EXPECT_THAT(
348 r.replacement(),
349 IsLoadContext(
350 ContextAccess(0, Context::ORDINARY_HAS_INSTANCE_INDEX, true), _));
351 }
352
337 } // namespace compiler 353 } // namespace compiler
338 } // namespace internal 354 } // namespace internal
339 } // namespace v8 355 } // namespace v8
OLDNEW
« no previous file with comments | « src/full-codegen/x64/full-codegen-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698