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

Side by Side Diff: src/js/regexp.js

Issue 1558113002: Add UseCounters for various standards-related code paths (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix accidental redefinition Created 4 years, 11 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/js/promise.js ('k') | src/runtime/runtime-i18n.cc » ('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 (function(global, utils) { 5 (function(global, utils) {
6 6
7 %CheckIsBootstrapping(); 7 %CheckIsBootstrapping();
8 8
9 // ------------------------------------------------------------------- 9 // -------------------------------------------------------------------
10 // Imports 10 // Imports
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 regexp_val = 264 regexp_val =
265 new GlobalRegExp( 265 new GlobalRegExp(
266 %_SubString(REGEXP_SOURCE(regexp), 2, REGEXP_SOURCE(regexp).length), 266 %_SubString(REGEXP_SOURCE(regexp), 2, REGEXP_SOURCE(regexp).length),
267 (REGEXP_IGNORE_CASE(regexp) ? REGEXP_MULTILINE(regexp) ? "im" : "i" 267 (REGEXP_IGNORE_CASE(regexp) ? REGEXP_MULTILINE(regexp) ? "im" : "i"
268 : REGEXP_MULTILINE(regexp) ? "m" : "")); 268 : REGEXP_MULTILINE(regexp) ? "m" : ""));
269 } 269 }
270 return regexp_val; 270 return regexp_val;
271 } 271 }
272 272
273 273
274 var kRegExpPrototypeToString = 12;
275
276 function RegExpToString() { 274 function RegExpToString() {
277 if (!IS_REGEXP(this)) { 275 if (!IS_REGEXP(this)) {
278 // RegExp.prototype.toString() returns '/(?:)/' as a compatibility fix; 276 // RegExp.prototype.toString() returns '/(?:)/' as a compatibility fix;
279 // a UseCounter is incremented to track it. 277 // a UseCounter is incremented to track it.
280 // TODO(littledan): Remove this workaround or standardize it 278 // TODO(littledan): Remove this workaround or standardize it
281 if (this === GlobalRegExpPrototype) { 279 if (this === GlobalRegExpPrototype) {
282 %IncrementUseCounter(kRegExpPrototypeToString); 280 %IncrementUseCounter(kRegExpPrototypeToString);
283 return '/(?:)/'; 281 return '/(?:)/';
284 } 282 }
285 throw MakeTypeError(kIncompatibleMethodReceiver, 283 throw MakeTypeError(kIncompatibleMethodReceiver,
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 // Exports 572 // Exports
575 573
576 utils.Export(function(to) { 574 utils.Export(function(to) {
577 to.RegExpExec = DoRegExpExec; 575 to.RegExpExec = DoRegExpExec;
578 to.RegExpExecNoTests = RegExpExecNoTests; 576 to.RegExpExecNoTests = RegExpExecNoTests;
579 to.RegExpLastMatchInfo = RegExpLastMatchInfo; 577 to.RegExpLastMatchInfo = RegExpLastMatchInfo;
580 to.RegExpTest = RegExpTest; 578 to.RegExpTest = RegExpTest;
581 }); 579 });
582 580
583 }) 581 })
OLDNEW
« no previous file with comments | « src/js/promise.js ('k') | src/runtime/runtime-i18n.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698