OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 } | 529 } |
530 | 530 |
531 | 531 |
532 void Failure::FailurePrint() { | 532 void Failure::FailurePrint() { |
533 PrintF("Failure(%d)", value()); | 533 PrintF("Failure(%d)", value()); |
534 } | 534 } |
535 | 535 |
536 | 536 |
537 Failure* Failure::RetryAfterGC(int requested_bytes, AllocationSpace space) { | 537 Failure* Failure::RetryAfterGC(int requested_bytes, AllocationSpace space) { |
538 ASSERT((space & ~kSpaceTagMask) == 0); | 538 ASSERT((space & ~kSpaceTagMask) == 0); |
| 539 // TODO(X64): Stop using Smi validation for non-smi checks, even if they |
| 540 // happen to be identical at the moment. |
| 541 |
539 int requested = requested_bytes >> kObjectAlignmentBits; | 542 int requested = requested_bytes >> kObjectAlignmentBits; |
540 int value = (requested << kSpaceTagSize) | space; | 543 int value = (requested << kSpaceTagSize) | space; |
541 // We can't very well allocate a heap number in this situation, and if the | 544 // We can't very well allocate a heap number in this situation, and if the |
542 // requested memory is so large it seems reasonable to say that this is an | 545 // requested memory is so large it seems reasonable to say that this is an |
543 // out of memory situation. This fixes a crash in | 546 // out of memory situation. This fixes a crash in |
544 // js1_5/Regress/regress-303213.js. | 547 // js1_5/Regress/regress-303213.js. |
545 if (value >> kSpaceTagSize != requested || | 548 if (value >> kSpaceTagSize != requested || |
546 !Smi::IsValid(value) || | 549 !Smi::IsValid(value) || |
547 value != ((value << kFailureTypeTagSize) >> kFailureTypeTagSize) || | 550 value != ((value << kFailureTypeTagSize) >> kFailureTypeTagSize) || |
548 !Smi::IsValid(value << kFailureTypeTagSize)) { | 551 !Smi::IsValid(value << kFailureTypeTagSize)) { |
(...skipping 6909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7458 // No break point. | 7461 // No break point. |
7459 if (break_point_objects()->IsUndefined()) return 0; | 7462 if (break_point_objects()->IsUndefined()) return 0; |
7460 // Single beak point. | 7463 // Single beak point. |
7461 if (!break_point_objects()->IsFixedArray()) return 1; | 7464 if (!break_point_objects()->IsFixedArray()) return 1; |
7462 // Multiple break points. | 7465 // Multiple break points. |
7463 return FixedArray::cast(break_point_objects())->length(); | 7466 return FixedArray::cast(break_point_objects())->length(); |
7464 } | 7467 } |
7465 #endif | 7468 #endif |
7466 | 7469 |
7467 } } // namespace v8::internal | 7470 } } // namespace v8::internal |
OLD | NEW |