| OLD | NEW | 
|     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  Loading... | 
|   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->oddball_map()) { | 
 |   624     CHECK(this == heap->no_interceptor_result_sentinel() || | 
 |   625           this == heap->arguments_marker() || | 
 |   626           this == heap->termination_exception()); | 
 |   627   } else { | 
 |   628     UNREACHABLE(); | 
 |   629   } | 
|   611 } |   630 } | 
|   612  |   631  | 
|   613  |   632  | 
|   614 void Cell::CellVerify() { |   633 void Cell::CellVerify() { | 
|   615   CHECK(IsCell()); |   634   CHECK(IsCell()); | 
|   616   VerifyObjectField(kValueOffset); |   635   VerifyObjectField(kValueOffset); | 
|   617 } |   636 } | 
|   618  |   637  | 
|   619  |   638  | 
|   620 void PropertyCell::PropertyCellVerify() { |   639 void PropertyCell::PropertyCellVerify() { | 
| (...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1159   for (int i = 0; i < number_of_transitions(); ++i) { |  1178   for (int i = 0; i < number_of_transitions(); ++i) { | 
|  1160     if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; |  1179     if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; | 
|  1161   } |  1180   } | 
|  1162   return true; |  1181   return true; | 
|  1163 } |  1182 } | 
|  1164  |  1183  | 
|  1165  |  1184  | 
|  1166 #endif  // DEBUG |  1185 #endif  // DEBUG | 
|  1167  |  1186  | 
|  1168 } }  // namespace v8::internal |  1187 } }  // namespace v8::internal | 
| OLD | NEW |