I addressed a few suggestions by Anton and removed the constants for
symbols.
I'm still thinking about how to take care of externalizing strings.
http://codereview.chromium.org/7477045/diff/6002/src/arm/code-stubs-arm.cc
File src/arm/code-stubs-arm.cc (right):
http://codereview.chromium.org/7477045/diff/6002/src/arm/code-stubs-arm.cc#newcode4804
src/arm/code-stubs-arm.cc:4804: __ tst(result_,
Operand(kStringRepresentationMask));
Unfortunately, I don't see anything here. index_ is read only.
On 2011/07/27 14:04:49, antonm wrote:
Do we have a spare register here? If yes, we can probably and_ into
it to save
and_ below.
http://codereview.chromium.org/7477045/diff/6002/src/heap.cc
File src/heap.cc (right):
http://codereview.chromium.org/7477045/diff/6002/src/heap.cc#newcode2691
src/heap.cc:2691: sliced_string->set_parent(cons->first());
There is no way to create such a cons string. The only way to get an
empty second string would to flatten the cons string so that the first
string is a seq string and the cons string itself is merely a wrapper.
On 2011/07/27 14:04:49, antonm wrote:
just curious: is it possible to get:
cons string {
first: const string;
second: empty string;
}
I think it should be doable, but it will break your invariants.
May you add a test?
http://codereview.chromium.org/7477045/diff/6002/src/objects.cc
File src/objects.cc (right):
http://codereview.chromium.org/7477045/diff/6002/src/objects.cc#newcode5250
src/objects.cc:5250: string_tag =
StringShape(string).representation_tag();
Ditto. Said structure is impossible to get. I'll add an assert here.
On 2011/07/27 14:04:49, antonm wrote:
not related to your change, but I am curious what will happen if have
the
following structure:
cons string
first -> const string
second -> empty
http://codereview.chromium.org/7477045/diff/6002/src/objects.h
File src/objects.h (right):
http://codereview.chromium.org/7477045/diff/6002/src/objects.h#newcode498
src/objects.h:498: (kSlicedStringTag & kIsIndirectStringMask) ==
kIsIndirectStringTag);
There is only one place where this tag is actually used. I put the
assertion there.
On 2011/07/27 14:04:49, antonm wrote:
sorry, up to you, but I would code it like:
bool is_indirect_string(SRT tag) {
ASSERT((tag & kIISM == kIIST) == ((tag == kConstString) || (tag ==
kSlicedString));
return tag & kIISM == kIIST;
}
And reuse it in heap.h
http://codereview.chromium.org/7477045/diff/11001/test/mjsunit/string-slices.js
File test/mjsunit/string-slices.js (right):
http://codereview.chromium.org/7477045/diff/11001/test/mjsunit/string-slices.js#newcode191
test/mjsunit/string-slices.js:191: /*
Those tests fail, as pointed out by Vitaly. I'll figure out something
for the next update of this CL.
http://codereview.chromium.org/7477045/
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev