Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(363)

Side by Side Diff: test/cctest/test-feedback-vector.cc

Issue 1217943004: Vector ICs: Introduce an InstanceType for the type feedback vector. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Improved printer. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
11 #include "src/factory.h" 11 #include "src/factory.h"
12 #include "src/global-handles.h" 12 #include "src/global-handles.h"
13 #include "src/macro-assembler.h" 13 #include "src/macro-assembler.h"
14 #include "src/objects.h" 14 #include "src/objects.h"
15 15
16 using namespace v8::internal; 16 using namespace v8::internal;
17 17
18 namespace { 18 namespace {
19 19
20 TEST(VectorStructure) { 20 TEST(VectorStructure) {
21 LocalContext context; 21 LocalContext context;
22 v8::HandleScope scope(context->GetIsolate()); 22 v8::HandleScope scope(context->GetIsolate());
23 Isolate* isolate = CcTest::i_isolate(); 23 Isolate* isolate = CcTest::i_isolate();
24 Factory* factory = isolate->factory(); 24 Factory* factory = isolate->factory();
25 Zone* zone = isolate->runtime_zone(); 25 Zone* zone = isolate->runtime_zone();
26 26
27 // Empty vectors are the empty fixed array. 27 // Empty vectors are the empty fixed array.
28 FeedbackVectorSpec empty; 28 FeedbackVectorSpec empty;
29 Handle<TypeFeedbackVector> vector = factory->NewTypeFeedbackVector(&empty); 29 Handle<TypeFeedbackVector> vector = factory->NewTypeFeedbackVector(&empty);
30 CHECK(Handle<FixedArray>::cast(vector) 30 CHECK(Handle<Object>::cast(vector)
31 .is_identical_to(factory->empty_fixed_array())); 31 .is_identical_to(factory->empty_feedback_vector()));
32 // Which can nonetheless be queried. 32 // Which can nonetheless be queried.
33 CHECK_EQ(0, vector->ic_with_type_info_count()); 33 CHECK_EQ(0, vector->ic_with_type_info_count());
34 CHECK_EQ(0, vector->ic_generic_count()); 34 CHECK_EQ(0, vector->ic_generic_count());
35 CHECK_EQ(0, vector->Slots()); 35 CHECK_EQ(0, vector->Slots());
36 CHECK_EQ(0, vector->ICSlots()); 36 CHECK_EQ(0, vector->ICSlots());
37 37
38 FeedbackVectorSpec one_slot(1); 38 FeedbackVectorSpec one_slot(1);
39 vector = factory->NewTypeFeedbackVector(&one_slot); 39 vector = factory->NewTypeFeedbackVector(&one_slot);
40 CHECK_EQ(1, vector->Slots()); 40 CHECK_EQ(1, vector->Slots());
41 CHECK_EQ(0, vector->ICSlots()); 41 CHECK_EQ(0, vector->ICSlots());
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 CHECK(number_map_found && o_map_found); 379 CHECK(number_map_found && o_map_found);
380 380
381 // The degree of polymorphism doesn't change. 381 // The degree of polymorphism doesn't change.
382 CompileRun("f(100)"); 382 CompileRun("f(100)");
383 CHECK_EQ(POLYMORPHIC, nexus.StateFromFeedback()); 383 CHECK_EQ(POLYMORPHIC, nexus.StateFromFeedback());
384 MapHandleList maps2; 384 MapHandleList maps2;
385 nexus.FindAllMaps(&maps2); 385 nexus.FindAllMaps(&maps2);
386 CHECK_EQ(2, maps2.length()); 386 CHECK_EQ(2, maps2.length());
387 } 387 }
388 } 388 }
OLDNEW
« src/type-feedback-vector.h ('K') | « src/types.cc ('k') | test/mjsunit/call-counts.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698