| 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/debug.h" | 9 #include "src/debug/debug.h" |
| 10 #include "src/execution.h" | 10 #include "src/execution.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 TEST(VectorStructure) { | 34 TEST(VectorStructure) { |
| 35 LocalContext context; | 35 LocalContext context; |
| 36 v8::HandleScope scope(context->GetIsolate()); | 36 v8::HandleScope scope(context->GetIsolate()); |
| 37 Isolate* isolate = CcTest::i_isolate(); | 37 Isolate* isolate = CcTest::i_isolate(); |
| 38 Factory* factory = isolate->factory(); | 38 Factory* factory = isolate->factory(); |
| 39 Zone zone(isolate->allocator()); | 39 Zone zone(isolate->allocator()); |
| 40 | 40 |
| 41 // Empty vectors are the empty fixed array. | 41 // Empty vectors are the empty fixed array. |
| 42 StaticFeedbackVectorSpec empty; | 42 StaticFeedbackVectorSpec empty; |
| 43 Handle<TypeFeedbackVector> vector = NewTypeFeedbackVector(isolate, &empty); | 43 Handle<TypeFeedbackVector> vector = NewTypeFeedbackVector(isolate, &empty); |
| 44 CHECK(Handle<FixedArray>::cast(vector) | 44 CHECK(Handle<FixedArray>::cast(vector).is_identical_to( |
| 45 .is_identical_to(factory->empty_fixed_array())); | 45 factory->empty_type_feedback_vector())); |
| 46 // Which can nonetheless be queried. | 46 // Which can nonetheless be queried. |
| 47 CHECK(vector->is_empty()); | 47 CHECK(vector->is_empty()); |
| 48 | 48 |
| 49 { | 49 { |
| 50 FeedbackVectorSpec one_slot(&zone); | 50 FeedbackVectorSpec one_slot(&zone); |
| 51 one_slot.AddGeneralSlot(); | 51 one_slot.AddGeneralSlot(); |
| 52 vector = NewTypeFeedbackVector(isolate, &one_slot); | 52 vector = NewTypeFeedbackVector(isolate, &one_slot); |
| 53 FeedbackVectorHelper helper(vector); | 53 FeedbackVectorHelper helper(vector); |
| 54 CHECK_EQ(1, helper.slot_count()); | 54 CHECK_EQ(1, helper.slot_count()); |
| 55 } | 55 } |
| (...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 // There should be one IC slot. | 584 // There should be one IC slot. |
| 585 Handle<TypeFeedbackVector> feedback_vector(f->feedback_vector()); | 585 Handle<TypeFeedbackVector> feedback_vector(f->feedback_vector()); |
| 586 FeedbackVectorHelper helper(feedback_vector); | 586 FeedbackVectorHelper helper(feedback_vector); |
| 587 CHECK_EQ(1, helper.slot_count()); | 587 CHECK_EQ(1, helper.slot_count()); |
| 588 FeedbackVectorSlot slot(0); | 588 FeedbackVectorSlot slot(0); |
| 589 StoreICNexus nexus(feedback_vector, slot); | 589 StoreICNexus nexus(feedback_vector, slot); |
| 590 CHECK_EQ(MONOMORPHIC, nexus.StateFromFeedback()); | 590 CHECK_EQ(MONOMORPHIC, nexus.StateFromFeedback()); |
| 591 } | 591 } |
| 592 | 592 |
| 593 } // namespace | 593 } // namespace |
| OLD | NEW |