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

Side by Side Diff: src/objects-debug.cc

Issue 801813002: Using PropertyKind in transitions instead of PropertyType. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 | « src/objects.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 6
7 #include "src/disasm.h" 7 #include "src/disasm.h"
8 #include "src/disassembler.h" 8 #include "src/disassembler.h"
9 #include "src/heap/objects-visiting.h" 9 #include "src/heap/objects-visiting.h"
10 #include "src/jsregexp.h" 10 #include "src/jsregexp.h"
(...skipping 1195 matching lines...) Expand 10 before | Expand all | Expand 10 after
1206 } 1206 }
1207 } 1207 }
1208 } 1208 }
1209 return true; 1209 return true;
1210 } 1210 }
1211 1211
1212 1212
1213 bool TransitionArray::IsSortedNoDuplicates(int valid_entries) { 1213 bool TransitionArray::IsSortedNoDuplicates(int valid_entries) {
1214 DCHECK(valid_entries == -1); 1214 DCHECK(valid_entries == -1);
1215 Name* prev_key = NULL; 1215 Name* prev_key = NULL;
1216 bool prev_is_data_property = false; 1216 PropertyKind prev_kind = DATA;
1217 PropertyAttributes prev_attributes = NONE; 1217 PropertyAttributes prev_attributes = NONE;
1218 uint32_t prev_hash = 0; 1218 uint32_t prev_hash = 0;
1219 for (int i = 0; i < number_of_transitions(); i++) { 1219 for (int i = 0; i < number_of_transitions(); i++) {
1220 Name* key = GetSortedKey(i); 1220 Name* key = GetSortedKey(i);
1221 uint32_t hash = key->Hash(); 1221 uint32_t hash = key->Hash();
1222 bool is_data_property = false; 1222 PropertyKind kind = DATA;
1223 PropertyAttributes attributes = NONE; 1223 PropertyAttributes attributes = NONE;
1224 if (!IsSpecialTransition(key)) { 1224 if (!IsSpecialTransition(key)) {
1225 Map* target = GetTarget(i); 1225 Map* target = GetTarget(i);
1226 PropertyDetails details = GetTargetDetails(key, target); 1226 PropertyDetails details = GetTargetDetails(key, target);
1227 is_data_property = details.type() == FIELD || details.type() == CONSTANT; 1227 kind = details.kind();
1228 attributes = details.attributes(); 1228 attributes = details.attributes();
1229 } else { 1229 } else {
1230 // Duplicate entries are not allowed for non-property transitions. 1230 // Duplicate entries are not allowed for non-property transitions.
1231 CHECK_NE(prev_key, key); 1231 CHECK_NE(prev_key, key);
1232 } 1232 }
1233 1233
1234 int cmp = 1234 int cmp = CompareKeys(prev_key, prev_hash, prev_kind, prev_attributes, key,
1235 CompareKeys(prev_key, prev_hash, prev_is_data_property, prev_attributes, 1235 hash, kind, attributes);
1236 key, hash, is_data_property, attributes);
1237 if (cmp >= 0) { 1236 if (cmp >= 0) {
1238 Print(); 1237 Print();
1239 return false; 1238 return false;
1240 } 1239 }
1241 prev_key = key; 1240 prev_key = key;
1242 prev_hash = hash; 1241 prev_hash = hash;
1243 prev_attributes = attributes; 1242 prev_attributes = attributes;
1244 prev_is_data_property = is_data_property; 1243 prev_kind = kind;
1245 } 1244 }
1246 return true; 1245 return true;
1247 } 1246 }
1248 1247
1249 1248
1250 static bool CheckOneBackPointer(Map* current_map, Object* target) { 1249 static bool CheckOneBackPointer(Map* current_map, Object* target) {
1251 return !target->IsMap() || Map::cast(target)->GetBackPointer() == current_map; 1250 return !target->IsMap() || Map::cast(target)->GetBackPointer() == current_map;
1252 } 1251 }
1253 1252
1254 1253
(...skipping 19 matching lines...) Expand all
1274 while (map != heap->roots_array_start()[i++]) { 1273 while (map != heap->roots_array_start()[i++]) {
1275 CHECK_LT(i, Heap::kStrongRootListLength); 1274 CHECK_LT(i, Heap::kStrongRootListLength);
1276 } 1275 }
1277 } 1276 }
1278 } 1277 }
1279 1278
1280 1279
1281 #endif // DEBUG 1280 #endif // DEBUG
1282 1281
1283 } } // namespace v8::internal 1282 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698