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; |
67 case BYTE_ARRAY_TYPE: | 70 case BYTE_ARRAY_TYPE: |
68 ByteArray::cast(this)->ByteArrayVerify(); | 71 ByteArray::cast(this)->ByteArrayVerify(); |
69 break; | 72 break; |
70 case FREE_SPACE_TYPE: | 73 case FREE_SPACE_TYPE: |
71 FreeSpace::cast(this)->FreeSpaceVerify(); | 74 FreeSpace::cast(this)->FreeSpaceVerify(); |
72 break; | 75 break; |
73 | 76 |
74 #define VERIFY_TYPED_ARRAY(Type, type, TYPE, ctype, size) \ | 77 #define VERIFY_TYPED_ARRAY(Type, type, TYPE, ctype, size) \ |
75 case EXTERNAL_##TYPE##_ARRAY_TYPE: \ | 78 case EXTERNAL_##TYPE##_ARRAY_TYPE: \ |
76 External##Type##Array::cast(this)->External##Type##ArrayVerify(); \ | 79 External##Type##Array::cast(this)->External##Type##ArrayVerify(); \ |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 V8_UINT64_C(0x7FF8000000000000); | 391 V8_UINT64_C(0x7FF8000000000000); |
389 // Create implementation specific sNaN by inverting relevant bit. | 392 // Create implementation specific sNaN by inverting relevant bit. |
390 unexpected ^= V8_UINT64_C(0x0008000000000000); | 393 unexpected ^= V8_UINT64_C(0x0008000000000000); |
391 CHECK((value & V8_UINT64_C(0x7FF8000000000000)) != unexpected || | 394 CHECK((value & V8_UINT64_C(0x7FF8000000000000)) != unexpected || |
392 (value & V8_UINT64_C(0x0007FFFFFFFFFFFF)) == V8_UINT64_C(0)); | 395 (value & V8_UINT64_C(0x0007FFFFFFFFFFFF)) == V8_UINT64_C(0)); |
393 } | 396 } |
394 } | 397 } |
395 } | 398 } |
396 | 399 |
397 | 400 |
| 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 |
398 void JSGeneratorObject::JSGeneratorObjectVerify() { | 415 void JSGeneratorObject::JSGeneratorObjectVerify() { |
399 // In an expression like "new g()", there can be a point where a generator | 416 // In an expression like "new g()", there can be a point where a generator |
400 // object is allocated but its fields are all undefined, as it hasn't yet been | 417 // object is allocated but its fields are all undefined, as it hasn't yet been |
401 // initialized by the generator. Hence these weak checks. | 418 // initialized by the generator. Hence these weak checks. |
402 VerifyObjectField(kFunctionOffset); | 419 VerifyObjectField(kFunctionOffset); |
403 VerifyObjectField(kContextOffset); | 420 VerifyObjectField(kContextOffset); |
404 VerifyObjectField(kReceiverOffset); | 421 VerifyObjectField(kReceiverOffset); |
405 VerifyObjectField(kOperandStackOffset); | 422 VerifyObjectField(kOperandStackOffset); |
406 VerifyObjectField(kContinuationOffset); | 423 VerifyObjectField(kContinuationOffset); |
407 } | 424 } |
(...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1265 : it.rinfo()->target_object(); | 1282 : it.rinfo()->target_object(); |
1266 CHECK(!CanLeak(target, heap, skip_weak_cell)); | 1283 CHECK(!CanLeak(target, heap, skip_weak_cell)); |
1267 } | 1284 } |
1268 } | 1285 } |
1269 | 1286 |
1270 | 1287 |
1271 #endif // DEBUG | 1288 #endif // DEBUG |
1272 | 1289 |
1273 } // namespace internal | 1290 } // namespace internal |
1274 } // namespace v8 | 1291 } // namespace v8 |
OLD | NEW |