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

Side by Side Diff: src/regexp.js

Issue 7830036: Optimize isFinite and isNaN. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Made the change general by moving putting it in the NUMBER_IS_FINITE macro. Created 9 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « src/profile-generator.cc ('k') | src/runtime.h » ('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 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 ); 398 );
399 399
400 // Override last match info with an array of actual substrings. 400 // Override last match info with an array of actual substrings.
401 // Used internally by replace regexp with function. 401 // Used internally by replace regexp with function.
402 // The array has the format of an "apply" argument for a replacement 402 // The array has the format of an "apply" argument for a replacement
403 // function. 403 // function.
404 var lastMatchInfoOverride = null; 404 var lastMatchInfoOverride = null;
405 405
406 // ------------------------------------------------------------------- 406 // -------------------------------------------------------------------
407 407
408 function SetUpRegExp() { 408 function SetupRegExp() {
409 %CheckIsBootstrapping();
410 %FunctionSetInstanceClassName($RegExp, 'RegExp'); 409 %FunctionSetInstanceClassName($RegExp, 'RegExp');
411 %FunctionSetPrototype($RegExp, new $Object()); 410 %FunctionSetPrototype($RegExp, new $Object());
412 %SetProperty($RegExp.prototype, 'constructor', $RegExp, DONT_ENUM); 411 %SetProperty($RegExp.prototype, 'constructor', $RegExp, DONT_ENUM);
413 %SetCode($RegExp, RegExpConstructor); 412 %SetCode($RegExp, RegExpConstructor);
414 413
415 InstallFunctions($RegExp.prototype, DONT_ENUM, $Array( 414 InstallFunctions($RegExp.prototype, DONT_ENUM, $Array(
416 "exec", RegExpExec, 415 "exec", RegExpExec,
417 "test", RegExpTest, 416 "test", RegExpTest,
418 "toString", RegExpToString, 417 "toString", RegExpToString,
419 "compile", CompileRegExp 418 "compile", CompileRegExp
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 %DefineAccessor($RegExp, 'rightContext', SETTER, NoOpSetter, DONT_DELETE); 477 %DefineAccessor($RegExp, 'rightContext', SETTER, NoOpSetter, DONT_DELETE);
479 %DefineAccessor($RegExp, "$'", GETTER, RegExpGetRightContext, DONT_ENUM | DONT _DELETE); 478 %DefineAccessor($RegExp, "$'", GETTER, RegExpGetRightContext, DONT_ENUM | DONT _DELETE);
480 %DefineAccessor($RegExp, "$'", SETTER, NoOpSetter, DONT_ENUM | DONT_DELETE); 479 %DefineAccessor($RegExp, "$'", SETTER, NoOpSetter, DONT_ENUM | DONT_DELETE);
481 480
482 for (var i = 1; i < 10; ++i) { 481 for (var i = 1; i < 10; ++i) {
483 %DefineAccessor($RegExp, '$' + i, GETTER, RegExpMakeCaptureGetter(i), DONT_D ELETE); 482 %DefineAccessor($RegExp, '$' + i, GETTER, RegExpMakeCaptureGetter(i), DONT_D ELETE);
484 %DefineAccessor($RegExp, '$' + i, SETTER, NoOpSetter, DONT_DELETE); 483 %DefineAccessor($RegExp, '$' + i, SETTER, NoOpSetter, DONT_DELETE);
485 } 484 }
486 } 485 }
487 486
488 SetUpRegExp(); 487
488 SetupRegExp();
OLDNEW
« no previous file with comments | « src/profile-generator.cc ('k') | src/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698