Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 287 | 287 |
| 288 | 288 |
| 289 // ECMA-262, section 11.10, page 57. | 289 // ECMA-262, section 11.10, page 57. |
| 290 function BIT_XOR(y) { | 290 function BIT_XOR(y) { |
| 291 var x = IS_NUMBER(this) ? this : %NonNumberToNumber(this); | 291 var x = IS_NUMBER(this) ? this : %NonNumberToNumber(this); |
| 292 if (!IS_NUMBER(y)) y = %NonNumberToNumber(y); | 292 if (!IS_NUMBER(y)) y = %NonNumberToNumber(y); |
| 293 return %NumberXor(x, y); | 293 return %NumberXor(x, y); |
| 294 } | 294 } |
| 295 | 295 |
| 296 | 296 |
| 297 // ECMA-262, section 11.4.8, page 48. | |
| 298 function BIT_NOT() { | |
| 299 var x = IS_NUMBER(this) ? this : %NonNumberToNumber(this); | |
| 300 return %NumberNot(x); | |
|
Michael Starzinger
2013/08/06 08:12:06
I would be tempted to leave this BIT_NOT runtime f
Sven Panne
2013/08/06 13:33:38
Runtime_Number not is dead, Jim...
| |
| 301 } | |
| 302 | |
| 303 | |
| 304 // ECMA-262, section 11.7.1, page 51. | 297 // ECMA-262, section 11.7.1, page 51. |
| 305 function SHL(y) { | 298 function SHL(y) { |
| 306 var x = IS_NUMBER(this) ? this : %NonNumberToNumber(this); | 299 var x = IS_NUMBER(this) ? this : %NonNumberToNumber(this); |
| 307 if (!IS_NUMBER(y)) y = %NonNumberToNumber(y); | 300 if (!IS_NUMBER(y)) y = %NonNumberToNumber(y); |
| 308 return %NumberShl(x, y); | 301 return %NumberShl(x, y); |
| 309 } | 302 } |
| 310 | 303 |
| 311 | 304 |
| 312 // ECMA-262, section 11.7.2, page 51. | 305 // ECMA-262, section 11.7.2, page 51. |
| 313 function SAR(y) { | 306 function SAR(y) { |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 674 return i; | 667 return i; |
| 675 } | 668 } |
| 676 | 669 |
| 677 | 670 |
| 678 // NOTE: Setting the prototype for Array must take place as early as | 671 // NOTE: Setting the prototype for Array must take place as early as |
| 679 // possible due to code generation for array literals. When | 672 // possible due to code generation for array literals. When |
| 680 // generating code for a array literal a boilerplate array is created | 673 // generating code for a array literal a boilerplate array is created |
| 681 // that is cloned when running the code. It is essential that the | 674 // that is cloned when running the code. It is essential that the |
| 682 // boilerplate gets the right prototype. | 675 // boilerplate gets the right prototype. |
| 683 %FunctionSetPrototype($Array, new $Array(0)); | 676 %FunctionSetPrototype($Array, new $Array(0)); |
| OLD | NEW |