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

Side by Side Diff: src/macros.py

Issue 486763002: Make all global private symbols own symbols. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: HAS_DEFINED_PRIVATE is back Created 6 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 | « src/array-iterator.js ('k') | src/promise.js » ('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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 macro TO_INT32(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : (arg >> 0)); 163 macro TO_INT32(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : (arg >> 0));
164 macro TO_UINT32(arg) = (arg >>> 0); 164 macro TO_UINT32(arg) = (arg >>> 0);
165 macro TO_STRING_INLINE(arg) = (IS_STRING(%IS_VAR(arg)) ? arg : NonStringToString (arg)); 165 macro TO_STRING_INLINE(arg) = (IS_STRING(%IS_VAR(arg)) ? arg : NonStringToString (arg));
166 macro TO_NUMBER_INLINE(arg) = (IS_NUMBER(%IS_VAR(arg)) ? arg : NonNumberToNumber (arg)); 166 macro TO_NUMBER_INLINE(arg) = (IS_NUMBER(%IS_VAR(arg)) ? arg : NonNumberToNumber (arg));
167 macro TO_OBJECT_INLINE(arg) = (IS_SPEC_OBJECT(%IS_VAR(arg)) ? arg : ToObject(arg )); 167 macro TO_OBJECT_INLINE(arg) = (IS_SPEC_OBJECT(%IS_VAR(arg)) ? arg : ToObject(arg ));
168 macro JSON_NUMBER_TO_STRING(arg) = ((%_IsSmi(%IS_VAR(arg)) || arg - arg == 0) ? %_NumberToString(arg) : "null"); 168 macro JSON_NUMBER_TO_STRING(arg) = ((%_IsSmi(%IS_VAR(arg)) || arg - arg == 0) ? %_NumberToString(arg) : "null");
169 169
170 # Private names. 170 # Private names.
171 # GET_PRIVATE should only be used if the property is known to exists on obj 171 # GET_PRIVATE should only be used if the property is known to exists on obj
172 # itself (it should really use %GetOwnProperty, but that would be way slower). 172 # itself (it should really use %GetOwnProperty, but that would be way slower).
173 macro GLOBAL_PRIVATE(name) = (%CreateGlobalPrivateSymbol(name)); 173 macro GLOBAL_PRIVATE(name) = (%CreateGlobalPrivateOwnSymbol(name));
174 macro NEW_PRIVATE(name) = (%CreatePrivateSymbol(name)); 174 macro NEW_PRIVATE(name) = (%CreatePrivateSymbol(name));
175 macro IS_PRIVATE(sym) = (%SymbolIsPrivate(sym)); 175 macro IS_PRIVATE(sym) = (%SymbolIsPrivate(sym));
176 macro HAS_PRIVATE(obj, sym) = (%HasOwnProperty(obj, sym)); 176 macro HAS_PRIVATE(obj, sym) = (%HasOwnProperty(obj, sym));
177 macro HAS_DEFINED_PRIVATE(obj, sym) = (!IS_UNDEFINED(obj[sym]));
177 macro GET_PRIVATE(obj, sym) = (obj[sym]); 178 macro GET_PRIVATE(obj, sym) = (obj[sym]);
178 macro SET_PRIVATE(obj, sym, val) = (obj[sym] = val); 179 macro SET_PRIVATE(obj, sym, val) = (obj[sym] = val);
179 macro DELETE_PRIVATE(obj, sym) = (delete obj[sym]); 180 macro DELETE_PRIVATE(obj, sym) = (delete obj[sym]);
180 181
181 # Constants. The compiler constant folds them. 182 # Constants. The compiler constant folds them.
182 const NAN = $NaN; 183 const NAN = $NaN;
183 const INFINITY = (1/0); 184 const INFINITY = (1/0);
184 const UNDEFINED = (void 0); 185 const UNDEFINED = (void 0);
185 186
186 # Macros implemented in Python. 187 # Macros implemented in Python.
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 const PROPERTY_ATTRIBUTES_SYMBOLIC = 16; 282 const PROPERTY_ATTRIBUTES_SYMBOLIC = 16;
282 const PROPERTY_ATTRIBUTES_PRIVATE_SYMBOL = 32; 283 const PROPERTY_ATTRIBUTES_PRIVATE_SYMBOL = 32;
283 284
284 # Use for keys, values and entries iterators. 285 # Use for keys, values and entries iterators.
285 const ITERATOR_KIND_KEYS = 1; 286 const ITERATOR_KIND_KEYS = 1;
286 const ITERATOR_KIND_VALUES = 2; 287 const ITERATOR_KIND_VALUES = 2;
287 const ITERATOR_KIND_ENTRIES = 3; 288 const ITERATOR_KIND_ENTRIES = 3;
288 289
289 # Check whether debug is active. 290 # Check whether debug is active.
290 const DEBUG_IS_ACTIVE = (%_DebugIsActive() != 0); 291 const DEBUG_IS_ACTIVE = (%_DebugIsActive() != 0);
OLDNEW
« no previous file with comments | « src/array-iterator.js ('k') | src/promise.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698