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

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

Issue 300283002: Introduce FieldIndex to unify and abstract property/field offset (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix mutable boxed double runtime function Created 6 years, 6 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 | Annotate | Revision Log
« 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/disassembler.h" 7 #include "src/disassembler.h"
8 #include "src/disasm.h" 8 #include "src/disasm.h"
9 #include "src/jsregexp.h" 9 #include "src/jsregexp.h"
10 #include "src/macro-assembler.h" 10 #include "src/macro-assembler.h"
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 } 254 }
255 255
256 if (HasFastProperties()) { 256 if (HasFastProperties()) {
257 CHECK_EQ(map()->unused_property_fields(), 257 CHECK_EQ(map()->unused_property_fields(),
258 (map()->inobject_properties() + properties()->length() - 258 (map()->inobject_properties() + properties()->length() -
259 map()->NextFreePropertyIndex())); 259 map()->NextFreePropertyIndex()));
260 DescriptorArray* descriptors = map()->instance_descriptors(); 260 DescriptorArray* descriptors = map()->instance_descriptors();
261 for (int i = 0; i < map()->NumberOfOwnDescriptors(); i++) { 261 for (int i = 0; i < map()->NumberOfOwnDescriptors(); i++) {
262 if (descriptors->GetDetails(i).type() == FIELD) { 262 if (descriptors->GetDetails(i).type() == FIELD) {
263 Representation r = descriptors->GetDetails(i).representation(); 263 Representation r = descriptors->GetDetails(i).representation();
264 int field = descriptors->GetFieldIndex(i); 264 FieldIndex index = FieldIndex::ForDescriptor(map(), i);
265 Object* value = RawFastPropertyAt(field); 265 Object* value = RawFastPropertyAt(index);
266 if (r.IsDouble()) ASSERT(value->IsHeapNumber()); 266 if (r.IsDouble()) ASSERT(value->IsHeapNumber());
267 if (value->IsUninitialized()) continue; 267 if (value->IsUninitialized()) continue;
268 if (r.IsSmi()) ASSERT(value->IsSmi()); 268 if (r.IsSmi()) ASSERT(value->IsSmi());
269 if (r.IsHeapObject()) ASSERT(value->IsHeapObject()); 269 if (r.IsHeapObject()) ASSERT(value->IsHeapObject());
270 HeapType* field_type = descriptors->GetFieldType(i); 270 HeapType* field_type = descriptors->GetFieldType(i);
271 if (r.IsNone()) { 271 if (r.IsNone()) {
272 CHECK(field_type->Is(HeapType::None())); 272 CHECK(field_type->Is(HeapType::None()));
273 } else if (!HeapType::Any()->Is(field_type)) { 273 } else if (!HeapType::Any()->Is(field_type)) {
274 CHECK(!field_type->NowStable() || field_type->NowContains(value)); 274 CHECK(!field_type->NowStable() || field_type->NowContains(value));
275 } 275 }
(...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after
1186 for (int i = 0; i < number_of_transitions(); ++i) { 1186 for (int i = 0; i < number_of_transitions(); ++i) {
1187 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; 1187 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false;
1188 } 1188 }
1189 return true; 1189 return true;
1190 } 1190 }
1191 1191
1192 1192
1193 #endif // DEBUG 1193 #endif // DEBUG
1194 1194
1195 } } // namespace v8::internal 1195 } } // 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