Reviewers: ulan, jochen,

Message:
The other back-ends have the same problem, but I don't know the proper way to
fix them. I found an appropriate instruction for the access in x64, but I
couldn't find a MacroAssembler helper for using it with an ExternalReference. If
it's accepted, I'll raise an issue to get this change ported.


https://codereview.chromium.org/230553004/diff/1/src/arm64/full-codegen-arm64.cc
File src/arm64/full-codegen-arm64.cc (right):

https://codereview.chromium.org/230553004/diff/1/src/arm64/full-codegen-arm64.cc#newcode4853
src/arm64/full-codegen-arm64.cc:4853: STATIC_ASSERT(sizeof(bool) == 1);
 // NOLINT(runtime/sizeof)
This is defined in the ABI for both ARM and AArch64. It's also true for
the simulator host environments I tested (gcc 4.8.1 on Ubuntu 13.10). If
it causes trouble, we'll have to review how we handle accesses to fields
where the size is determined by the host environment. We might need
templated Ldr/Str variants to load host data types, for example.

Description:
ARM64: Access has_pending_message_ correctly.

This fixes accesses in ARM and ARM64; the field is a bool, with size 1,
but we were accessing it with pointer-sized loads and stores.

BUG=

Please review this at https://codereview.chromium.org/230553004/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+8, -4 lines):
  M src/arm/full-codegen-arm.cc
  M src/arm64/full-codegen-arm64.cc


Index: src/arm/full-codegen-arm.cc
diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc
index ba5053f95ab8e1618f70b104bb9aa884f1abb2a8..95f1050a09e64cb418b8719667274417848c0ef2 100644
--- a/src/arm/full-codegen-arm.cc
+++ b/src/arm/full-codegen-arm.cc
@@ -4766,7 +4766,8 @@ void FullCodeGenerator::EnterFinallyBlock() {
   ExternalReference has_pending_message =
       ExternalReference::address_of_has_pending_message(isolate());
   __ mov(ip, Operand(has_pending_message));
-  __ ldr(r1, MemOperand(ip));
+  STATIC_ASSERT(sizeof(bool) == 1);   // NOLINT(runtime/sizeof)
+  __ ldrb(r1, MemOperand(ip));
   __ SmiTag(r1);
   __ push(r1);

@@ -4792,7 +4793,8 @@ void FullCodeGenerator::ExitFinallyBlock() {
   ExternalReference has_pending_message =
       ExternalReference::address_of_has_pending_message(isolate());
   __ mov(ip, Operand(has_pending_message));
-  __ str(r1, MemOperand(ip));
+  STATIC_ASSERT(sizeof(bool) == 1);   // NOLINT(runtime/sizeof)
+  __ strb(r1, MemOperand(ip));

   __ pop(r1);
   ExternalReference pending_message_obj =
Index: src/arm64/full-codegen-arm64.cc
diff --git a/src/arm64/full-codegen-arm64.cc b/src/arm64/full-codegen-arm64.cc index 819868b5d855af8c15eb13f87a35e067d47625ec..fe7c6c74cfbfa46a4096ba2a5a7a5e2b8969438c 100644
--- a/src/arm64/full-codegen-arm64.cc
+++ b/src/arm64/full-codegen-arm64.cc
@@ -4820,8 +4820,9 @@ void FullCodeGenerator::EnterFinallyBlock() {

   ExternalReference has_pending_message =
       ExternalReference::address_of_has_pending_message(isolate());
+  STATIC_ASSERT(sizeof(bool) == 1);   // NOLINT(runtime/sizeof)
   __ Mov(x11, has_pending_message);
-  __ Ldr(x11, MemOperand(x11));
+  __ Ldrb(x11, MemOperand(x11));
   __ SmiTag(x11);

   __ Push(x10, x11);
@@ -4849,7 +4850,8 @@ void FullCodeGenerator::ExitFinallyBlock() {
   ExternalReference has_pending_message =
       ExternalReference::address_of_has_pending_message(isolate());
   __ Mov(x13, has_pending_message);
-  __ Str(x11, MemOperand(x13));
+  STATIC_ASSERT(sizeof(bool) == 1);   // NOLINT(runtime/sizeof)
+  __ Strb(x11, MemOperand(x13));

   ExternalReference pending_message_obj =
       ExternalReference::address_of_pending_message_obj(isolate());


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to