LGTM (with helper in macro-assembler-arm.cc)

Still you should probably wait for Erik's opinion on ARM staff and his comments.



http://codereview.chromium.org/1706013/diff/35003/48015
File src/arm/macro-assembler-arm.cc (left):

http://codereview.chromium.org/1706013/diff/35003/48015#oldcode1101
src/arm/macro-assembler-arm.cc:1101: }
Well. This is getting hairy. I just noticed that all this pieces of code
are the same. They just have different scratch1, scratch2 usage.
Changing them simultaneously probably annoys you.

Best solution from my point of view is to create helper:

void InitializeStringFields (Register string, Register length, Register
scratch1, Register scratch2) {
  // Load goes first to improve pipeline utilization.
  LoadRoot(scratch1, Heap::kConsAsciiStringMapRootIndex);
  mov(scratch2, Operand(length, LSL, kSmiTagSize));
  str(scratch2, FieldMemOperand(string, String::kLengthOffset));
  mov(scratch2, Operand(String::kEmptyHashField));
  str(scratch2, FieldMemOperand(string, String::kHashFieldOffset));
  str(scratch1, FieldMemOperand(string, HeapObject::kMapOffset));
}

What do you think? From my point of view it is very readable and not
fragile solution. Will it work?

http://codereview.chromium.org/1706013/show

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

Reply via email to