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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 break; | 60 break; |
61 case FLOAT32X4_TYPE: | 61 case FLOAT32X4_TYPE: |
62 Float32x4::cast(this)->Float32x4Verify(); | 62 Float32x4::cast(this)->Float32x4Verify(); |
63 break; | 63 break; |
64 case FIXED_ARRAY_TYPE: | 64 case FIXED_ARRAY_TYPE: |
65 FixedArray::cast(this)->FixedArrayVerify(); | 65 FixedArray::cast(this)->FixedArrayVerify(); |
66 break; | 66 break; |
67 case FIXED_DOUBLE_ARRAY_TYPE: | 67 case FIXED_DOUBLE_ARRAY_TYPE: |
68 FixedDoubleArray::cast(this)->FixedDoubleArrayVerify(); | 68 FixedDoubleArray::cast(this)->FixedDoubleArrayVerify(); |
69 break; | 69 break; |
70 case CONSTANT_POOL_ARRAY_TYPE: | |
71 ConstantPoolArray::cast(this)->ConstantPoolArrayVerify(); | |
72 break; | |
73 case BYTE_ARRAY_TYPE: | 70 case BYTE_ARRAY_TYPE: |
74 ByteArray::cast(this)->ByteArrayVerify(); | 71 ByteArray::cast(this)->ByteArrayVerify(); |
75 break; | 72 break; |
76 case FREE_SPACE_TYPE: | 73 case FREE_SPACE_TYPE: |
77 FreeSpace::cast(this)->FreeSpaceVerify(); | 74 FreeSpace::cast(this)->FreeSpaceVerify(); |
78 break; | 75 break; |
79 | 76 |
80 #define VERIFY_TYPED_ARRAY(Type, type, TYPE, ctype, size) \ | 77 #define VERIFY_TYPED_ARRAY(Type, type, TYPE, ctype, size) \ |
81 case EXTERNAL_##TYPE##_ARRAY_TYPE: \ | 78 case EXTERNAL_##TYPE##_ARRAY_TYPE: \ |
82 External##Type##Array::cast(this)->External##Type##ArrayVerify(); \ | 79 External##Type##Array::cast(this)->External##Type##ArrayVerify(); \ |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 V8_UINT64_C(0x7FF8000000000000); | 394 V8_UINT64_C(0x7FF8000000000000); |
398 // Create implementation specific sNaN by inverting relevant bit. | 395 // Create implementation specific sNaN by inverting relevant bit. |
399 unexpected ^= V8_UINT64_C(0x0008000000000000); | 396 unexpected ^= V8_UINT64_C(0x0008000000000000); |
400 CHECK((value & V8_UINT64_C(0x7FF8000000000000)) != unexpected || | 397 CHECK((value & V8_UINT64_C(0x7FF8000000000000)) != unexpected || |
401 (value & V8_UINT64_C(0x0007FFFFFFFFFFFF)) == V8_UINT64_C(0)); | 398 (value & V8_UINT64_C(0x0007FFFFFFFFFFFF)) == V8_UINT64_C(0)); |
402 } | 399 } |
403 } | 400 } |
404 } | 401 } |
405 | 402 |
406 | 403 |
407 void ConstantPoolArray::ConstantPoolArrayVerify() { | |
408 CHECK(IsConstantPoolArray()); | |
409 ConstantPoolArray::Iterator code_iter(this, ConstantPoolArray::CODE_PTR); | |
410 while (!code_iter.is_finished()) { | |
411 Address code_entry = get_code_ptr_entry(code_iter.next_index()); | |
412 VerifyPointer(Code::GetCodeFromTargetAddress(code_entry)); | |
413 } | |
414 ConstantPoolArray::Iterator heap_iter(this, ConstantPoolArray::HEAP_PTR); | |
415 while (!heap_iter.is_finished()) { | |
416 VerifyObjectField(OffsetOfElementAt(heap_iter.next_index())); | |
417 } | |
418 } | |
419 | |
420 | |
421 void JSGeneratorObject::JSGeneratorObjectVerify() { | 404 void JSGeneratorObject::JSGeneratorObjectVerify() { |
422 // In an expression like "new g()", there can be a point where a generator | 405 // In an expression like "new g()", there can be a point where a generator |
423 // object is allocated but its fields are all undefined, as it hasn't yet been | 406 // object is allocated but its fields are all undefined, as it hasn't yet been |
424 // initialized by the generator. Hence these weak checks. | 407 // initialized by the generator. Hence these weak checks. |
425 VerifyObjectField(kFunctionOffset); | 408 VerifyObjectField(kFunctionOffset); |
426 VerifyObjectField(kContextOffset); | 409 VerifyObjectField(kContextOffset); |
427 VerifyObjectField(kReceiverOffset); | 410 VerifyObjectField(kReceiverOffset); |
428 VerifyObjectField(kOperandStackOffset); | 411 VerifyObjectField(kOperandStackOffset); |
429 VerifyObjectField(kContinuationOffset); | 412 VerifyObjectField(kContinuationOffset); |
430 } | 413 } |
(...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1288 : it.rinfo()->target_object(); | 1271 : it.rinfo()->target_object(); |
1289 CHECK(!CanLeak(target, heap, skip_weak_cell)); | 1272 CHECK(!CanLeak(target, heap, skip_weak_cell)); |
1290 } | 1273 } |
1291 } | 1274 } |
1292 | 1275 |
1293 | 1276 |
1294 #endif // DEBUG | 1277 #endif // DEBUG |
1295 | 1278 |
1296 } // namespace internal | 1279 } // namespace internal |
1297 } // namespace v8 | 1280 } // namespace v8 |
OLD | NEW |