196 |
196 |
|
197 |
197 |
static const int32_t signBit = 0x80000000;
|
198 |
198 |
|
|
199 |
#if OS(SOLARIS64)
|
|
200 |
// https://bugzilla.mozilla.org/show_bug.cgi?id=577056
|
|
201 |
// Memory layout for 64-bit Solaris is different than other 64-bit systems.
|
|
202 |
// http://developers.sun.com/solaris/articles/solaris_memory.html
|
|
203 |
// User space memory may locate on PART-A (0xFFFFFD80.00000000 - 0xFFFF8000.00000000)
|
|
204 |
// and PART-B (0x00008000.00000000 - 0x00000000.04000000).
|
|
205 |
static ALWAYS_INLINE bool isSolaris64StackPointer(JSValue v)
|
|
206 |
{
|
|
207 |
return ((rawValue(v) & 0xFFFF800000000000LL) == 0xFFFF800000000000LL);
|
|
208 |
}
|
|
209 |
#endif
|
|
210 |
|
199 |
211 |
static ALWAYS_INLINE bool isImmediate(JSValue v)
|
200 |
212 |
{
|
|
213 |
#if OS(SOLARIS64)
|
|
214 |
if (isSolaris64StackPointer(v))
|
|
215 |
return false;
|
|
216 |
#endif
|
201 |
217 |
return rawValue(v) & TagMask;
|
202 |
218 |
}
|
203 |
219 |
|
204 |
220 |
static ALWAYS_INLINE bool isNumber(JSValue v)
|
205 |
221 |
{
|
|
222 |
#if OS(SOLARIS64)
|
|
223 |
if (isSolaris64StackPointer(v))
|
|
224 |
return false;
|
|
225 |
#endif
|
206 |
226 |
return rawValue(v) & TagTypeNumber;
|
207 |
227 |
}
|
208 |
228 |
|
209 |
229 |
static ALWAYS_INLINE bool isIntegerNumber(JSValue v)
|
210 |
230 |
{
|
211 |
231 |
#if USE(JSVALUE64)
|
|
232 |
# if OS(SOLARIS64)
|
|
233 |
if (isSolaris64StackPointer(v))
|
|
234 |
return false;
|
|
235 |
# endif
|
212 |
236 |
return (rawValue(v) & TagTypeNumber) == TagTypeNumber;
|
213 |
237 |
#else
|
214 |
238 |
return isNumber(v);
|
... | ... | |
218 |
242 |
#if USE(JSVALUE64)
|
219 |
243 |
static ALWAYS_INLINE bool isDouble(JSValue v)
|
220 |
244 |
{
|
|
245 |
#if OS(SOLARIS64)
|
|
246 |
if (isSolaris64StackPointer(v))
|
|
247 |
return false;
|
|
248 |
#endif
|
221 |
249 |
return isNumber(v) && !isIntegerNumber(v);
|
222 |
250 |
}
|
223 |
251 |
#endif
|
224 |
252 |
|
225 |
253 |
static ALWAYS_INLINE bool isPositiveIntegerNumber(JSValue v)
|
226 |
254 |
{
|
|
255 |
#if OS(SOLARIS64)
|
|
256 |
if (isSolaris64StackPointer(v))
|
|
257 |
return false;
|
|
258 |
#endif
|
227 |
259 |
// A single mask to check for the sign bit and the number tag all at once.
|
228 |
260 |
return (rawValue(v) & (signBit | TagTypeNumber)) == TagTypeNumber;
|
229 |
261 |
}
|
230 |
262 |
|
231 |
263 |
static ALWAYS_INLINE bool isBoolean(JSValue v)
|
232 |
264 |
{
|
|
265 |
#if OS(SOLARIS64)
|
|
266 |
if (isSolaris64StackPointer(v))
|
|
267 |
return false;
|
|
268 |
#endif
|
233 |
269 |
return (rawValue(v) & FullTagTypeMask) == FullTagTypeBool;
|
234 |
270 |
}
|
235 |
271 |
|
236 |
272 |
static ALWAYS_INLINE bool isUndefinedOrNull(JSValue v)
|
237 |
273 |
{
|
|
274 |
#if OS(SOLARIS64)
|
|
275 |
if (isSolaris64StackPointer(v))
|
|
276 |
return false;
|
|
277 |
#endif
|
238 |
278 |
// Undefined and null share the same value, bar the 'undefined' bit in the extended tag.
|
239 |
279 |
return (rawValue(v) & ~ExtendedTagBitUndefined) == FullTagTypeNull;
|
240 |
280 |
}
|
... | ... | |
254 |
294 |
|
255 |
295 |
static ALWAYS_INLINE bool isEitherImmediate(JSValue v1, JSValue v2)
|
256 |
296 |
{
|
|
297 |
#if OS(SOLARIS64)
|
|
298 |
if (isSolaris64StackPointer(v1) && isSolaris64StackPointer(v2))
|
|
299 |
return false;
|
|
300 |
#endif
|
257 |
301 |
return (rawValue(v1) | rawValue(v2)) & TagMask;
|
258 |
302 |
}
|
259 |
303 |
|
... | ... | |
265 |
309 |
static ALWAYS_INLINE bool areBothImmediateIntegerNumbers(JSValue v1, JSValue v2)
|
266 |
310 |
{
|
267 |
311 |
#if USE(JSVALUE64)
|
|
312 |
# if OS(SOLARIS64)
|
|
313 |
if (isSolaris64StackPointer(v1) || isSolaris64StackPointer(v2))
|
|
314 |
return false;
|
|
315 |
# endif
|
268 |
316 |
return (rawValue(v1) & rawValue(v2) & TagTypeNumber) == TagTypeNumber;
|
269 |
317 |
#else
|
270 |
318 |
return rawValue(v1) & rawValue(v2) & TagTypeNumber;
|