From 59e7be2c033b605b8a4776edf82c803705da14f0 Mon Sep 17 00:00:00 2001 From: "lrn@chromium.org" Date: Tue, 27 Oct 2009 08:50:24 +0000 Subject: [PATCH] Windows: Change test to not assume ebp is frame-pointer. Review URL: http://codereview.chromium.org/329007 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3138 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/x64/codegen-x64.cc | 4 +++- test/cctest/test-log-stack-tracer.cc | 17 ++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/x64/codegen-x64.cc b/src/x64/codegen-x64.cc index 7cad6de2e..80ebd7734 100644 --- a/src/x64/codegen-x64.cc +++ b/src/x64/codegen-x64.cc @@ -6842,7 +6842,9 @@ void CEntryStub::GenerateCore(MacroAssembler* masm, // If return value is on the stack, pop it to registers. if (result_size_ > 1) { ASSERT_EQ(2, result_size_); - // Position above 4 argument mirrors and arguments object. + // Read result values stored on stack. Result is stored + // above the four argument mirror slots and the two + // Arguments object slots. __ movq(rax, Operand(rsp, 6 * kPointerSize)); __ movq(rdx, Operand(rsp, 7 * kPointerSize)); } diff --git a/test/cctest/test-log-stack-tracer.cc b/test/cctest/test-log-stack-tracer.cc index 43df6ba7a..9905db82d 100644 --- a/test/cctest/test-log-stack-tracer.cc +++ b/test/cctest/test-log-stack-tracer.cc @@ -329,17 +329,16 @@ TEST(PureJSStackTrace) { } -static void CFuncDoTrace() { +static void CFuncDoTrace(byte dummy_parameter) { Address fp; #ifdef __GNUC__ fp = reinterpret_cast
(__builtin_frame_address(0)); -#elif defined _MSC_VER && defined V8_TARGET_ARCH_IA32 - __asm mov [fp], ebp // NOLINT -#elif defined _MSC_VER && defined V8_TARGET_ARCH_X64 - // TODO(X64): __asm extension is not supported by the Microsoft Visual C++ - // 64-bit compiler. - fp = 0; - UNIMPLEMENTED(); +#elif defined _MSC_VER + // Approximate a frame pointer address. We compile without base pointers, + // so we can't trust ebp/rbp. + fp = &dummy_parameter - 2 * kPointerSize; +#else +#error Unexpected platform. #endif DoTrace(fp); } @@ -347,7 +346,7 @@ static void CFuncDoTrace() { static int CFunc(int depth) { if (depth <= 0) { - CFuncDoTrace(); + CFuncDoTrace(0); return 0; } else { return CFunc(depth - 1) + 1; -- 2.34.1