http://codereview.chromium.org/6170001/diff/1/src/arm/macro-assembler-arm.cc
File src/arm/macro-assembler-arm.cc (right):

http://codereview.chromium.org/6170001/diff/1/src/arm/macro-assembler-arm.cc#newcode1415
src/arm/macro-assembler-arm.cc:1415: add(ip, sp, Operand(scratch, LSL,
kPointerSizeLog2));
add(ip, sp, Operand(unwind_space * kPointerSize)); ?

http://codereview.chromium.org/6170001/diff/1/src/arm/macro-assembler-arm.cc#newcode1432
src/arm/macro-assembler-arm.cc:1432: push(scratch, nz);
ASSERT(frame_alignment == 2 * kPointerSize);

http://codereview.chromium.org/6170001/diff/1/src/arm/macro-assembler-arm.cc#newcode1435
src/arm/macro-assembler-arm.cc:1435: mov(ip,
Operand(ExternalReference(Top::k_c_entry_fp_address)));
ia32 code allocates C arguments below c_entry_fp_address. It allows to
not care that C arguments could be reached by GC. I think this semantic
should be preserved here as well.

By the way, you put argc into the argumets stack space what could be
misinterpreted as an object reference (if argc is odd) and crash GC if
it happens in the called function.

Also stack alignment placeholder don't need to be initialized if it's
below c_entry_fp_address.

http://codereview.chromium.org/6170001/diff/1/src/arm/macro-assembler-arm.cc#newcode1452
src/arm/macro-assembler-arm.cc:1452: mov(ip, Operand(next_address));
x64 implementation use offsets to eliminate 2 of 3 ldr instructions:

static int Offset(ExternalReference ref0, ExternalReference ref1) {
  int64_t offset = (ref0.address() - ref1.address());
  // Check that fits into int.
  ASSERT(static_cast<int>(offset) == offset);
  return static_cast<int>(offset);
}

  ExternalReference next_address =
      ExternalReference::handle_scope_next_address();
  const int kNextOffset = 0;
  const int kLimitOffset = Offset(
      ExternalReference::handle_scope_limit_address(),
      next_address);
  const int kLevelOffset = Offset(
      ExternalReference::handle_scope_level_address(),
      next_address);

May be it would work here as well?

http://codereview.chromium.org/6170001/diff/1/src/arm/macro-assembler-arm.cc#newcode1476
src/arm/macro-assembler-arm.cc:1476: ldr(r0, MemOperand(r0));
LoadRoot(r0, Heap::kUndefinedValueRootIndex, eq);
ldr(r0, MemOperand(r0), ne);

How about it?

http://codereview.chromium.org/6170001/

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to