| 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/v8.h" | 5 #include "src/v8.h" |
| 6 #include "test/cctest/cctest.h" | 6 #include "test/cctest/cctest.h" |
| 7 | 7 |
| 8 #include "src/api.h" | 8 #include "src/api.h" |
| 9 #include "src/debug.h" | 9 #include "src/debug.h" |
| 10 #include "src/execution.h" | 10 #include "src/execution.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 CHECK_EQ(10, vector->Slots()); | 83 CHECK_EQ(10, vector->Slots()); |
| 84 CHECK_EQ(3 * 10, vector->ICSlots()); | 84 CHECK_EQ(3 * 10, vector->ICSlots()); |
| 85 | 85 |
| 86 // Set metadata. | 86 // Set metadata. |
| 87 for (int i = 0; i < 30; i++) { | 87 for (int i = 0; i < 30; i++) { |
| 88 Code::Kind kind; | 88 Code::Kind kind; |
| 89 if (i % 3 == 0) | 89 if (i % 3 == 0) |
| 90 kind = Code::CALL_IC; | 90 kind = Code::CALL_IC; |
| 91 else if (i % 3 == 1) | 91 else if (i % 3 == 1) |
| 92 kind = Code::LOAD_IC; | 92 kind = Code::LOAD_IC; |
| 93 else if (i % 3 == 2) | 93 else |
| 94 kind = Code::KEYED_LOAD_IC; | 94 kind = Code::KEYED_LOAD_IC; |
| 95 vector->SetKind(FeedbackVectorICSlot(i), kind); | 95 vector->SetKind(FeedbackVectorICSlot(i), kind); |
| 96 } | 96 } |
| 97 | 97 |
| 98 // Meanwhile set some feedback values and type feedback values to | 98 // Meanwhile set some feedback values and type feedback values to |
| 99 // verify the data structure remains intact. | 99 // verify the data structure remains intact. |
| 100 vector->change_ic_with_type_info_count(100); | 100 vector->change_ic_with_type_info_count(100); |
| 101 vector->change_ic_generic_count(3333); | 101 vector->change_ic_generic_count(3333); |
| 102 vector->Set(FeedbackVectorSlot(0), *vector); | 102 vector->Set(FeedbackVectorSlot(0), *vector); |
| 103 | 103 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 CHECK( | 191 CHECK( |
| 192 feedback_vector->Get(FeedbackVectorICSlot(ic_slot))->IsAllocationSite()); | 192 feedback_vector->Get(FeedbackVectorICSlot(ic_slot))->IsAllocationSite()); |
| 193 heap->CollectAllGarbage(i::Heap::kNoGCFlags); | 193 heap->CollectAllGarbage(i::Heap::kNoGCFlags); |
| 194 feedback_vector = f->shared()->feedback_vector(); | 194 feedback_vector = f->shared()->feedback_vector(); |
| 195 CHECK_EQ(1, feedback_vector->ic_with_type_info_count()); | 195 CHECK_EQ(1, feedback_vector->ic_with_type_info_count()); |
| 196 CHECK_EQ(0, feedback_vector->ic_generic_count()); | 196 CHECK_EQ(0, feedback_vector->ic_generic_count()); |
| 197 CHECK( | 197 CHECK( |
| 198 feedback_vector->Get(FeedbackVectorICSlot(ic_slot))->IsAllocationSite()); | 198 feedback_vector->Get(FeedbackVectorICSlot(ic_slot))->IsAllocationSite()); |
| 199 } | 199 } |
| 200 } | 200 } |
| OLD | NEW |