OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 | 361 |
362 void Oddball::OddballVerify() { | 362 void Oddball::OddballVerify() { |
363 CHECK(IsOddball()); | 363 CHECK(IsOddball()); |
364 VerifyHeapPointer(to_string()); | 364 VerifyHeapPointer(to_string()); |
365 Object* number = to_number(); | 365 Object* number = to_number(); |
366 if (number->IsHeapObject()) { | 366 if (number->IsHeapObject()) { |
367 ASSERT(number == Heap::nan_value()); | 367 ASSERT(number == Heap::nan_value()); |
368 } else { | 368 } else { |
369 ASSERT(number->IsSmi()); | 369 ASSERT(number->IsSmi()); |
370 int value = Smi::cast(number)->value(); | 370 int value = Smi::cast(number)->value(); |
371 ASSERT(value == 0 || value == 1 || value == -1 || | 371 // Hidden oddballs have negative smis. |
372 value == -2 || value == -3); | 372 const int kLeastHiddenOddballNumber = -4; |
| 373 ASSERT(value <= 1); |
| 374 ASSERT(value >= kLeastHiddenOddballNumber); |
373 } | 375 } |
374 } | 376 } |
375 | 377 |
376 | 378 |
377 void JSGlobalPropertyCell::JSGlobalPropertyCellVerify() { | 379 void JSGlobalPropertyCell::JSGlobalPropertyCellVerify() { |
378 CHECK(IsJSGlobalPropertyCell()); | 380 CHECK(IsJSGlobalPropertyCell()); |
379 VerifyObjectField(kValueOffset); | 381 VerifyObjectField(kValueOffset); |
380 } | 382 } |
381 | 383 |
382 | 384 |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
695 ASSERT(e->IsUndefined()); | 697 ASSERT(e->IsUndefined()); |
696 } | 698 } |
697 } | 699 } |
698 } | 700 } |
699 } | 701 } |
700 | 702 |
701 | 703 |
702 #endif // DEBUG | 704 #endif // DEBUG |
703 | 705 |
704 } } // namespace v8::internal | 706 } } // namespace v8::internal |
OLD | NEW |