Skip to content

Commit

Permalink
deps: cherry-pick 2b4c9c1 from v8 upstream
Browse files Browse the repository at this point in the history
Original commit message:

S390:Update inline asm constraint in test-platform
The GetStackPointer() routine in test-platform uses an inline
assembly code to store the current stack pointer value into a static
variable sp_addr.  The existing asm code for S390 uses an ST/STG
instruction, with the memory operand associated with the general ('=g')
constraint to sp_addr.

On GCC 4.8.5, the GCC compiler got confused and treated sp_addr as
an integer operand instead of memory operand, resulting in a store
being emitted that writes to an invalid meory location.

Given the specific store instructions being inlined here, we should
restict the sp_addr operand to explicitly be a memory operand using '=m'
instead of '=g'.

R=bmeurer@chromium.org,jkummerow@chormium.org,rmcilroy@chromium.org,yangguo@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2158523002
Cr-Commit-Position: refs/heads/master@{#37809}

Fixes: #7659
PR-URL: #7771
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
  • Loading branch information
joransiu authored and ofrobots committed Aug 25, 2016
1 parent 0ac21bc commit c4401d2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion deps/v8/include/v8-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#define V8_MAJOR_VERSION 5
#define V8_MINOR_VERSION 1
#define V8_BUILD_NUMBER 281
#define V8_PATCH_LEVEL 76
#define V8_PATCH_LEVEL 77

// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
Expand Down
4 changes: 2 additions & 2 deletions deps/v8/test/cctest/test-platform.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ void GetStackPointer(const v8::FunctionCallbackInfo<v8::Value>& args) {
#elif V8_HOST_ARCH_MIPS64
__asm__ __volatile__("sd $sp, %0" : "=g"(sp_addr));
#elif defined(__s390x__) || defined(_ARCH_S390X)
__asm__ __volatile__("stg 15, %0" : "=g"(sp_addr));
__asm__ __volatile__("stg 15, %0" : "=m"(sp_addr));
#elif defined(__s390__) || defined(_ARCH_S390)
__asm__ __volatile__("st 15, %0" : "=g"(sp_addr));
__asm__ __volatile__("st 15, %0" : "=m"(sp_addr));
#elif defined(__PPC64__) || defined(_ARCH_PPC64)
__asm__ __volatile__("std 1, %0" : "=g"(sp_addr));
#elif defined(__PPC__) || defined(_ARCH_PPC)
Expand Down

0 comments on commit c4401d2

Please sign in to comment.