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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/disasm.h" | 7 #include "src/disasm.h" |
8 #include "src/disassembler.h" | 8 #include "src/disassembler.h" |
9 #include "src/heap/objects-visiting.h" | 9 #include "src/heap/objects-visiting.h" |
10 #include "src/jsregexp.h" | 10 #include "src/jsregexp.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 case HEAP_NUMBER_TYPE: | 57 case HEAP_NUMBER_TYPE: |
58 case MUTABLE_HEAP_NUMBER_TYPE: | 58 case MUTABLE_HEAP_NUMBER_TYPE: |
59 HeapNumber::cast(this)->HeapNumberVerify(); | 59 HeapNumber::cast(this)->HeapNumberVerify(); |
60 break; | 60 break; |
61 case FIXED_ARRAY_TYPE: | 61 case FIXED_ARRAY_TYPE: |
62 FixedArray::cast(this)->FixedArrayVerify(); | 62 FixedArray::cast(this)->FixedArrayVerify(); |
63 break; | 63 break; |
64 case FIXED_DOUBLE_ARRAY_TYPE: | 64 case FIXED_DOUBLE_ARRAY_TYPE: |
65 FixedDoubleArray::cast(this)->FixedDoubleArrayVerify(); | 65 FixedDoubleArray::cast(this)->FixedDoubleArrayVerify(); |
66 break; | 66 break; |
67 case CONSTANT_POOL_ARRAY_TYPE: | |
68 ConstantPoolArray::cast(this)->ConstantPoolArrayVerify(); | |
69 break; | |
70 case BYTE_ARRAY_TYPE: | 67 case BYTE_ARRAY_TYPE: |
71 ByteArray::cast(this)->ByteArrayVerify(); | 68 ByteArray::cast(this)->ByteArrayVerify(); |
72 break; | 69 break; |
73 case FREE_SPACE_TYPE: | 70 case FREE_SPACE_TYPE: |
74 FreeSpace::cast(this)->FreeSpaceVerify(); | 71 FreeSpace::cast(this)->FreeSpaceVerify(); |
75 break; | 72 break; |
76 | 73 |
77 #define VERIFY_TYPED_ARRAY(Type, type, TYPE, ctype, size) \ | 74 #define VERIFY_TYPED_ARRAY(Type, type, TYPE, ctype, size) \ |
78 case EXTERNAL_##TYPE##_ARRAY_TYPE: \ | 75 case EXTERNAL_##TYPE##_ARRAY_TYPE: \ |
79 External##Type##Array::cast(this)->External##Type##ArrayVerify(); \ | 76 External##Type##Array::cast(this)->External##Type##ArrayVerify(); \ |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 V8_UINT64_C(0x7FF8000000000000); | 388 V8_UINT64_C(0x7FF8000000000000); |
392 // Create implementation specific sNaN by inverting relevant bit. | 389 // Create implementation specific sNaN by inverting relevant bit. |
393 unexpected ^= V8_UINT64_C(0x0008000000000000); | 390 unexpected ^= V8_UINT64_C(0x0008000000000000); |
394 CHECK((value & V8_UINT64_C(0x7FF8000000000000)) != unexpected || | 391 CHECK((value & V8_UINT64_C(0x7FF8000000000000)) != unexpected || |
395 (value & V8_UINT64_C(0x0007FFFFFFFFFFFF)) == V8_UINT64_C(0)); | 392 (value & V8_UINT64_C(0x0007FFFFFFFFFFFF)) == V8_UINT64_C(0)); |
396 } | 393 } |
397 } | 394 } |
398 } | 395 } |
399 | 396 |
400 | 397 |
401 void ConstantPoolArray::ConstantPoolArrayVerify() { | |
402 CHECK(IsConstantPoolArray()); | |
403 ConstantPoolArray::Iterator code_iter(this, ConstantPoolArray::CODE_PTR); | |
404 while (!code_iter.is_finished()) { | |
405 Address code_entry = get_code_ptr_entry(code_iter.next_index()); | |
406 VerifyPointer(Code::GetCodeFromTargetAddress(code_entry)); | |
407 } | |
408 ConstantPoolArray::Iterator heap_iter(this, ConstantPoolArray::HEAP_PTR); | |
409 while (!heap_iter.is_finished()) { | |
410 VerifyObjectField(OffsetOfElementAt(heap_iter.next_index())); | |
411 } | |
412 } | |
413 | |
414 | |
415 void JSGeneratorObject::JSGeneratorObjectVerify() { | 398 void JSGeneratorObject::JSGeneratorObjectVerify() { |
416 // In an expression like "new g()", there can be a point where a generator | 399 // In an expression like "new g()", there can be a point where a generator |
417 // object is allocated but its fields are all undefined, as it hasn't yet been | 400 // object is allocated but its fields are all undefined, as it hasn't yet been |
418 // initialized by the generator. Hence these weak checks. | 401 // initialized by the generator. Hence these weak checks. |
419 VerifyObjectField(kFunctionOffset); | 402 VerifyObjectField(kFunctionOffset); |
420 VerifyObjectField(kContextOffset); | 403 VerifyObjectField(kContextOffset); |
421 VerifyObjectField(kReceiverOffset); | 404 VerifyObjectField(kReceiverOffset); |
422 VerifyObjectField(kOperandStackOffset); | 405 VerifyObjectField(kOperandStackOffset); |
423 VerifyObjectField(kContinuationOffset); | 406 VerifyObjectField(kContinuationOffset); |
424 } | 407 } |
(...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1282 : it.rinfo()->target_object(); | 1265 : it.rinfo()->target_object(); |
1283 CHECK(!CanLeak(target, heap, skip_weak_cell)); | 1266 CHECK(!CanLeak(target, heap, skip_weak_cell)); |
1284 } | 1267 } |
1285 } | 1268 } |
1286 | 1269 |
1287 | 1270 |
1288 #endif // DEBUG | 1271 #endif // DEBUG |
1289 | 1272 |
1290 } // namespace internal | 1273 } // namespace internal |
1291 } // namespace v8 | 1274 } // namespace v8 |
OLD | NEW |