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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 FeedbackVectorSlot slot_for_a(0); | 313 FeedbackVectorSlot slot_for_a(0); |
314 Object* object = feedback_vector->Get(slot_for_a); | 314 Object* object = feedback_vector->Get(slot_for_a); |
315 CHECK(object->IsWeakCell() && | 315 CHECK(object->IsWeakCell() && |
316 WeakCell::cast(object)->value()->IsJSFunction()); | 316 WeakCell::cast(object)->value()->IsJSFunction()); |
317 | 317 |
318 CompileRun("%OptimizeFunctionOnNextCall(f); f(fun1);"); | 318 CompileRun("%OptimizeFunctionOnNextCall(f); f(fun1);"); |
319 | 319 |
320 // Verify that the feedback is still "gathered" despite a recompilation | 320 // Verify that the feedback is still "gathered" despite a recompilation |
321 // of the full code. | 321 // of the full code. |
322 CHECK(f->IsOptimized()); | 322 CHECK(f->IsOptimized()); |
323 CHECK(f->shared()->has_deoptimization_support()); | 323 // If the baseline code is bytecode, then it will not have deoptimization |
| 324 // support. has_deoptimization_support() check is only required if the |
| 325 // baseline code is from fullcodegen. |
| 326 CHECK(f->shared()->has_deoptimization_support() || i::FLAG_ignition); |
324 object = f->feedback_vector()->Get(slot_for_a); | 327 object = f->feedback_vector()->Get(slot_for_a); |
325 CHECK(object->IsWeakCell() && | 328 CHECK(object->IsWeakCell() && |
326 WeakCell::cast(object)->value()->IsJSFunction()); | 329 WeakCell::cast(object)->value()->IsJSFunction()); |
327 } | 330 } |
328 | 331 |
329 | 332 |
330 TEST(FeedbackVectorUnaffectedByScopeChanges) { | 333 TEST(FeedbackVectorUnaffectedByScopeChanges) { |
331 if (i::FLAG_always_opt || !i::FLAG_lazy || | 334 if (i::FLAG_always_opt || !i::FLAG_lazy || |
332 (FLAG_ignition && FLAG_ignition_eager)) { | 335 (FLAG_ignition && FLAG_ignition_eager)) { |
333 return; | 336 return; |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
793 " %CompileBaseline(f);\n" | 796 " %CompileBaseline(f);\n" |
794 " is_baseline_in_function = IsBaselineCompiled(f);\n" | 797 " is_baseline_in_function = IsBaselineCompiled(f);\n" |
795 " return 1234;\n" | 798 " return 1234;\n" |
796 "};\n" | 799 "};\n" |
797 "return_val = f();\n" | 800 "return_val = f();\n" |
798 "is_baseline_after_return = IsBaselineCompiled(f);\n"); | 801 "is_baseline_after_return = IsBaselineCompiled(f);\n"); |
799 CHECK_EQ(false, GetGlobalProperty("is_baseline_in_function")->BooleanValue()); | 802 CHECK_EQ(false, GetGlobalProperty("is_baseline_in_function")->BooleanValue()); |
800 CHECK_EQ(true, GetGlobalProperty("is_baseline_after_return")->BooleanValue()); | 803 CHECK_EQ(true, GetGlobalProperty("is_baseline_after_return")->BooleanValue()); |
801 CHECK_EQ(1234.0, GetGlobalProperty("return_val")->Number()); | 804 CHECK_EQ(1234.0, GetGlobalProperty("return_val")->Number()); |
802 } | 805 } |
OLD | NEW |