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

Side by Side Diff: src/objects.cc

Issue 2885883004: [heap] Fix verification of unsafe object layout changes. (Closed)
Patch Set: remove redundant check Created 3 years, 7 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
« no previous file with comments | « src/objects.h ('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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/objects.h" 5 #include "src/objects.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <iomanip> 8 #include <iomanip>
9 #include <memory> 9 #include <memory>
10 #include <sstream> 10 #include <sstream>
(...skipping 3319 matching lines...) Expand 10 before | Expand all | Expand 10 after
3330 case kInteger32: return "i"; 3330 case kInteger32: return "i";
3331 case kHeapObject: return "h"; 3331 case kHeapObject: return "h";
3332 case kExternal: return "x"; 3332 case kExternal: return "x";
3333 default: 3333 default:
3334 UNREACHABLE(); 3334 UNREACHABLE();
3335 return NULL; 3335 return NULL;
3336 } 3336 }
3337 } 3337 }
3338 3338
3339 bool Map::TransitionRemovesTaggedField(Map* target) { 3339 bool Map::TransitionRemovesTaggedField(Map* target) {
3340 int inobject = GetInObjectProperties(); 3340 int inobject = NumberOfFields();
3341 int target_inobject = target->GetInObjectProperties(); 3341 int target_inobject = target->NumberOfFields();
3342 for (int i = target_inobject; i < inobject; i++) { 3342 for (int i = target_inobject; i < inobject; i++) {
3343 FieldIndex index = FieldIndex::ForPropertyIndex(this, i); 3343 FieldIndex index = FieldIndex::ForPropertyIndex(this, i);
3344 if (!IsUnboxedDoubleField(index)) return true; 3344 if (!IsUnboxedDoubleField(index)) return true;
3345 } 3345 }
3346 return false; 3346 return false;
3347 } 3347 }
3348 3348
3349 bool Map::TransitionChangesTaggedFieldToUntaggedField(Map* target) { 3349 bool Map::TransitionChangesTaggedFieldToUntaggedField(Map* target) {
3350 int inobject = GetInObjectProperties(); 3350 int inobject = NumberOfFields();
3351 int target_inobject = target->GetInObjectProperties(); 3351 int target_inobject = target->NumberOfFields();
3352 int limit = Min(inobject, target_inobject); 3352 int limit = Min(inobject, target_inobject);
3353 for (int i = 0; i < limit; i++) { 3353 for (int i = 0; i < limit; i++) {
3354 FieldIndex index = FieldIndex::ForPropertyIndex(target, i); 3354 FieldIndex index = FieldIndex::ForPropertyIndex(target, i);
3355 if (!IsUnboxedDoubleField(index) && target->IsUnboxedDoubleField(index)) { 3355 if (!IsUnboxedDoubleField(index) && target->IsUnboxedDoubleField(index)) {
3356 return true; 3356 return true;
3357 } 3357 }
3358 } 3358 }
3359 return false; 3359 return false;
3360 } 3360 }
3361 3361
(...skipping 17151 matching lines...) Expand 10 before | Expand all | Expand 10 after
20513 // not 20513 // not
20514 // depend on this. 20514 // depend on this.
20515 return DICTIONARY_ELEMENTS; 20515 return DICTIONARY_ELEMENTS;
20516 } 20516 }
20517 DCHECK_LE(kind, LAST_ELEMENTS_KIND); 20517 DCHECK_LE(kind, LAST_ELEMENTS_KIND);
20518 return kind; 20518 return kind;
20519 } 20519 }
20520 } 20520 }
20521 } // namespace internal 20521 } // namespace internal
20522 } // namespace v8 20522 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698