| OLD | NEW |
| 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/frames-inl.h" | 5 #include "src/frames-inl.h" |
| 6 #include "test/cctest/compiler/function-tester.h" | 6 #include "test/cctest/compiler/function-tester.h" |
| 7 | 7 |
| 8 namespace v8 { | 8 namespace v8 { |
| 9 namespace internal { | 9 namespace internal { |
| 10 namespace compiler { | 10 namespace compiler { |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 InstallAssertInlineCountHelper(CcTest::isolate()); | 261 InstallAssertInlineCountHelper(CcTest::isolate()); |
| 262 T.CheckCall(T.true_value(), T.Val(12), T.Val(14)); | 262 T.CheckCall(T.true_value(), T.Val(12), T.Val(14)); |
| 263 } | 263 } |
| 264 | 264 |
| 265 | 265 |
| 266 TEST(InlineTwice) { | 266 TEST(InlineTwice) { |
| 267 FunctionTester T( | 267 FunctionTester T( |
| 268 "(function () {" | 268 "(function () {" |
| 269 " var x = 42;" | 269 " var x = 42;" |
| 270 " function bar(s) { AssertInlineCount(2); return x + s; };" | 270 " function bar(s) { AssertInlineCount(2); return x + s; };" |
| 271 " return (function (s,t) { return bar(s) + bar(t); });" | 271 " function foo(s, t) { return bar(s) + bar(t); };" |
| 272 " return foo;" |
| 272 "})();", | 273 "})();", |
| 273 kInlineFlags); | 274 kInlineFlags); |
| 274 | 275 |
| 275 InstallAssertInlineCountHelper(CcTest::isolate()); | 276 InstallAssertInlineCountHelper(CcTest::isolate()); |
| 276 T.CheckCall(T.Val(2 * 42 + 12 + 4), T.Val(12), T.Val(4)); | 277 T.CheckCall(T.Val(2 * 42 + 12 + 4), T.Val(12), T.Val(4)); |
| 277 } | 278 } |
| 278 | 279 |
| 279 | 280 |
| 280 TEST(InlineTwiceDependent) { | 281 TEST(InlineTwiceDependent) { |
| 281 FunctionTester T( | 282 FunctionTester T( |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 "})();", | 572 "})();", |
| 572 kInlineFlags); | 573 kInlineFlags); |
| 573 | 574 |
| 574 InstallAssertInlineCountHelper(CcTest::isolate()); | 575 InstallAssertInlineCountHelper(CcTest::isolate()); |
| 575 T.CheckCall(T.Val(42), T.Val(1)); | 576 T.CheckCall(T.Val(42), T.Val(1)); |
| 576 } | 577 } |
| 577 | 578 |
| 578 } // namespace compiler | 579 } // namespace compiler |
| 579 } // namespace internal | 580 } // namespace internal |
| 580 } // namespace v8 | 581 } // namespace v8 |
| OLD | NEW |