| OLD | NEW |
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 | 355 |
| 356 | 356 |
| 357 template<typename StaticVisitor> | 357 template<typename StaticVisitor> |
| 358 VisitorDispatchTable<typename StaticNewSpaceVisitor<StaticVisitor>::Callback> | 358 VisitorDispatchTable<typename StaticNewSpaceVisitor<StaticVisitor>::Callback> |
| 359 StaticNewSpaceVisitor<StaticVisitor>::table_; | 359 StaticNewSpaceVisitor<StaticVisitor>::table_; |
| 360 | 360 |
| 361 | 361 |
| 362 void Code::CodeIterateBody(ObjectVisitor* v) { | 362 void Code::CodeIterateBody(ObjectVisitor* v) { |
| 363 int mode_mask = RelocInfo::kCodeTargetMask | | 363 int mode_mask = RelocInfo::kCodeTargetMask | |
| 364 RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) | | 364 RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) | |
| 365 RelocInfo::ModeMask(RelocInfo::GLOBAL_PROPERTY_CELL) | |
| 365 RelocInfo::ModeMask(RelocInfo::EXTERNAL_REFERENCE) | | 366 RelocInfo::ModeMask(RelocInfo::EXTERNAL_REFERENCE) | |
| 366 RelocInfo::ModeMask(RelocInfo::JS_RETURN) | | 367 RelocInfo::ModeMask(RelocInfo::JS_RETURN) | |
| 367 RelocInfo::ModeMask(RelocInfo::DEBUG_BREAK_SLOT) | | 368 RelocInfo::ModeMask(RelocInfo::DEBUG_BREAK_SLOT) | |
| 368 RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY); | 369 RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY); |
| 369 | 370 |
| 370 // Use the relocation info pointer before it is visited by | 371 // Use the relocation info pointer before it is visited by |
| 371 // the heap compaction in the next statement. | 372 // the heap compaction in the next statement. |
| 372 RelocIterator it(this, mode_mask); | 373 RelocIterator it(this, mode_mask); |
| 373 | 374 |
| 374 IteratePointers(v, | 375 IteratePointer(v, kRelocationInfoOffset); |
| 375 kRelocationInfoOffset, | 376 IteratePointer(v, kDeoptimizationDataOffset); |
| 376 kRelocationInfoOffset + kPointerSize); | |
| 377 | 377 |
| 378 for (; !it.done(); it.next()) { | 378 for (; !it.done(); it.next()) { |
| 379 it.rinfo()->Visit(v); | 379 it.rinfo()->Visit(v); |
| 380 } | 380 } |
| 381 } | 381 } |
| 382 | 382 |
| 383 | 383 |
| 384 template<typename StaticVisitor> | 384 template<typename StaticVisitor> |
| 385 void Code::CodeIterateBody(Heap* heap) { | 385 void Code::CodeIterateBody(Heap* heap) { |
| 386 int mode_mask = RelocInfo::kCodeTargetMask | | 386 int mode_mask = RelocInfo::kCodeTargetMask | |
| 387 RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) | | 387 RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) | |
| 388 RelocInfo::ModeMask(RelocInfo::GLOBAL_PROPERTY_CELL) | |
| 388 RelocInfo::ModeMask(RelocInfo::EXTERNAL_REFERENCE) | | 389 RelocInfo::ModeMask(RelocInfo::EXTERNAL_REFERENCE) | |
| 389 RelocInfo::ModeMask(RelocInfo::JS_RETURN) | | 390 RelocInfo::ModeMask(RelocInfo::JS_RETURN) | |
| 390 RelocInfo::ModeMask(RelocInfo::DEBUG_BREAK_SLOT) | | 391 RelocInfo::ModeMask(RelocInfo::DEBUG_BREAK_SLOT) | |
| 391 RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY); | 392 RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY); |
| 392 | 393 |
| 393 // Use the relocation info pointer before it is visited by | 394 // Use the relocation info pointer before it is visited by |
| 394 // the heap compaction in the next statement. | 395 // the heap compaction in the next statement. |
| 395 RelocIterator it(this, mode_mask); | 396 RelocIterator it(this, mode_mask); |
| 396 | 397 |
| 397 StaticVisitor::VisitPointer( | 398 StaticVisitor::VisitPointer( |
| 398 heap, | 399 heap, |
| 399 reinterpret_cast<Object**>(this->address() + kRelocationInfoOffset)); | 400 reinterpret_cast<Object**>(this->address() + kRelocationInfoOffset)); |
| 401 StaticVisitor::VisitPointer( |
| 402 heap, |
| 403 reinterpret_cast<Object**>(this->address() + kDeoptimizationDataOffset)); |
| 400 | 404 |
| 401 for (; !it.done(); it.next()) { | 405 for (; !it.done(); it.next()) { |
| 402 it.rinfo()->template Visit<StaticVisitor>(heap); | 406 it.rinfo()->template Visit<StaticVisitor>(heap); |
| 403 } | 407 } |
| 404 } | 408 } |
| 405 | 409 |
| 406 | 410 |
| 407 } } // namespace v8::internal | 411 } } // namespace v8::internal |
| 408 | 412 |
| 409 #endif // V8_OBJECTS_VISITING_H_ | 413 #endif // V8_OBJECTS_VISITING_H_ |
| OLD | NEW |