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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 Object* object = feedback_vector->Get(slot_for_a); | 315 Object* object = feedback_vector->Get(slot_for_a); |
316 CHECK(object->IsWeakCell() && | 316 CHECK(object->IsWeakCell() && |
317 WeakCell::cast(object)->value()->IsJSFunction()); | 317 WeakCell::cast(object)->value()->IsJSFunction()); |
318 | 318 |
319 CompileRun("%OptimizeFunctionOnNextCall(f); f(fun1);"); | 319 CompileRun("%OptimizeFunctionOnNextCall(f); f(fun1);"); |
320 | 320 |
321 // Verify that the feedback is still "gathered" despite a recompilation | 321 // Verify that the feedback is still "gathered" despite a recompilation |
322 // of the full code. | 322 // of the full code. |
323 CHECK(f->IsOptimized()); | 323 CHECK(f->IsOptimized()); |
324 // If the baseline code is bytecode, then it will not have deoptimization | 324 // If the baseline code is bytecode, then it will not have deoptimization |
325 // support. The has_deoptimization_support() check is only required if the | 325 // support. has_deoptimization_support() check is only required if the |
326 // baseline code is from fullcodegen. | 326 // baseline code is from fullcodegen. |
327 CHECK(f->shared()->has_deoptimization_support() || i::FLAG_ignition || | 327 CHECK(f->shared()->has_deoptimization_support() || i::FLAG_ignition); |
328 i::FLAG_turbo); | |
329 object = f->feedback_vector()->Get(slot_for_a); | 328 object = f->feedback_vector()->Get(slot_for_a); |
330 CHECK(object->IsWeakCell() && | 329 CHECK(object->IsWeakCell() && |
331 WeakCell::cast(object)->value()->IsJSFunction()); | 330 WeakCell::cast(object)->value()->IsJSFunction()); |
332 } | 331 } |
333 | 332 |
334 | 333 |
335 TEST(FeedbackVectorUnaffectedByScopeChanges) { | 334 TEST(FeedbackVectorUnaffectedByScopeChanges) { |
336 if (i::FLAG_always_opt || !i::FLAG_lazy || | 335 if (i::FLAG_always_opt || !i::FLAG_lazy || |
337 (FLAG_ignition && FLAG_ignition_eager)) { | 336 (FLAG_ignition && FLAG_ignition_eager)) { |
338 return; | 337 return; |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
715 CompileRun("foo()"); | 714 CompileRun("foo()"); |
716 CHECK_EQ(2, foo->feedback_vector()->invocation_count()); | 715 CHECK_EQ(2, foo->feedback_vector()->invocation_count()); |
717 CompileRun("bar()"); | 716 CompileRun("bar()"); |
718 CHECK_EQ(2, foo->feedback_vector()->invocation_count()); | 717 CHECK_EQ(2, foo->feedback_vector()->invocation_count()); |
719 CompileRun("foo(); foo()"); | 718 CompileRun("foo(); foo()"); |
720 CHECK_EQ(4, foo->feedback_vector()->invocation_count()); | 719 CHECK_EQ(4, foo->feedback_vector()->invocation_count()); |
721 CompileRun("%BaselineFunctionOnNextCall(foo);"); | 720 CompileRun("%BaselineFunctionOnNextCall(foo);"); |
722 CompileRun("foo();"); | 721 CompileRun("foo();"); |
723 CHECK_EQ(5, foo->feedback_vector()->invocation_count()); | 722 CHECK_EQ(5, foo->feedback_vector()->invocation_count()); |
724 } | 723 } |
OLD | NEW |