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

Side by Side Diff: src/macros.py

Issue 1293493004: Unify symbols sharing across native scripts and runtime. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 5 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
« no previous file with comments | « src/isolate.cc ('k') | src/messages.h » ('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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 macro TO_UINT32(arg) = (arg >>> 0); 152 macro TO_UINT32(arg) = (arg >>> 0);
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(arg) = (%_ToObject(arg)); 155 macro TO_OBJECT(arg) = (%_ToObject(arg));
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 macro GLOBAL_PRIVATE(name) = (%CreateGlobalPrivateSymbol(name));
163 macro NEW_PRIVATE(name) = (%CreatePrivateSymbol(name));
164 macro IS_PRIVATE(sym) = (%SymbolIsPrivate(sym)); 162 macro IS_PRIVATE(sym) = (%SymbolIsPrivate(sym));
165 macro HAS_PRIVATE(obj, sym) = (%HasOwnProperty(obj, sym)); 163 macro HAS_PRIVATE(obj, sym) = (%HasOwnProperty(obj, sym));
166 macro HAS_DEFINED_PRIVATE(obj, sym) = (!IS_UNDEFINED(obj[sym])); 164 macro HAS_DEFINED_PRIVATE(obj, sym) = (!IS_UNDEFINED(obj[sym]));
167 macro GET_PRIVATE(obj, sym) = (obj[sym]); 165 macro GET_PRIVATE(obj, sym) = (obj[sym]);
168 macro SET_PRIVATE(obj, sym, val) = (obj[sym] = val); 166 macro SET_PRIVATE(obj, sym, val) = (obj[sym] = val);
169 macro DELETE_PRIVATE(obj, sym) = (delete obj[sym]);
170 167
171 # Constants. The compiler constant folds them. 168 # Constants. The compiler constant folds them.
172 define NAN = $NaN; 169 define NAN = $NaN;
173 define INFINITY = (1/0); 170 define INFINITY = (1/0);
174 define UNDEFINED = (void 0); 171 define UNDEFINED = (void 0);
175 172
176 # Macros implemented in Python. 173 # Macros implemented in Python.
177 python macro CHAR_CODE(str) = ord(str[1]); 174 python macro CHAR_CODE(str) = ord(str[1]);
178 175
179 # Constants used on an array to implement the properties of the RegExp object. 176 # Constants used on an array to implement the properties of the RegExp object.
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 define NOT_FOUND = -1; 301 define NOT_FOUND = -1;
305 302
306 # Check whether debug is active. 303 # Check whether debug is active.
307 define DEBUG_IS_ACTIVE = (%_DebugIsActive() != 0); 304 define DEBUG_IS_ACTIVE = (%_DebugIsActive() != 0);
308 macro DEBUG_IS_STEPPING(function) = (%_DebugIsActive() != 0 && %DebugCallbackSup portsStepping(function)); 305 macro DEBUG_IS_STEPPING(function) = (%_DebugIsActive() != 0 && %DebugCallbackSup portsStepping(function));
309 macro DEBUG_PREPARE_STEP_IN_IF_STEPPING(function) = if (DEBUG_IS_STEPPING(functi on)) %DebugPrepareStepInIfStepping(function); 306 macro DEBUG_PREPARE_STEP_IN_IF_STEPPING(function) = if (DEBUG_IS_STEPPING(functi on)) %DebugPrepareStepInIfStepping(function);
310 307
311 # SharedFlag equivalents 308 # SharedFlag equivalents
312 define kNotShared = false; 309 define kNotShared = false;
313 define kShared = true; 310 define kShared = true;
OLDNEW
« no previous file with comments | « src/isolate.cc ('k') | src/messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698