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

Side by Side Diff: src/macros.py

Issue 1316933002: [es6] Initial steps towards a correct implementation of IsCallable. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase again. Created 5 years, 3 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/json.js ('k') | src/mips/lithium-codegen-mips.cc » ('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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 121
122 # Macro for ECMAScript 5 queries of the type: 122 # Macro for ECMAScript 5 queries of the type:
123 # "Type(O) is object." 123 # "Type(O) is object."
124 # This is the same as being either a function or an object in V8 terminology 124 # This is the same as being either a function or an object in V8 terminology
125 # (including proxies). 125 # (including proxies).
126 # In addition, an undetectable object is also included by this. 126 # In addition, an undetectable object is also included by this.
127 macro IS_SPEC_OBJECT(arg) = (%_IsSpecObject(arg)); 127 macro IS_SPEC_OBJECT(arg) = (%_IsSpecObject(arg));
128 128
129 # Macro for ECMAScript 5 queries of the type: 129 # Macro for ECMAScript 5 queries of the type:
130 # "IsCallable(O)" 130 # "IsCallable(O)"
131 # We assume here that this is the same as being either a function or a function 131 macro IS_CALLABLE(arg) = (typeof(arg) === 'function');
132 # proxy. That ignores host objects with [[Call]] methods, but in most situations
133 # we cannot handle those anyway.
134 macro IS_SPEC_FUNCTION(arg) = (%_ClassOf(arg) === 'Function');
135 132
136 # Macro for ES6 CheckObjectCoercible 133 # Macro for ES6 CheckObjectCoercible
137 # Will throw a TypeError of the form "[functionName] called on null or undefined ". 134 # Will throw a TypeError of the form "[functionName] called on null or undefined ".
138 macro CHECK_OBJECT_COERCIBLE(arg, functionName) = if (IS_NULL(%IS_VAR(arg)) || I S_UNDEFINED(arg)) throw MakeTypeError(kCalledOnNullOrUndefined, functionName); 135 macro CHECK_OBJECT_COERCIBLE(arg, functionName) = if (IS_NULL(%IS_VAR(arg)) || I S_UNDEFINED(arg)) throw MakeTypeError(kCalledOnNullOrUndefined, functionName);
139 136
140 # Indices in bound function info retrieved by %BoundFunctionGetBindings(...). 137 # Indices in bound function info retrieved by %BoundFunctionGetBindings(...).
141 define kBoundFunctionIndex = 0; 138 define kBoundFunctionIndex = 0;
142 define kBoundThisIndex = 1; 139 define kBoundThisIndex = 1;
143 define kBoundArgumentsStartIndex = 2; 140 define kBoundArgumentsStartIndex = 2;
144 141
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 define NOT_FOUND = -1; 302 define NOT_FOUND = -1;
306 303
307 # Check whether debug is active. 304 # Check whether debug is active.
308 define DEBUG_IS_ACTIVE = (%_DebugIsActive() != 0); 305 define DEBUG_IS_ACTIVE = (%_DebugIsActive() != 0);
309 macro DEBUG_IS_STEPPING(function) = (%_DebugIsActive() != 0 && %DebugCallbackSup portsStepping(function)); 306 macro DEBUG_IS_STEPPING(function) = (%_DebugIsActive() != 0 && %DebugCallbackSup portsStepping(function));
310 macro DEBUG_PREPARE_STEP_IN_IF_STEPPING(function) = if (DEBUG_IS_STEPPING(functi on)) %DebugPrepareStepInIfStepping(function); 307 macro DEBUG_PREPARE_STEP_IN_IF_STEPPING(function) = if (DEBUG_IS_STEPPING(functi on)) %DebugPrepareStepInIfStepping(function);
311 308
312 # SharedFlag equivalents 309 # SharedFlag equivalents
313 define kNotShared = false; 310 define kNotShared = false;
314 define kShared = true; 311 define kShared = true;
OLDNEW
« no previous file with comments | « src/json.js ('k') | src/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698