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

Side by Side Diff: src/runtime.js

Issue 22184004: Desugar bitwise negation into XOR and kill all UnaryOp stuff. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased. Feedback. Created 7 years, 4 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
OLDNEW
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
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);
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
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));
OLDNEW
« no previous file with comments | « src/runtime.cc ('k') | src/type-info.h » ('j') | src/x64/lithium-codegen-x64.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698