I'm with Kevin in that we should avoid adding too many special cases to the
hydrogen-builder.
Maybe we can achieve almost the same performance by implementing
%_StringCharCodeAt in hydrogen and making sure that we inline the builtin
functions that call it with the standard inlining mechanism.
For the out-of-bounds access you need to return NaN which would make the
output
representation a double number. This does not seem ideal. - How about
returning
a tagged value (smi or heap number) instead?
http://codereview.chromium.org/6304001/diff/1/src/hydrogen-instructions.h
File src/hydrogen-instructions.h (right):
http://codereview.chromium.org/6304001/diff/1/src/hydrogen-instructions.h#newcode84
src/hydrogen-instructions.h:84: // HStringChartCodeAt
->HStringCharCodeAt
http://codereview.chromium.org/6304001/diff/1/src/hydrogen-instructions.h#newcode2914
src/hydrogen-instructions.h:2914: class HStringLength: public
HUnaryOperation {
Could you use HStringLength to optimize access like s.length (similar to
the way we do for ArrayLength)?
http://codereview.chromium.org/6304001/diff/1/src/ia32/lithium-ia32.cc
File src/ia32/lithium-ia32.cc (right):
http://codereview.chromium.org/6304001/diff/1/src/ia32/lithium-ia32.cc#newcode1746
src/ia32/lithium-ia32.cc:1746: return
AssignEnvironment(AssignPointerMap(DefineAsRegister(
I'd rather split this into multiple statements to improve readability.
LOperand* object = UseRegister(instr->string());
LOperand* index = UseRegisterOrConstant(instr->index());
...
http://codereview.chromium.org/6304001/diff/1/src/ia32/lithium-ia32.cc#newcode1753
src/ia32/lithium-ia32.cc:1753: return DefineAsRegister(
I'd also split this into 2 statement here.
http://codereview.chromium.org/6304001/
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev