Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Issue 1645001: Native construction of RegExp result objects, with in-object index and input. (Closed)

Created:
10 years, 8 months ago by Lasse Reichstein
Modified:
9 years, 6 months ago
CC:
v8-dev
Visibility:
Public.

Description

Native construction of RegExp result objects, with in-object index and input. Avoid cloning using CloneRegExpResult for results that are just arrays. Made a more direct path for string.match with string argument.

Patch Set 1 #

Total comments: 35
Unified diffs Side-by-side diffs Delta from patch set Stats (+466 lines, -58 lines) Patch
M src/arm/codegen-arm.h View 1 chunk +2 lines, -0 lines 0 comments Download
M src/arm/codegen-arm.cc View 1 chunk +94 lines, -0 lines 12 comments Download
M src/bootstrapper.cc View 1 chunk +56 lines, -0 lines 4 comments Download
M src/codegen.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/contexts.h View 2 chunks +2 lines, -0 lines 0 comments Download
M src/heap.h View 1 chunk +2 lines, -0 lines 0 comments Download
M src/ia32/codegen-ia32.h View 1 chunk +2 lines, -0 lines 0 comments Download
M src/ia32/codegen-ia32.cc View 2 chunks +90 lines, -1 line 6 comments Download
M src/objects.h View 1 chunk +5 lines, -0 lines 2 comments Download
M src/regexp.js View 3 chunks +42 lines, -30 lines 2 comments Download
M src/runtime.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/runtime.cc View 1 chunk +30 lines, -0 lines 2 comments Download
M src/string.js View 4 chunks +40 lines, -27 lines 0 comments Download
M src/x64/codegen-x64.h View 1 chunk +2 lines, -0 lines 0 comments Download
M src/x64/codegen-x64.cc View 1 chunk +91 lines, -0 lines 7 comments Download
M test/mjsunit/fuzz-natives.js View 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Lasse Reichstein
RegExp result in-object properties for review.
10 years, 8 months ago (2010-04-12 13:21:18 UTC) #1
Søren Thygesen Gjesse
LGTM http://codereview.chromium.org/1645001/diff/1/2 File src/arm/codegen-arm.cc (right): http://codereview.chromium.org/1645001/diff/1/2#newcode4038 src/arm/codegen-arm.cc:4038: __ tst(r1, Operand(0x01)); kHeapObjectTag? http://codereview.chromium.org/1645001/diff/1/2#newcode4049 src/arm/codegen-arm.cc:4049: (JSArray::kRegExpResultSize + ...
10 years, 8 months ago (2010-04-13 07:22:29 UTC) #2
Lasse Reichstein
10 years, 8 months ago (2010-04-13 09:50:55 UTC) #3
http://codereview.chromium.org/1645001/diff/1/2
File src/arm/codegen-arm.cc (right):

http://codereview.chromium.org/1645001/diff/1/2#newcode4038
src/arm/codegen-arm.cc:4038: __ tst(r1, Operand(0x01));
That, or kSmiTagMask.
Fixed.

http://codereview.chromium.org/1645001/diff/1/2#newcode4049
src/arm/codegen-arm.cc:4049: (JSArray::kRegExpResultSize +
FixedArray::kHeaderSize) / kPointerSize;
Done.

http://codereview.chromium.org/1645001/diff/1/2#newcode4079
src/arm/codegen-arm.cc:4079: __ str(r4, FieldMemOperand(r0, JSArray::kSize));
Done.

http://codereview.chromium.org/1645001/diff/1/2#newcode4085
src/arm/codegen-arm.cc:4085: // r1: Number of elements in array, as smi.
Whoops, code and comments out of sync. Well spotted.

http://codereview.chromium.org/1645001/diff/1/2#newcode4090
src/arm/codegen-arm.cc:4090: // Untag r1 and set FixedArray length.
Done.

http://codereview.chromium.org/1645001/diff/1/2#newcode4099
src/arm/codegen-arm.cc:4099: // r2: the hole.
Fixed, r1->r5.

http://codereview.chromium.org/1645001/diff/1/4
File src/bootstrapper.cc (right):

http://codereview.chromium.org/1645001/diff/1/4#newcode1272
src/bootstrapper.cc:1272: FieldDescriptor index_field(Heap::index_symbol(),
Done.

http://codereview.chromium.org/1645001/diff/1/4#newcode1280
src/bootstrapper.cc:1280: FieldDescriptor input_field(Heap::input_symbol(),
Done too.

http://codereview.chromium.org/1645001/diff/1/8
File src/ia32/codegen-ia32.cc (right):

http://codereview.chromium.org/1645001/diff/1/8#newcode6552
src/ia32/codegen-ia32.cc:6552: __ test(ebx, Immediate(0x01));
Changed to kSmiTagMask.

http://codereview.chromium.org/1645001/diff/1/8#newcode6563
src/ia32/codegen-ia32.cc:6563: times_half_pointer_size,
Done.

http://codereview.chromium.org/1645001/diff/1/8#newcode6586
src/ia32/codegen-ia32.cc:6586: __ pop(FieldOperand(eax, JSArray::kSize +
kPointerSize));
Done.

http://codereview.chromium.org/1645001/diff/1/10
File src/objects.h (right):

http://codereview.chromium.org/1645001/diff/1/10#newcode4626
src/objects.h:4626: // RegExp results are arrays with index and input as
internal fields.
Done.

http://codereview.chromium.org/1645001/diff/1/11
File src/regexp.js (right):

http://codereview.chromium.org/1645001/diff/1/11#newcode141
src/regexp.js:141: var answer = %_RegExpConstructResult(length, array.index,
array.input);
It's a good idea for an optional argument. The function is also called below,
where we haven't created an array of strings yet.
However, I would want a fast CloneJSArray function too for, e.g., the
String.split cache. That might just be a "copy contents" code that can be reused
here.

http://codereview.chromium.org/1645001/diff/1/12
File src/runtime.cc (right):

http://codereview.chromium.org/1645001/diff/1/12#newcode1254
src/runtime.cc:1254: // Write in-object properties after the length of the
array.
Done.

http://codereview.chromium.org/1645001/diff/1/15
File src/x64/codegen-x64.cc (right):

http://codereview.chromium.org/1645001/diff/1/15#newcode4179
src/x64/codegen-x64.cc:4179: __ lea(rcx, Operand(rax,
JSArray::kRegExpResultSize));
Size moved to JSRegExpResult.

http://codereview.chromium.org/1645001/diff/1/15#newcode4183
src/x64/codegen-x64.cc:4183: __ pop(FieldOperand(rax, JSArray::kSize +
kPointerSize));
Done.

http://codereview.chromium.org/1645001/diff/1/15#newcode4191
src/x64/codegen-x64.cc:4191: // rbx: Number of elements in array.
Done.

http://codereview.chromium.org/1645001/diff/1/15#newcode4203
src/x64/codegen-x64.cc:4203: // rbx: Number of elements to fill (as int32).
Done, slightly reworded (since rbx is modified in the loop).

Powered by Google App Engine
This is Rietveld 408576698