Chromium Code Reviews

Side by Side Diff: src/macros.py

Issue 1182303004: All private symbols are own symbols (Closed) Base URL: https://chromium.googlesource.com/v8/v8@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
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 142 matching lines...)
153 macro TO_STRING_INLINE(arg) = (IS_STRING(%IS_VAR(arg)) ? arg : $nonStringToStrin g(arg)); 153 macro TO_STRING_INLINE(arg) = (IS_STRING(%IS_VAR(arg)) ? arg : $nonStringToStrin g(arg));
154 macro TO_NUMBER_INLINE(arg) = (IS_NUMBER(%IS_VAR(arg)) ? arg : $nonNumberToNumbe r(arg)); 154 macro TO_NUMBER_INLINE(arg) = (IS_NUMBER(%IS_VAR(arg)) ? arg : $nonNumberToNumbe r(arg));
155 macro TO_OBJECT_INLINE(arg) = (IS_SPEC_OBJECT(%IS_VAR(arg)) ? arg : $toObject(ar g)); 155 macro TO_OBJECT_INLINE(arg) = (IS_SPEC_OBJECT(%IS_VAR(arg)) ? arg : $toObject(ar g));
156 macro JSON_NUMBER_TO_STRING(arg) = ((%_IsSmi(%IS_VAR(arg)) || arg - arg == 0) ? %_NumberToString(arg) : "null"); 156 macro JSON_NUMBER_TO_STRING(arg) = ((%_IsSmi(%IS_VAR(arg)) || arg - arg == 0) ? %_NumberToString(arg) : "null");
157 macro HAS_OWN_PROPERTY(arg, index) = (%_CallFunction(arg, index, ObjectHasOwnPro perty)); 157 macro HAS_OWN_PROPERTY(arg, index) = (%_CallFunction(arg, index, ObjectHasOwnPro perty));
158 macro SHOULD_CREATE_WRAPPER(functionName, receiver) = (!IS_SPEC_OBJECT(receiver) && %IsSloppyModeFunction(functionName)); 158 macro SHOULD_CREATE_WRAPPER(functionName, receiver) = (!IS_SPEC_OBJECT(receiver) && %IsSloppyModeFunction(functionName));
159 macro HAS_INDEX(array, index, is_array) = ((is_array && %_HasFastPackedElements( %IS_VAR(array))) ? (index < array.length) : (index in array)); 159 macro HAS_INDEX(array, index, is_array) = ((is_array && %_HasFastPackedElements( %IS_VAR(array))) ? (index < array.length) : (index in array));
160 160
161 # Private names. 161 # Private names.
162 # GET_PRIVATE should only be used if the property is known to exists on obj 162 # GET_PRIVATE should only be used if the property is known to exists on obj
163 # itself (it should really use %GetOwnProperty, but that would be way slower). 163 # itself (it should really use %GetOwnProperty, but that would be way slower).
rossberg 2015/06/15 12:09:11 Is this comment still needed? It seems to work tha
wingo 2015/06/16 07:09:45 Removed.
164 macro GLOBAL_PRIVATE(name) = (%CreateGlobalPrivateOwnSymbol(name)); 164 macro GLOBAL_PRIVATE(name) = (%CreateGlobalPrivateSymbol(name));
165 macro NEW_PRIVATE_OWN(name) = (%CreatePrivateOwnSymbol(name)); 165 macro NEW_PRIVATE_OWN(name) = (%CreatePrivateSymbol(name));
rossberg 2015/06/15 12:09:11 Rename this to NEW_PRIVATE
wingo 2015/06/16 07:09:45 Done.
166 macro IS_PRIVATE(sym) = (%SymbolIsPrivate(sym)); 166 macro IS_PRIVATE(sym) = (%SymbolIsPrivate(sym));
167 macro HAS_PRIVATE(obj, sym) = (%HasOwnProperty(obj, sym)); 167 macro HAS_PRIVATE(obj, sym) = (%HasOwnProperty(obj, sym));
168 macro HAS_DEFINED_PRIVATE(obj, sym) = (!IS_UNDEFINED(obj[sym])); 168 macro HAS_DEFINED_PRIVATE(obj, sym) = (!IS_UNDEFINED(obj[sym]));
169 macro GET_PRIVATE(obj, sym) = (obj[sym]); 169 macro GET_PRIVATE(obj, sym) = (obj[sym]);
170 macro SET_PRIVATE(obj, sym, val) = (obj[sym] = val); 170 macro SET_PRIVATE(obj, sym, val) = (obj[sym] = val);
171 macro DELETE_PRIVATE(obj, sym) = (delete obj[sym]); 171 macro DELETE_PRIVATE(obj, sym) = (delete obj[sym]);
172 172
173 # Constants. The compiler constant folds them. 173 # Constants. The compiler constant folds them.
174 define NAN = $NaN; 174 define NAN = $NaN;
175 define INFINITY = (1/0); 175 define INFINITY = (1/0);
(...skipping 130 matching lines...)
306 define NOT_FOUND = -1; 306 define NOT_FOUND = -1;
307 307
308 # Check whether debug is active. 308 # Check whether debug is active.
309 define DEBUG_IS_ACTIVE = (%_DebugIsActive() != 0); 309 define DEBUG_IS_ACTIVE = (%_DebugIsActive() != 0);
310 macro DEBUG_IS_STEPPING(function) = (%_DebugIsActive() != 0 && %DebugCallbackSup portsStepping(function)); 310 macro DEBUG_IS_STEPPING(function) = (%_DebugIsActive() != 0 && %DebugCallbackSup portsStepping(function));
311 macro DEBUG_PREPARE_STEP_IN_IF_STEPPING(function) = if (DEBUG_IS_STEPPING(functi on)) %DebugPrepareStepInIfStepping(function); 311 macro DEBUG_PREPARE_STEP_IN_IF_STEPPING(function) = if (DEBUG_IS_STEPPING(functi on)) %DebugPrepareStepInIfStepping(function);
312 312
313 # SharedFlag equivalents 313 # SharedFlag equivalents
314 define kNotShared = false; 314 define kNotShared = false;
315 define kShared = true; 315 define kShared = true;
OLDNEW
« no previous file with comments | « src/lookup.h ('k') | src/objects.h » ('j') | test/mjsunit/harmony/private.js » ('J')

Powered by Google App Engine