OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 } | 359 } |
360 | 360 |
361 | 361 |
362 void RelocInfo::Visit(ObjectVisitor* visitor) { | 362 void RelocInfo::Visit(ObjectVisitor* visitor) { |
363 RelocInfo::Mode mode = rmode(); | 363 RelocInfo::Mode mode = rmode(); |
364 if (mode == RelocInfo::EMBEDDED_OBJECT) { | 364 if (mode == RelocInfo::EMBEDDED_OBJECT) { |
365 visitor->VisitPointer(target_object_address()); | 365 visitor->VisitPointer(target_object_address()); |
366 CPU::FlushICache(pc_, sizeof(Address)); | 366 CPU::FlushICache(pc_, sizeof(Address)); |
367 } else if (RelocInfo::IsCodeTarget(mode)) { | 367 } else if (RelocInfo::IsCodeTarget(mode)) { |
368 visitor->VisitCodeTarget(this); | 368 visitor->VisitCodeTarget(this); |
| 369 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) { |
| 370 visitor->VisitGlobalPropertyCell(this); |
369 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { | 371 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { |
370 visitor->VisitExternalReference(target_reference_address()); | 372 visitor->VisitExternalReference(target_reference_address()); |
371 CPU::FlushICache(pc_, sizeof(Address)); | 373 CPU::FlushICache(pc_, sizeof(Address)); |
372 #ifdef ENABLE_DEBUGGER_SUPPORT | 374 #ifdef ENABLE_DEBUGGER_SUPPORT |
373 } else if (Debug::has_break_points() && | 375 } else if (Debug::has_break_points() && |
374 ((RelocInfo::IsJSReturn(mode) && | 376 ((RelocInfo::IsJSReturn(mode) && |
375 IsPatchedReturnSequence()) || | 377 IsPatchedReturnSequence()) || |
376 (RelocInfo::IsDebugBreakSlot(mode) && | 378 (RelocInfo::IsDebugBreakSlot(mode) && |
377 IsPatchedDebugBreakSlotSequence()))) { | 379 IsPatchedDebugBreakSlotSequence()))) { |
378 visitor->VisitDebugTarget(this); | 380 visitor->VisitDebugTarget(this); |
379 #endif | 381 #endif |
380 } else if (mode == RelocInfo::RUNTIME_ENTRY) { | 382 } else if (mode == RelocInfo::RUNTIME_ENTRY) { |
381 visitor->VisitRuntimeEntry(this); | 383 visitor->VisitRuntimeEntry(this); |
382 } | 384 } |
383 } | 385 } |
384 | 386 |
385 | 387 |
386 template<typename StaticVisitor> | 388 template<typename StaticVisitor> |
387 void RelocInfo::Visit() { | 389 void RelocInfo::Visit() { |
388 RelocInfo::Mode mode = rmode(); | 390 RelocInfo::Mode mode = rmode(); |
389 if (mode == RelocInfo::EMBEDDED_OBJECT) { | 391 if (mode == RelocInfo::EMBEDDED_OBJECT) { |
390 StaticVisitor::VisitPointer(target_object_address()); | 392 StaticVisitor::VisitPointer(target_object_address()); |
391 CPU::FlushICache(pc_, sizeof(Address)); | 393 CPU::FlushICache(pc_, sizeof(Address)); |
392 } else if (RelocInfo::IsCodeTarget(mode)) { | 394 } else if (RelocInfo::IsCodeTarget(mode)) { |
393 StaticVisitor::VisitCodeTarget(this); | 395 StaticVisitor::VisitCodeTarget(this); |
| 396 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) { |
| 397 StaticVisitor::VisitGlobalPropertyCell(this); |
394 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { | 398 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { |
395 StaticVisitor::VisitExternalReference(target_reference_address()); | 399 StaticVisitor::VisitExternalReference(target_reference_address()); |
396 CPU::FlushICache(pc_, sizeof(Address)); | 400 CPU::FlushICache(pc_, sizeof(Address)); |
397 #ifdef ENABLE_DEBUGGER_SUPPORT | 401 #ifdef ENABLE_DEBUGGER_SUPPORT |
398 } else if (Debug::has_break_points() && | 402 } else if (Debug::has_break_points() && |
399 ((RelocInfo::IsJSReturn(mode) && | 403 ((RelocInfo::IsJSReturn(mode) && |
400 IsPatchedReturnSequence()) || | 404 IsPatchedReturnSequence()) || |
401 (RelocInfo::IsDebugBreakSlot(mode) && | 405 (RelocInfo::IsDebugBreakSlot(mode) && |
402 IsPatchedDebugBreakSlotSequence()))) { | 406 IsPatchedDebugBreakSlotSequence()))) { |
403 StaticVisitor::VisitDebugTarget(this); | 407 StaticVisitor::VisitDebugTarget(this); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 ASSERT(len_ == 1 || len_ == 2); | 446 ASSERT(len_ == 1 || len_ == 2); |
443 int32_t* p = reinterpret_cast<int32_t*>(&buf_[len_]); | 447 int32_t* p = reinterpret_cast<int32_t*>(&buf_[len_]); |
444 *p = disp; | 448 *p = disp; |
445 len_ += sizeof(int32_t); | 449 len_ += sizeof(int32_t); |
446 } | 450 } |
447 | 451 |
448 | 452 |
449 } } // namespace v8::internal | 453 } } // namespace v8::internal |
450 | 454 |
451 #endif // V8_X64_ASSEMBLER_X64_INL_H_ | 455 #endif // V8_X64_ASSEMBLER_X64_INL_H_ |
OLD | NEW |