Commit fc57d4e8 authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

cppgc: Remove Win stack scanning support

Even though the default toolchain for assembly on Windows uses MASM
assemblers, we are not supposed to use them to support Linux/Win
cross-compile.

Bug: chromium:1056170, chromium:1066834
Change-Id: If17dbd68915f843e3fb47584560a4667d5c35bc7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2132250Reviewed-by: 's avatarAnton Bikineev <bikineev@chromium.org>
Reviewed-by: 's avatarOmer Katz <omerkatz@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66951}
parent 4b56b1f8
......@@ -3955,9 +3955,7 @@ v8_source_set("cppgc_base") {
]
if (target_cpu == "x64") {
if (is_win) {
sources += [ "src/heap/cppgc/asm/x64/push_registers_win.S" ]
} else {
if (!is_win) {
sources += [ "src/heap/cppgc/asm/x64/push_registers.S" ]
}
}
......
;; Copyright 2020 the V8 project authors. All rights reserved.
;; Use of this source code is governed by a BSD-style license that can be
;; found in the LICENSE file.
;; MASM syntax
;; https://docs.microsoft.com/en-us/cpp/assembler/masm/microsoft-macro-assembler-reference?view=vs-2019
public PushAllRegistersAndIterateStack
.code
PushAllRegistersAndIterateStack:
;; Push all callee-saved registers to get them on the stack for conservative
;; stack scanning.
;;
;; We maintain 16-byte alignment at calls. There is an 8-byte return address
;; on the stack and we push 72 bytes which maintains 16-byte stack alignment
;; at the call.
;; Source: https://docs.microsoft.com/en-us/cpp/build/x64-calling-convention
;;
;; rbp is callee-saved. Maintain proper frame pointer for debugging.
push rbp
mov rbp, rsp
push 0CDCDCDh ;; Dummy for alignment.
push rsi
push rdi
push rbx
push r12
push r13
push r14
push r15
;; Pass 1st parameter (rcx) unchanged (Stack*).
;; Pass 2nd parameter (rdx) unchanged (StackVisitor*).
;; Save 3rd parameter (r8; IterateStackCallback)
mov r9, r8
;; Pass 3rd parameter as rsp (stack pointer).
mov r8, rsp
;; Call the callback.
call r9
;; Pop the callee-saved registers.
add rsp, 64
;; Restore rbp as it was used as frame pointer.
pop rbp
ret
end
......@@ -12,9 +12,11 @@
// requires fixing e.g. simulator platforms.
#ifdef __clang__
#if defined(V8_TARGET_ARCH_X64)
#if !defined(V8_TARGET_OS_WIN)
#define CPPGC_SUPPORTS_CONSERVATIVE_STACK_SCAN 1
#endif
#endif
#endif
namespace cppgc {
namespace internal {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment