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

Side by Side Diff: src/macros.py

Issue 3115024: Don't do a smi check twice in the TO_INTEGER macro. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 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
« no previous file with comments | « no previous file | no next file » | 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 macro FLOOR(arg) = $floor(arg); 113 macro FLOOR(arg) = $floor(arg);
114 114
115 # Macro for ECMAScript 5 queries of the type: 115 # Macro for ECMAScript 5 queries of the type:
116 # "Type(O) is object." 116 # "Type(O) is object."
117 # This is the same as being either a function or an object in V8 terminology. 117 # This is the same as being either a function or an object in V8 terminology.
118 # In addition, an undetectable object is also included by this. 118 # In addition, an undetectable object is also included by this.
119 macro IS_SPEC_OBJECT(arg) = (%_IsSpecObject(arg)); 119 macro IS_SPEC_OBJECT(arg) = (%_IsSpecObject(arg));
120 120
121 # Inline macros. Use %IS_VAR to make sure arg is evaluated only once. 121 # Inline macros. Use %IS_VAR to make sure arg is evaluated only once.
122 macro NUMBER_IS_NAN(arg) = (!%_IsSmi(%IS_VAR(arg)) && !(arg == arg)); 122 macro NUMBER_IS_NAN(arg) = (!%_IsSmi(%IS_VAR(arg)) && !(arg == arg));
123 macro TO_INTEGER(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : ToInteger(arg)); 123 macro TO_INTEGER(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : %NumberToInteger(ToNumber (arg)));
124 macro TO_INTEGER_MAP_MINUS_ZERO(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : %NumberToI ntegerMapMinusZero(ToNumber(arg))); 124 macro TO_INTEGER_MAP_MINUS_ZERO(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : %NumberToI ntegerMapMinusZero(ToNumber(arg)));
125 macro TO_INT32(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : (arg >> 0)); 125 macro TO_INT32(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : (arg >> 0));
126 macro TO_UINT32(arg) = (arg >>> 0); 126 macro TO_UINT32(arg) = (arg >>> 0);
127 macro TO_STRING_INLINE(arg) = (IS_STRING(%IS_VAR(arg)) ? arg : NonStringToString (arg)); 127 macro TO_STRING_INLINE(arg) = (IS_STRING(%IS_VAR(arg)) ? arg : NonStringToString (arg));
128 128
129 129
130 # Macros implemented in Python. 130 # Macros implemented in Python.
131 python macro CHAR_CODE(str) = ord(str[1]); 131 python macro CHAR_CODE(str) = ord(str[1]);
132 132
133 # Constants used on an array to implement the properties of the RegExp object. 133 # Constants used on an array to implement the properties of the RegExp object.
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 168
169 # PropertyDescriptor return value indices - must match 169 # PropertyDescriptor return value indices - must match
170 # PropertyDescriptorIndices in runtime.cc. 170 # PropertyDescriptorIndices in runtime.cc.
171 const IS_ACCESSOR_INDEX = 0; 171 const IS_ACCESSOR_INDEX = 0;
172 const VALUE_INDEX = 1; 172 const VALUE_INDEX = 1;
173 const GETTER_INDEX = 2; 173 const GETTER_INDEX = 2;
174 const SETTER_INDEX = 3; 174 const SETTER_INDEX = 3;
175 const WRITABLE_INDEX = 4; 175 const WRITABLE_INDEX = 4;
176 const ENUMERABLE_INDEX = 5; 176 const ENUMERABLE_INDEX = 5;
177 const CONFIGURABLE_INDEX = 6; 177 const CONFIGURABLE_INDEX = 6;
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698