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 } | |
Michael Lippautz
2015/11/27 14:27:28
Maybe verify that next either points to undefined
ulan
2015/11/27 14:43:45
Done.
| |
418 CHECK_LE(LengthFor(number_of_transitions()), length()); | |
419 } | |
420 | |
421 | |
410 void JSGeneratorObject::JSGeneratorObjectVerify() { | 422 void JSGeneratorObject::JSGeneratorObjectVerify() { |
411 // In an expression like "new g()", there can be a point where a generator | 423 // 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 | 424 // object is allocated but its fields are all undefined, as it hasn't yet been |
413 // initialized by the generator. Hence these weak checks. | 425 // initialized by the generator. Hence these weak checks. |
414 VerifyObjectField(kFunctionOffset); | 426 VerifyObjectField(kFunctionOffset); |
415 VerifyObjectField(kContextOffset); | 427 VerifyObjectField(kContextOffset); |
416 VerifyObjectField(kReceiverOffset); | 428 VerifyObjectField(kReceiverOffset); |
417 VerifyObjectField(kOperandStackOffset); | 429 VerifyObjectField(kOperandStackOffset); |
418 VerifyObjectField(kContinuationOffset); | 430 VerifyObjectField(kContinuationOffset); |
419 } | 431 } |
(...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1309 | 1321 |
1310 // Both are done at the same time. | 1322 // Both are done at the same time. |
1311 CHECK_EQ(new_it.done(), old_it.done()); | 1323 CHECK_EQ(new_it.done(), old_it.done()); |
1312 } | 1324 } |
1313 | 1325 |
1314 | 1326 |
1315 #endif // DEBUG | 1327 #endif // DEBUG |
1316 | 1328 |
1317 } // namespace internal | 1329 } // namespace internal |
1318 } // namespace v8 | 1330 } // namespace v8 |
OLD | NEW |