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

Side by Side Diff: test/cctest/test-transitions.cc

Issue 805453002: Introduced PropertyType ACCESSOR_FIELD. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments Created 6 years 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
« no previous file with comments | « test/cctest/test-heap-profiler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <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 12 matching lines...) Expand all
23 static void ConnectTransition(Handle<Map> parent, 23 static void ConnectTransition(Handle<Map> parent,
24 Handle<TransitionArray> transitions, 24 Handle<TransitionArray> transitions,
25 Handle<Map> child) { 25 Handle<Map> child) {
26 if (!parent->HasTransitionArray() || *transitions != parent->transitions()) { 26 if (!parent->HasTransitionArray() || *transitions != parent->transitions()) {
27 parent->set_transitions(*transitions); 27 parent->set_transitions(*transitions);
28 } 28 }
29 child->SetBackPointer(*parent); 29 child->SetBackPointer(*parent);
30 } 30 }
31 31
32 32
33 static void CheckPropertyDetailsFieldsConsistency(PropertyType type,
34 PropertyKind kind,
35 PropertyLocation location) {
36 int type_value = PropertyDetails::TypeField::encode(type);
37 int kind_location_value = PropertyDetails::KindField::encode(kind) |
38 PropertyDetails::LocationField::encode(location);
39 CHECK_EQ(type_value, kind_location_value);
40 }
41
42
43 TEST(PropertyDetailsFieldsConsistency) {
44 CheckPropertyDetailsFieldsConsistency(FIELD, DATA, IN_OBJECT);
45 CheckPropertyDetailsFieldsConsistency(CONSTANT, DATA, IN_DESCRIPTOR);
46 CheckPropertyDetailsFieldsConsistency(ACCESSOR_FIELD, ACCESSOR, IN_OBJECT);
47 CheckPropertyDetailsFieldsConsistency(CALLBACKS, ACCESSOR, IN_DESCRIPTOR);
48 }
49
50
33 TEST(TransitionArray_SimpleFieldTransitions) { 51 TEST(TransitionArray_SimpleFieldTransitions) {
34 CcTest::InitializeVM(); 52 CcTest::InitializeVM();
35 v8::HandleScope scope(CcTest::isolate()); 53 v8::HandleScope scope(CcTest::isolate());
36 Isolate* isolate = CcTest::i_isolate(); 54 Isolate* isolate = CcTest::i_isolate();
37 Factory* factory = isolate->factory(); 55 Factory* factory = isolate->factory();
38 56
39 Handle<String> name1 = factory->InternalizeUtf8String("foo"); 57 Handle<String> name1 = factory->InternalizeUtf8String("foo");
40 Handle<String> name2 = factory->InternalizeUtf8String("bar"); 58 Handle<String> name2 = factory->InternalizeUtf8String("bar");
41 PropertyAttributes attributes = NONE; 59 PropertyAttributes attributes = NONE;
42 60
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 292
275 // Ensure that info about the other fields still valid. 293 // Ensure that info about the other fields still valid.
276 for (int i = 0; i < PROPS_COUNT; i++) { 294 for (int i = 0; i < PROPS_COUNT; i++) {
277 int transition = transitions->Search(DATA, *names[i], NONE); 295 int transition = transitions->Search(DATA, *names[i], NONE);
278 CHECK_EQ(*names[i], transitions->GetKey(transition)); 296 CHECK_EQ(*names[i], transitions->GetKey(transition));
279 CHECK_EQ(*maps[i], transitions->GetTarget(transition)); 297 CHECK_EQ(*maps[i], transitions->GetTarget(transition));
280 } 298 }
281 299
282 DCHECK(transitions->IsSortedNoDuplicates()); 300 DCHECK(transitions->IsSortedNoDuplicates());
283 } 301 }
OLDNEW
« no previous file with comments | « test/cctest/test-heap-profiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698