Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(98)

Side by Side Diff: src/objects-debug.cc

Issue 1131783003: Embedded constant pools. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 case HEAP_NUMBER_TYPE: 61 case HEAP_NUMBER_TYPE:
62 case MUTABLE_HEAP_NUMBER_TYPE: 62 case MUTABLE_HEAP_NUMBER_TYPE:
63 HeapNumber::cast(this)->HeapNumberVerify(); 63 HeapNumber::cast(this)->HeapNumberVerify();
64 break; 64 break;
65 case FIXED_ARRAY_TYPE: 65 case FIXED_ARRAY_TYPE:
66 FixedArray::cast(this)->FixedArrayVerify(); 66 FixedArray::cast(this)->FixedArrayVerify();
67 break; 67 break;
68 case FIXED_DOUBLE_ARRAY_TYPE: 68 case FIXED_DOUBLE_ARRAY_TYPE:
69 FixedDoubleArray::cast(this)->FixedDoubleArrayVerify(); 69 FixedDoubleArray::cast(this)->FixedDoubleArrayVerify();
70 break; 70 break;
71 case CONSTANT_POOL_ARRAY_TYPE:
72 ConstantPoolArray::cast(this)->ConstantPoolArrayVerify();
73 break;
74 case BYTE_ARRAY_TYPE: 71 case BYTE_ARRAY_TYPE:
75 ByteArray::cast(this)->ByteArrayVerify(); 72 ByteArray::cast(this)->ByteArrayVerify();
76 break; 73 break;
77 case FREE_SPACE_TYPE: 74 case FREE_SPACE_TYPE:
78 FreeSpace::cast(this)->FreeSpaceVerify(); 75 FreeSpace::cast(this)->FreeSpaceVerify();
79 break; 76 break;
80 77
81 #define VERIFY_TYPED_ARRAY(Type, type, TYPE, ctype, size) \ 78 #define VERIFY_TYPED_ARRAY(Type, type, TYPE, ctype, size) \
82 case EXTERNAL_##TYPE##_ARRAY_TYPE: \ 79 case EXTERNAL_##TYPE##_ARRAY_TYPE: \
83 External##Type##Array::cast(this)->External##Type##ArrayVerify(); \ 80 External##Type##Array::cast(this)->External##Type##ArrayVerify(); \
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 V8_UINT64_C(0x7FF8000000000000); 392 V8_UINT64_C(0x7FF8000000000000);
396 // Create implementation specific sNaN by inverting relevant bit. 393 // Create implementation specific sNaN by inverting relevant bit.
397 unexpected ^= V8_UINT64_C(0x0008000000000000); 394 unexpected ^= V8_UINT64_C(0x0008000000000000);
398 CHECK((value & V8_UINT64_C(0x7FF8000000000000)) != unexpected || 395 CHECK((value & V8_UINT64_C(0x7FF8000000000000)) != unexpected ||
399 (value & V8_UINT64_C(0x0007FFFFFFFFFFFF)) == V8_UINT64_C(0)); 396 (value & V8_UINT64_C(0x0007FFFFFFFFFFFF)) == V8_UINT64_C(0));
400 } 397 }
401 } 398 }
402 } 399 }
403 400
404 401
405 void ConstantPoolArray::ConstantPoolArrayVerify() {
406 CHECK(IsConstantPoolArray());
407 ConstantPoolArray::Iterator code_iter(this, ConstantPoolArray::CODE_PTR);
408 while (!code_iter.is_finished()) {
409 Address code_entry = get_code_ptr_entry(code_iter.next_index());
410 VerifyPointer(Code::GetCodeFromTargetAddress(code_entry));
411 }
412 ConstantPoolArray::Iterator heap_iter(this, ConstantPoolArray::HEAP_PTR);
413 while (!heap_iter.is_finished()) {
414 VerifyObjectField(OffsetOfElementAt(heap_iter.next_index()));
415 }
416 }
417
418
419 void JSGeneratorObject::JSGeneratorObjectVerify() { 402 void JSGeneratorObject::JSGeneratorObjectVerify() {
420 // In an expression like "new g()", there can be a point where a generator 403 // In an expression like "new g()", there can be a point where a generator
421 // object is allocated but its fields are all undefined, as it hasn't yet been 404 // object is allocated but its fields are all undefined, as it hasn't yet been
422 // initialized by the generator. Hence these weak checks. 405 // initialized by the generator. Hence these weak checks.
423 VerifyObjectField(kFunctionOffset); 406 VerifyObjectField(kFunctionOffset);
424 VerifyObjectField(kContextOffset); 407 VerifyObjectField(kContextOffset);
425 VerifyObjectField(kReceiverOffset); 408 VerifyObjectField(kReceiverOffset);
426 VerifyObjectField(kOperandStackOffset); 409 VerifyObjectField(kOperandStackOffset);
427 VerifyObjectField(kContinuationOffset); 410 VerifyObjectField(kContinuationOffset);
428 } 411 }
(...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after
1282 ? it.rinfo()->target_cell() 1265 ? it.rinfo()->target_cell()
1283 : it.rinfo()->target_object(); 1266 : it.rinfo()->target_object();
1284 CHECK(!CanLeak(target, heap, skip_weak_cell)); 1267 CHECK(!CanLeak(target, heap, skip_weak_cell));
1285 } 1268 }
1286 } 1269 }
1287 1270
1288 1271
1289 #endif // DEBUG 1272 #endif // DEBUG
1290 1273
1291 } } // namespace v8::internal 1274 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698