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 <stdlib.h> | 5 #include <stdlib.h> |
6 #include <utility> | 6 #include <utility> |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/compilation-cache.h" | 10 #include "src/compilation-cache.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 PropertyKind kind, | 34 PropertyKind kind, |
35 PropertyLocation location) { | 35 PropertyLocation location) { |
36 int type_value = PropertyDetails::TypeField::encode(type); | 36 int type_value = PropertyDetails::TypeField::encode(type); |
37 int kind_location_value = PropertyDetails::KindField::encode(kind) | | 37 int kind_location_value = PropertyDetails::KindField::encode(kind) | |
38 PropertyDetails::LocationField::encode(location); | 38 PropertyDetails::LocationField::encode(location); |
39 CHECK_EQ(type_value, kind_location_value); | 39 CHECK_EQ(type_value, kind_location_value); |
40 } | 40 } |
41 | 41 |
42 | 42 |
43 TEST(PropertyDetailsFieldsConsistency) { | 43 TEST(PropertyDetailsFieldsConsistency) { |
44 CheckPropertyDetailsFieldsConsistency(FIELD, DATA, IN_OBJECT); | 44 CheckPropertyDetailsFieldsConsistency(DATA_FIELD, DATA, FIELD); |
45 CheckPropertyDetailsFieldsConsistency(CONSTANT, DATA, IN_DESCRIPTOR); | 45 CheckPropertyDetailsFieldsConsistency(DATA_CONSTANT, DATA, DESCRIPTOR); |
46 CheckPropertyDetailsFieldsConsistency(ACCESSOR_FIELD, ACCESSOR, IN_OBJECT); | 46 CheckPropertyDetailsFieldsConsistency(ACCESSOR_FIELD, ACCESSOR, FIELD); |
47 CheckPropertyDetailsFieldsConsistency(CALLBACKS, ACCESSOR, IN_DESCRIPTOR); | 47 CheckPropertyDetailsFieldsConsistency(ACCESSOR_CONSTANT, ACCESSOR, |
| 48 DESCRIPTOR); |
48 } | 49 } |
49 | 50 |
50 | 51 |
51 TEST(TransitionArray_SimpleFieldTransitions) { | 52 TEST(TransitionArray_SimpleFieldTransitions) { |
52 CcTest::InitializeVM(); | 53 CcTest::InitializeVM(); |
53 v8::HandleScope scope(CcTest::isolate()); | 54 v8::HandleScope scope(CcTest::isolate()); |
54 Isolate* isolate = CcTest::i_isolate(); | 55 Isolate* isolate = CcTest::i_isolate(); |
55 Factory* factory = isolate->factory(); | 56 Factory* factory = isolate->factory(); |
56 | 57 |
57 Handle<String> name1 = factory->InternalizeUtf8String("foo"); | 58 Handle<String> name1 = factory->InternalizeUtf8String("foo"); |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 | 293 |
293 // Ensure that info about the other fields still valid. | 294 // Ensure that info about the other fields still valid. |
294 for (int i = 0; i < PROPS_COUNT; i++) { | 295 for (int i = 0; i < PROPS_COUNT; i++) { |
295 int transition = transitions->Search(DATA, *names[i], NONE); | 296 int transition = transitions->Search(DATA, *names[i], NONE); |
296 CHECK_EQ(*names[i], transitions->GetKey(transition)); | 297 CHECK_EQ(*names[i], transitions->GetKey(transition)); |
297 CHECK_EQ(*maps[i], transitions->GetTarget(transition)); | 298 CHECK_EQ(*maps[i], transitions->GetTarget(transition)); |
298 } | 299 } |
299 | 300 |
300 DCHECK(transitions->IsSortedNoDuplicates()); | 301 DCHECK(transitions->IsSortedNoDuplicates()); |
301 } | 302 } |
OLD | NEW |