OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/bailout-reason.h" | 7 #include "src/bailout-reason.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/field-index.h" | 9 #include "src/field-index.h" |
10 #include "src/hydrogen.h" | 10 #include "src/hydrogen.h" |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 HConstant* js_function_proxy = | 373 HConstant* js_function_proxy = |
374 Add<HConstant>(JS_FUNCTION_PROXY_TYPE); | 374 Add<HConstant>(JS_FUNCTION_PROXY_TYPE); |
375 is_function.If<HCompareNumericAndBranch>(instance_type, js_function, | 375 is_function.If<HCompareNumericAndBranch>(instance_type, js_function, |
376 Token::EQ); | 376 Token::EQ); |
377 is_function.OrIf<HCompareNumericAndBranch>( | 377 is_function.OrIf<HCompareNumericAndBranch>( |
378 instance_type, js_function_proxy, Token::EQ); | 378 instance_type, js_function_proxy, Token::EQ); |
379 is_function.Then(); | 379 is_function.Then(); |
380 { Push(Add<HConstant>(factory->function_string())); } | 380 { Push(Add<HConstant>(factory->function_string())); } |
381 is_function.Else(); | 381 is_function.Else(); |
382 { | 382 { |
383 // Is it an undetectable object? | 383 IfBuilder is_float32x4(this); |
384 IfBuilder is_undetectable(this); | 384 is_float32x4.If<HCompareNumericAndBranch>( |
385 is_undetectable.If<HIsUndetectableAndBranch>(object); | 385 instance_type, Add<HConstant>(FLOAT32X4_TYPE), Token::EQ); |
386 is_undetectable.Then(); | 386 is_float32x4.Then(); |
| 387 { Push(Add<HConstant>(factory->float32x4_string())); } |
| 388 is_float32x4.Else(); |
387 { | 389 { |
388 // typeof an undetectable object is 'undefined'. | 390 // Is it an undetectable object? |
389 Push(undefined_string); | 391 IfBuilder is_undetectable(this); |
390 } | 392 is_undetectable.If<HIsUndetectableAndBranch>(object); |
391 is_undetectable.Else(); | 393 is_undetectable.Then(); |
392 { | 394 { |
393 // For any kind of object not handled above, the spec rule for | 395 // typeof an undetectable object is 'undefined'. |
394 // host objects gives that it is okay to return "object". | 396 Push(undefined_string); |
395 Push(object_string); | 397 } |
| 398 is_undetectable.Else(); |
| 399 { |
| 400 // For any kind of object not handled above, the spec rule for |
| 401 // host objects gives that it is okay to return "object". |
| 402 Push(object_string); |
| 403 } |
396 } | 404 } |
397 } | 405 } |
398 is_function.End(); | 406 is_function.End(); |
399 } | 407 } |
400 is_symbol.End(); | 408 is_symbol.End(); |
401 } | 409 } |
402 is_oddball.End(); | 410 is_oddball.End(); |
403 } | 411 } |
404 is_string.End(); | 412 is_string.End(); |
405 } | 413 } |
(...skipping 1848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2254 return Pop(); | 2262 return Pop(); |
2255 } | 2263 } |
2256 | 2264 |
2257 | 2265 |
2258 Handle<Code> KeyedLoadGenericStub::GenerateCode() { | 2266 Handle<Code> KeyedLoadGenericStub::GenerateCode() { |
2259 return DoGenerateCode(this); | 2267 return DoGenerateCode(this); |
2260 } | 2268 } |
2261 | 2269 |
2262 } // namespace internal | 2270 } // namespace internal |
2263 } // namespace v8 | 2271 } // namespace v8 |
OLD | NEW |