Changeset 13014
- Timestamp:
- Oct 13, 2009, 9:08:44 PM (15 years ago)
- File:
-
- 1 edited
-
trunk/source/level-1/x86-trap-support.lisp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/level-1/x86-trap-support.lisp
r13004 r13014 445 445 :instruction insn) 446 446 nil frame-ptr) 447 #-windows-target 448 (emulate () 449 :test (lambda (c) 450 (declare (ignore c)) 451 (x86-can-emulate-instruction insn)) 452 :report 453 "Emulate this instruction, leaving the object watched." 454 (flet ((watchedp (object) 455 (%map-areas #'(lambda (x) 456 (when (eq object x) 457 (return-from watchedp t))) 458 area-watched area-watched))) 459 (let ((result nil)) 460 (with-other-threads-suspended 461 (when (watchedp object) 462 ;; We now trust that the object is in a 463 ;; static gc area. 464 (let* ((a (+ (%address-of object) offset)) 465 (ptr (%int-to-ptr 466 (logandc2 a (1- *host-page-size*))))) 467 (#_mprotect ptr *host-page-size* #$PROT_WRITE) 468 (setq result (x86-emulate-instruction xp insn)) 469 (#_mprotect ptr *host-page-size* 470 (logior #$PROT_READ #$PROT_EXEC))))) 471 (if result 472 (setq skip insn-length) 473 (error "could not emulate the instrution"))))) 447 474 (skip () 448 475 :test (lambda (c)
Note:
See TracChangeset
for help on using the changeset viewer.
