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

Issue 11416270: Implement faster splitting with empty string as pattern. Add special native for computing substring… (Closed)

Created:
8 years ago by srdjan
Modified:
8 years ago
Reviewers:
siva
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Implement faster splitting with empty string as pattern. Add special native for computing substring of OneByteString (preparation for instrinsic). Committed: https://code.google.com/p/dart/source/detail?r=15548

Patch Set 1 #

Patch Set 2 : #

Total comments: 2

Patch Set 3 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+40 lines, -1 line) Patch
M runtime/lib/string.cc View 1 2 2 chunks +13 lines, -1 line 0 comments Download
M runtime/lib/string_base.dart View 1 2 2 chunks +5 lines, -0 lines 0 comments Download
M runtime/vm/bootstrap_natives.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/object.h View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M runtime/vm/object.cc View 1 2 1 chunk +16 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
srdjan
8 years ago (2012-11-29 21:14:03 UTC) #1
siva
lgtm https://codereview.chromium.org/11416270/diff/5001/runtime/vm/object.cc File runtime/vm/object.cc (right): https://codereview.chromium.org/11416270/diff/5001/runtime/vm/object.cc#newcode10788 runtime/vm/object.cc:10788: String::Copy(result, 0, other, other_start_index, other_len); Could be written ...
8 years ago (2012-11-29 21:42:46 UTC) #2
srdjan
8 years ago (2012-11-29 22:57:14 UTC) #3
Message was sent while issue was closed.
https://codereview.chromium.org/11416270/diff/5001/runtime/vm/object.cc
File runtime/vm/object.cc (right):

https://codereview.chromium.org/11416270/diff/5001/runtime/vm/object.cc#newco...
runtime/vm/object.cc:10788: String::Copy(result, 0, other, other_start_index,
other_len);
On 2012/11/29 21:42:46, siva wrote:
> Could be written as:
> ASSERT(other.IsOneByteString());
> NoGCScope no_gc;
> memmove(OneByteString::CharAddr(result, 0),
>         OneByteString::CharAddr(other, other_start_index),
>         other_len);
> 
> or
> 
> ASSERT(other.IsOneByteString());
> NoGCScope no_gc;
> String::Copy(result,
>              0, 
>              OneByteString::CharAddr(other, other_start_index),
>              other_len);
> 
> This would save some additional checks as you already know
> it is a OneByteString.

Done.

Powered by Google App Engine
This is Rietveld 408576698