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 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
774 v8::Local<v8::Context> context = isolate->GetCurrentContext(); | 774 v8::Local<v8::Context> context = isolate->GetCurrentContext(); |
775 v8::Local<v8::FunctionTemplate> t = | 775 v8::Local<v8::FunctionTemplate> t = |
776 v8::FunctionTemplate::New(isolate, IsBaselineCompiled); | 776 v8::FunctionTemplate::New(isolate, IsBaselineCompiled); |
777 CHECK(context->Global() | 777 CHECK(context->Global() |
778 ->Set(context, v8_str("IsBaselineCompiled"), | 778 ->Set(context, v8_str("IsBaselineCompiled"), |
779 t->GetFunction(context).ToLocalChecked()) | 779 t->GetFunction(context).ToLocalChecked()) |
780 .FromJust()); | 780 .FromJust()); |
781 } | 781 } |
782 | 782 |
783 TEST(IgnitionBaselineOnReturn) { | 783 TEST(IgnitionBaselineOnReturn) { |
| 784 // TODO(4280): Remove this entire test once --ignition-preserve-bytecode is |
| 785 // the default and the flag is removed. This test doesn't provide benefit any |
| 786 // longer once {InterpreterActivationsFinder} is gone. |
| 787 if (FLAG_ignition_preserve_bytecode) return; |
784 FLAG_allow_natives_syntax = true; | 788 FLAG_allow_natives_syntax = true; |
785 FLAG_always_opt = false; | 789 FLAG_always_opt = false; |
786 CcTest::InitializeVM(); | 790 CcTest::InitializeVM(); |
787 FLAG_ignition = true; | 791 FLAG_ignition = true; |
788 Isolate* isolate = CcTest::i_isolate(); | 792 Isolate* isolate = CcTest::i_isolate(); |
789 isolate->interpreter()->Initialize(); | 793 isolate->interpreter()->Initialize(); |
790 v8::HandleScope scope(CcTest::isolate()); | 794 v8::HandleScope scope(CcTest::isolate()); |
791 InstallIsBaselineCompiledHelper(CcTest::isolate()); | 795 InstallIsBaselineCompiledHelper(CcTest::isolate()); |
792 | 796 |
793 CompileRun( | 797 CompileRun( |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
830 CHECK_NE(*isolate->builtins()->InterpreterEntryTrampoline(), f1->code()); | 834 CHECK_NE(*isolate->builtins()->InterpreterEntryTrampoline(), f1->code()); |
831 CHECK_EQ(*isolate->builtins()->InterpreterEntryTrampoline(), f2->code()); | 835 CHECK_EQ(*isolate->builtins()->InterpreterEntryTrampoline(), f2->code()); |
832 CHECK_EQ(23.0, GetGlobalProperty("result1")->Number()); | 836 CHECK_EQ(23.0, GetGlobalProperty("result1")->Number()); |
833 | 837 |
834 // Function {f2} will self-heal now. | 838 // Function {f2} will self-heal now. |
835 CompileRun("var result2 = f2()"); | 839 CompileRun("var result2 = f2()"); |
836 CHECK_NE(*isolate->builtins()->InterpreterEntryTrampoline(), f1->code()); | 840 CHECK_NE(*isolate->builtins()->InterpreterEntryTrampoline(), f1->code()); |
837 CHECK_NE(*isolate->builtins()->InterpreterEntryTrampoline(), f2->code()); | 841 CHECK_NE(*isolate->builtins()->InterpreterEntryTrampoline(), f2->code()); |
838 CHECK_EQ(23.0, GetGlobalProperty("result2")->Number()); | 842 CHECK_EQ(23.0, GetGlobalProperty("result2")->Number()); |
839 } | 843 } |
OLD | NEW |