OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 "src/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
8 #include "src/disasm.h" | 8 #include "src/disasm.h" |
9 #include "src/disassembler.h" | 9 #include "src/disassembler.h" |
10 #include "src/macro-assembler.h" | 10 #include "src/macro-assembler.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 break; | 69 break; |
70 case FIXED_DOUBLE_ARRAY_TYPE: | 70 case FIXED_DOUBLE_ARRAY_TYPE: |
71 FixedDoubleArray::cast(this)->FixedDoubleArrayVerify(); | 71 FixedDoubleArray::cast(this)->FixedDoubleArrayVerify(); |
72 break; | 72 break; |
73 case BYTE_ARRAY_TYPE: | 73 case BYTE_ARRAY_TYPE: |
74 ByteArray::cast(this)->ByteArrayVerify(); | 74 ByteArray::cast(this)->ByteArrayVerify(); |
75 break; | 75 break; |
76 case BYTECODE_ARRAY_TYPE: | 76 case BYTECODE_ARRAY_TYPE: |
77 BytecodeArray::cast(this)->BytecodeArrayVerify(); | 77 BytecodeArray::cast(this)->BytecodeArrayVerify(); |
78 break; | 78 break; |
| 79 case TRANSITION_ARRAY_TYPE: |
| 80 TransitionArray::cast(this)->TransitionArrayVerify(); |
| 81 break; |
79 case FREE_SPACE_TYPE: | 82 case FREE_SPACE_TYPE: |
80 FreeSpace::cast(this)->FreeSpaceVerify(); | 83 FreeSpace::cast(this)->FreeSpaceVerify(); |
81 break; | 84 break; |
82 | 85 |
83 #define VERIFY_TYPED_ARRAY(Type, type, TYPE, ctype, size) \ | 86 #define VERIFY_TYPED_ARRAY(Type, type, TYPE, ctype, size) \ |
84 case FIXED_##TYPE##_ARRAY_TYPE: \ | 87 case FIXED_##TYPE##_ARRAY_TYPE: \ |
85 Fixed##Type##Array::cast(this)->FixedTypedArrayVerify(); \ | 88 Fixed##Type##Array::cast(this)->FixedTypedArrayVerify(); \ |
86 break; | 89 break; |
87 | 90 |
88 TYPED_ARRAYS(VERIFY_TYPED_ARRAY) | 91 TYPED_ARRAYS(VERIFY_TYPED_ARRAY) |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 V8_UINT64_C(0x7FF8000000000000); | 403 V8_UINT64_C(0x7FF8000000000000); |
401 // Create implementation specific sNaN by inverting relevant bit. | 404 // Create implementation specific sNaN by inverting relevant bit. |
402 unexpected ^= V8_UINT64_C(0x0008000000000000); | 405 unexpected ^= V8_UINT64_C(0x0008000000000000); |
403 CHECK((value & V8_UINT64_C(0x7FF8000000000000)) != unexpected || | 406 CHECK((value & V8_UINT64_C(0x7FF8000000000000)) != unexpected || |
404 (value & V8_UINT64_C(0x0007FFFFFFFFFFFF)) == V8_UINT64_C(0)); | 407 (value & V8_UINT64_C(0x0007FFFFFFFFFFFF)) == V8_UINT64_C(0)); |
405 } | 408 } |
406 } | 409 } |
407 } | 410 } |
408 | 411 |
409 | 412 |
| 413 void TransitionArray::TransitionArrayVerify() { |
| 414 for (int i = 0; i < length(); i++) { |
| 415 Object* e = get(i); |
| 416 VerifyPointer(e); |
| 417 } |
| 418 CHECK_LE(LengthFor(number_of_transitions()), length()); |
| 419 CHECK(next_link()->IsUndefined() || next_link()->IsSmi() || |
| 420 next_link()->IsTransitionArray()); |
| 421 } |
| 422 |
| 423 |
410 void JSGeneratorObject::JSGeneratorObjectVerify() { | 424 void JSGeneratorObject::JSGeneratorObjectVerify() { |
411 // In an expression like "new g()", there can be a point where a generator | 425 // In an expression like "new g()", there can be a point where a generator |
412 // object is allocated but its fields are all undefined, as it hasn't yet been | 426 // object is allocated but its fields are all undefined, as it hasn't yet been |
413 // initialized by the generator. Hence these weak checks. | 427 // initialized by the generator. Hence these weak checks. |
414 VerifyObjectField(kFunctionOffset); | 428 VerifyObjectField(kFunctionOffset); |
415 VerifyObjectField(kContextOffset); | 429 VerifyObjectField(kContextOffset); |
416 VerifyObjectField(kReceiverOffset); | 430 VerifyObjectField(kReceiverOffset); |
417 VerifyObjectField(kOperandStackOffset); | 431 VerifyObjectField(kOperandStackOffset); |
418 VerifyObjectField(kContinuationOffset); | 432 VerifyObjectField(kContinuationOffset); |
419 } | 433 } |
(...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1308 | 1322 |
1309 // Both are done at the same time. | 1323 // Both are done at the same time. |
1310 CHECK_EQ(new_it.done(), old_it.done()); | 1324 CHECK_EQ(new_it.done(), old_it.done()); |
1311 } | 1325 } |
1312 | 1326 |
1313 | 1327 |
1314 #endif // DEBUG | 1328 #endif // DEBUG |
1315 | 1329 |
1316 } // namespace internal | 1330 } // namespace internal |
1317 } // namespace v8 | 1331 } // namespace v8 |
OLD | NEW |