Reviewers: Lasse Reichstein,

Message:
The existing implementation of StringCharCodeAt examines the string type. In the case of cons or slice the underlying string is loaded and re-examined. In the case of external string or unflattened cons, we jump to the runtime, where we start out with the original string, and the unpacking of cons or slice has to be redone in runtime. This of course also means that the original arguments (string
object and index) have to be kept for the case of runtime call.

However, we can also pass the already unpacked underlying external string to the runtime directly, together with the adjusted index (if the original string was a slice, by adding the slice-offset). This saves us from the trouble of saving the
original arguments, and also removes the need for a scratch register.

The crankshaft implementation already does this, even though unintentially up
till now.

Please take a look.

Description:
Simplify StringCharCodeAt in non-crankshaft codegen.

TEST=test/mjsunit/string-slices.js


Please review this at http://codereview.chromium.org/8510005/

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

Affected files:
  M src/arm/code-stubs-arm.cc
  M src/arm/full-codegen-arm.cc
  M src/arm/ic-arm.cc
  M src/arm/lithium-codegen-arm.cc
  M src/arm/stub-cache-arm.cc
  M src/code-stubs.h
  M src/ia32/code-stubs-ia32.cc
  M src/ia32/full-codegen-ia32.cc
  M src/ia32/ic-ia32.cc
  M src/ia32/lithium-codegen-ia32.cc
  M src/ia32/stub-cache-ia32.cc
  M src/x64/code-stubs-x64.cc
  M src/x64/full-codegen-x64.cc
  M src/x64/ic-x64.cc
  M src/x64/lithium-codegen-x64.cc
  M src/x64/stub-cache-x64.cc
  M test/mjsunit/string-slices.js


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

Reply via email to