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

Side by Side Diff: src/string.js

Issue 1127983003: Use function wrapper argument to expose internal arrays to native scripts. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebased and fixed nits Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/regexp.js ('k') | src/templates.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 var $stringCharAt; 5 var $stringCharAt;
6 var $stringIndexOf; 6 var $stringIndexOf;
7 var $stringSubstring; 7 var $stringSubstring;
8 8
9 (function(global, shared, exports) { 9 (function(global, shared, exports) {
10 10
11 %CheckIsBootstrapping(); 11 %CheckIsBootstrapping();
12 12
13 // -------------------------------------------------------------------
14 // Imports
15
13 var GlobalRegExp = global.RegExp; 16 var GlobalRegExp = global.RegExp;
14 var GlobalString = global.String; 17 var GlobalString = global.String;
18 var InternalArray = shared.InternalArray;
19 var InternalPackedArray = shared.InternalPackedArray;
15 20
16 //------------------------------------------------------------------- 21 //-------------------------------------------------------------------
17 22
18 function StringConstructor(x) { 23 function StringConstructor(x) {
19 if (%_ArgumentsLength() == 0) x = ''; 24 if (%_ArgumentsLength() == 0) x = '';
20 if (%_IsConstructCall()) { 25 if (%_IsConstructCall()) {
21 %_SetValueOf(this, TO_STRING_INLINE(x)); 26 %_SetValueOf(this, TO_STRING_INLINE(x));
22 } else { 27 } else {
23 return IS_SYMBOL(x) ? 28 return IS_SYMBOL(x) ?
24 %_CallFunction(x, $symbolToString) : TO_STRING_INLINE(x); 29 %_CallFunction(x, $symbolToString) : TO_STRING_INLINE(x);
(...skipping 1140 matching lines...) Expand 10 before | Expand all | Expand 10 after
1165 "strike", StringStrike, 1170 "strike", StringStrike,
1166 "sub", StringSub, 1171 "sub", StringSub,
1167 "sup", StringSup 1172 "sup", StringSup
1168 ]); 1173 ]);
1169 1174
1170 $stringCharAt = StringCharAtJS; 1175 $stringCharAt = StringCharAtJS;
1171 $stringIndexOf = StringIndexOfJS; 1176 $stringIndexOf = StringIndexOfJS;
1172 $stringSubstring = StringSubstring; 1177 $stringSubstring = StringSubstring;
1173 1178
1174 }) 1179 })
OLDNEW
« no previous file with comments | « src/regexp.js ('k') | src/templates.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698