macro IS_NULL_OR_UNDEFINED(arg) = (arg == null);
macro IS_UNDEFINED(arg) = (arg === (void 0));
macro IS_NUMBER(arg) = (typeof(arg) === 'number');
-macro IsFloat32x4(arg) = (typeof(arg) === 'float32x4');
-macro IsFloat64x2(arg) = (typeof(arg) === 'float64x2');
-macro IsInt32x4(arg) = (typeof(arg) === 'int32x4');
macro IS_STRING(arg) = (typeof(arg) === 'string');
macro IS_BOOLEAN(arg) = (typeof(arg) === 'boolean');
macro IS_SYMBOL(arg) = (typeof(arg) === 'symbol');
macro IS_WEAKMAP(arg) = (%_ClassOf(arg) === 'WeakMap');
macro IS_WEAKSET(arg) = (%_ClassOf(arg) === 'WeakSet');
macro IS_DATE(arg) = (%_ClassOf(arg) === 'Date');
+macro IsFloat32x4(arg) = (%_ClassOf(arg) === 'float32x4');
+macro IsFloat64x2(arg) = (%_ClassOf(arg) === 'float64x2');
+macro IsInt32x4(arg) = (%_ClassOf(arg) === 'int32x4');
macro IS_NUMBER_WRAPPER(arg) = (%_ClassOf(arg) === 'Number');
-macro IsFloat32x4Wrapper(arg) = (%_ClassOf(arg) === 'float32x4');
-macro IsFloat64x2Wrapper(arg) = (%_ClassOf(arg) === 'float64x2');
-macro IsInt32x4Wrapper(arg) = (%_ClassOf(arg) === 'int32x4');
macro IS_STRING_WRAPPER(arg) = (%_ClassOf(arg) === 'String');
macro IS_SYMBOL_WRAPPER(arg) = (%_ClassOf(arg) === 'Symbol');
macro IS_BOOLEAN_WRAPPER(arg) = (%_ClassOf(arg) === 'Boolean');
macro IS_ARRAYBUFFER(arg) = (%_ClassOf(arg) === 'ArrayBuffer');
macro IS_DATAVIEW(arg) = (%_ClassOf(arg) === 'DataView');
macro IS_GENERATOR(arg) = (%_ClassOf(arg) === 'Generator');
+macro IS_SET_ITERATOR(arg) = (%_ClassOf(arg) === 'Set Iterator');
+macro IS_MAP_ITERATOR(arg) = (%_ClassOf(arg) === 'Map Iterator');
macro IS_UNDETECTABLE(arg) = (%_IsUndetectableObject(arg));
macro FLOOR(arg) = $floor(arg);
macro TO_NUMBER_INLINE(arg) = (IS_NUMBER(%IS_VAR(arg)) ? arg : NonNumberToNumber(arg));
macro TO_OBJECT_INLINE(arg) = (IS_SPEC_OBJECT(%IS_VAR(arg)) ? arg : ToObject(arg));
macro JSON_NUMBER_TO_STRING(arg) = ((%_IsSmi(%IS_VAR(arg)) || arg - arg == 0) ? %_NumberToString(arg) : "null");
-macro ToFloat32x4(arg) = (IsFloat32x4Wrapper(%IS_VAR(arg))) ? %_ValueOf(arg) : arg;
-macro ToFloat64x2(arg) = (IsFloat64x2Wrapper(%IS_VAR(arg))) ? %_ValueOf(arg) : arg;
-macro ToInt32x4(arg) = (IsInt32x4Wrapper(%IS_VAR(arg))) ? %_ValueOf(arg) : arg;
+macro HAS_OWN_PROPERTY(obj, index) = (%_CallFunction(obj, index, ObjectHasOwnProperty));
+macro SHOULD_CREATE_WRAPPER(functionName, receiver) = (!IS_SPEC_OBJECT(receiver) && %IsSloppyModeFunction(functionName));
# Private names.
-macro GLOBAL_PRIVATE(name) = (%CreateGlobalPrivateSymbol(name));
-macro NEW_PRIVATE(name) = (%CreatePrivateSymbol(name));
+# GET_PRIVATE should only be used if the property is known to exists on obj
+# itself (it should really use %GetOwnProperty, but that would be way slower).
+macro GLOBAL_PRIVATE(name) = (%CreateGlobalPrivateOwnSymbol(name));
+macro NEW_PRIVATE_OWN(name) = (%CreatePrivateOwnSymbol(name));
macro IS_PRIVATE(sym) = (%SymbolIsPrivate(sym));
-macro HAS_PRIVATE(obj, sym) = (sym in obj);
+macro HAS_PRIVATE(obj, sym) = (%HasOwnProperty(obj, sym));
+macro HAS_DEFINED_PRIVATE(obj, sym) = (!IS_UNDEFINED(obj[sym]));
macro GET_PRIVATE(obj, sym) = (obj[sym]);
macro SET_PRIVATE(obj, sym, val) = (obj[sym] = val);
macro DELETE_PRIVATE(obj, sym) = (delete obj[sym]);
macro OVERRIDE_CAPTURE(override, index) = ((override)[(index)]);
# PropertyDescriptor return value indices - must match
-# PropertyDescriptorIndices in runtime.cc.
+# PropertyDescriptorIndices in runtime-object.cc.
const IS_ACCESSOR_INDEX = 0;
const VALUE_INDEX = 1;
const GETTER_INDEX = 2;
const ITERATOR_KIND_VALUES = 2;
const ITERATOR_KIND_ENTRIES = 3;
-# For simd128.js
-macro CheckFloat32x4(arg) = if (typeof(arg) !== 'float32x4') ThrowFloat32x4TypeError();
-macro CheckFloat64x2(arg) = if (typeof(arg) !== 'float64x2') ThrowFloat64x2TypeError();
-macro CheckInt32x4(arg) = if (typeof(arg) !== 'int32x4') ThrowInt32x4TypeError();
+# Check whether debug is active.
+const DEBUG_IS_ACTIVE = (%_DebugIsActive() != 0);