OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
618 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f")); | 618 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f")); |
619 } | 619 } |
620 #endif | 620 #endif |
621 | 621 |
622 TEST(IgnitionEntryTrampolineSelfHealing) { | 622 TEST(IgnitionEntryTrampolineSelfHealing) { |
623 FLAG_allow_natives_syntax = true; | 623 FLAG_allow_natives_syntax = true; |
624 FLAG_always_opt = false; | 624 FLAG_always_opt = false; |
625 CcTest::InitializeVM(); | 625 CcTest::InitializeVM(); |
626 FLAG_ignition = true; | 626 FLAG_ignition = true; |
627 Isolate* isolate = CcTest::i_isolate(); | 627 Isolate* isolate = CcTest::i_isolate(); |
628 isolate->interpreter()->Initialize(); | |
629 v8::HandleScope scope(CcTest::isolate()); | 628 v8::HandleScope scope(CcTest::isolate()); |
630 | 629 |
631 CompileRun( | 630 CompileRun( |
632 "function MkFun() {" | 631 "function MkFun() {" |
633 " function f() { return 23 }" | 632 " function f() { return 23 }" |
634 " return f" | 633 " return f" |
635 "}" | 634 "}" |
636 "var f1 = MkFun(); f1();" | 635 "var f1 = MkFun(); f1();" |
637 "var f2 = MkFun(); f2();" | 636 "var f2 = MkFun(); f2();" |
638 "%BaselineFunctionOnNextCall(f1);"); | 637 "%BaselineFunctionOnNextCall(f1);"); |
(...skipping 28 matching lines...) Expand all Loading... |
667 CompileRun("foo()"); | 666 CompileRun("foo()"); |
668 CHECK_EQ(2, foo->feedback_vector()->invocation_count()); | 667 CHECK_EQ(2, foo->feedback_vector()->invocation_count()); |
669 CompileRun("bar()"); | 668 CompileRun("bar()"); |
670 CHECK_EQ(2, foo->feedback_vector()->invocation_count()); | 669 CHECK_EQ(2, foo->feedback_vector()->invocation_count()); |
671 CompileRun("foo(); foo()"); | 670 CompileRun("foo(); foo()"); |
672 CHECK_EQ(4, foo->feedback_vector()->invocation_count()); | 671 CHECK_EQ(4, foo->feedback_vector()->invocation_count()); |
673 CompileRun("%BaselineFunctionOnNextCall(foo);"); | 672 CompileRun("%BaselineFunctionOnNextCall(foo);"); |
674 CompileRun("foo();"); | 673 CompileRun("foo();"); |
675 CHECK_EQ(5, foo->feedback_vector()->invocation_count()); | 674 CHECK_EQ(5, foo->feedback_vector()->invocation_count()); |
676 } | 675 } |
OLD | NEW |