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

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

Issue 227473002: Use distinct maps for oddballs with special handling in the type system. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Put kInternal last. Created 6 years, 8 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/ic.cc ('k') | src/types.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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 for (int i = GlobalObject::kBuiltinsOffset; 589 for (int i = GlobalObject::kBuiltinsOffset;
590 i < JSBuiltinsObject::kSize; 590 i < JSBuiltinsObject::kSize;
591 i += kPointerSize) { 591 i += kPointerSize) {
592 VerifyObjectField(i); 592 VerifyObjectField(i);
593 } 593 }
594 } 594 }
595 595
596 596
597 void Oddball::OddballVerify() { 597 void Oddball::OddballVerify() {
598 CHECK(IsOddball()); 598 CHECK(IsOddball());
599 Heap* heap = GetHeap();
599 VerifyHeapPointer(to_string()); 600 VerifyHeapPointer(to_string());
600 Object* number = to_number(); 601 Object* number = to_number();
601 if (number->IsHeapObject()) { 602 if (number->IsHeapObject()) {
602 CHECK(number == HeapObject::cast(number)->GetHeap()->nan_value()); 603 CHECK(number == heap->nan_value());
603 } else { 604 } else {
604 CHECK(number->IsSmi()); 605 CHECK(number->IsSmi());
605 int value = Smi::cast(number)->value(); 606 int value = Smi::cast(number)->value();
606 // Hidden oddballs have negative smis. 607 // Hidden oddballs have negative smis.
607 const int kLeastHiddenOddballNumber = -4; 608 const int kLeastHiddenOddballNumber = -4;
608 CHECK_LE(value, 1); 609 CHECK_LE(value, 1);
609 CHECK(value >= kLeastHiddenOddballNumber); 610 CHECK(value >= kLeastHiddenOddballNumber);
610 } 611 }
612 if (map() == heap->undefined_map()) {
613 CHECK(this == heap->undefined_value());
614 } else if (map() == heap->the_hole_map()) {
615 CHECK(this == heap->the_hole_value());
616 } else if (map() == heap->null_map()) {
617 CHECK(this == heap->null_value());
618 } else if (map() == heap->boolean_map()) {
619 CHECK(this == heap->true_value() ||
620 this == heap->false_value());
621 } else if (map() == heap->uninitialized_map()) {
622 CHECK(this == heap->uninitialized_value());
623 } else if (map() == heap->no_interceptor_result_sentinel_map()) {
624 CHECK(this == heap->no_interceptor_result_sentinel());
625 } else if (map() == heap->arguments_marker_map()) {
626 CHECK(this == heap->arguments_marker());
627 } else if (map() == heap->termination_exception_map()) {
628 CHECK(this == heap->termination_exception());
629 } else {
630 UNREACHABLE();
631 }
611 } 632 }
612 633
613 634
614 void Cell::CellVerify() { 635 void Cell::CellVerify() {
615 CHECK(IsCell()); 636 CHECK(IsCell());
616 VerifyObjectField(kValueOffset); 637 VerifyObjectField(kValueOffset);
617 } 638 }
618 639
619 640
620 void PropertyCell::PropertyCellVerify() { 641 void PropertyCell::PropertyCellVerify() {
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
1159 for (int i = 0; i < number_of_transitions(); ++i) { 1180 for (int i = 0; i < number_of_transitions(); ++i) {
1160 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; 1181 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false;
1161 } 1182 }
1162 return true; 1183 return true;
1163 } 1184 }
1164 1185
1165 1186
1166 #endif // DEBUG 1187 #endif // DEBUG
1167 1188
1168 } } // namespace v8::internal 1189 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ic.cc ('k') | src/types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698