| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 #if V8_TARGET_ARCH_X64 | 7 #if V8_TARGET_ARCH_X64 |
| 8 | 8 |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/hydrogen-osr.h" | 10 #include "src/hydrogen-osr.h" |
| (...skipping 5483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5494 __ JumpIfSmi(input, false_label, false_distance); | 5494 __ JumpIfSmi(input, false_label, false_distance); |
| 5495 __ CmpObjectType(input, SYMBOL_TYPE, input); | 5495 __ CmpObjectType(input, SYMBOL_TYPE, input); |
| 5496 final_branch_condition = equal; | 5496 final_branch_condition = equal; |
| 5497 | 5497 |
| 5498 } else if (String::Equals(type_name, factory->boolean_string())) { | 5498 } else if (String::Equals(type_name, factory->boolean_string())) { |
| 5499 __ CompareRoot(input, Heap::kTrueValueRootIndex); | 5499 __ CompareRoot(input, Heap::kTrueValueRootIndex); |
| 5500 __ j(equal, true_label, true_distance); | 5500 __ j(equal, true_label, true_distance); |
| 5501 __ CompareRoot(input, Heap::kFalseValueRootIndex); | 5501 __ CompareRoot(input, Heap::kFalseValueRootIndex); |
| 5502 final_branch_condition = equal; | 5502 final_branch_condition = equal; |
| 5503 | 5503 |
| 5504 } else if (FLAG_harmony_typeof && | |
| 5505 String::Equals(type_name, factory->null_string())) { | |
| 5506 __ CompareRoot(input, Heap::kNullValueRootIndex); | |
| 5507 final_branch_condition = equal; | |
| 5508 | |
| 5509 } else if (String::Equals(type_name, factory->undefined_string())) { | 5504 } else if (String::Equals(type_name, factory->undefined_string())) { |
| 5510 __ CompareRoot(input, Heap::kUndefinedValueRootIndex); | 5505 __ CompareRoot(input, Heap::kUndefinedValueRootIndex); |
| 5511 __ j(equal, true_label, true_distance); | 5506 __ j(equal, true_label, true_distance); |
| 5512 __ JumpIfSmi(input, false_label, false_distance); | 5507 __ JumpIfSmi(input, false_label, false_distance); |
| 5513 // Check for undetectable objects => true. | 5508 // Check for undetectable objects => true. |
| 5514 __ movp(input, FieldOperand(input, HeapObject::kMapOffset)); | 5509 __ movp(input, FieldOperand(input, HeapObject::kMapOffset)); |
| 5515 __ testb(FieldOperand(input, Map::kBitFieldOffset), | 5510 __ testb(FieldOperand(input, Map::kBitFieldOffset), |
| 5516 Immediate(1 << Map::kIsUndetectable)); | 5511 Immediate(1 << Map::kIsUndetectable)); |
| 5517 final_branch_condition = not_zero; | 5512 final_branch_condition = not_zero; |
| 5518 | 5513 |
| 5519 } else if (String::Equals(type_name, factory->function_string())) { | 5514 } else if (String::Equals(type_name, factory->function_string())) { |
| 5520 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); | 5515 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); |
| 5521 __ JumpIfSmi(input, false_label, false_distance); | 5516 __ JumpIfSmi(input, false_label, false_distance); |
| 5522 __ CmpObjectType(input, JS_FUNCTION_TYPE, input); | 5517 __ CmpObjectType(input, JS_FUNCTION_TYPE, input); |
| 5523 __ j(equal, true_label, true_distance); | 5518 __ j(equal, true_label, true_distance); |
| 5524 __ CmpInstanceType(input, JS_FUNCTION_PROXY_TYPE); | 5519 __ CmpInstanceType(input, JS_FUNCTION_PROXY_TYPE); |
| 5525 final_branch_condition = equal; | 5520 final_branch_condition = equal; |
| 5526 | 5521 |
| 5527 } else if (String::Equals(type_name, factory->object_string())) { | 5522 } else if (String::Equals(type_name, factory->object_string())) { |
| 5528 __ JumpIfSmi(input, false_label, false_distance); | 5523 __ JumpIfSmi(input, false_label, false_distance); |
| 5529 if (!FLAG_harmony_typeof) { | 5524 __ CompareRoot(input, Heap::kNullValueRootIndex); |
| 5530 __ CompareRoot(input, Heap::kNullValueRootIndex); | 5525 __ j(equal, true_label, true_distance); |
| 5531 __ j(equal, true_label, true_distance); | |
| 5532 } | |
| 5533 __ CmpObjectType(input, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, input); | 5526 __ CmpObjectType(input, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, input); |
| 5534 __ j(below, false_label, false_distance); | 5527 __ j(below, false_label, false_distance); |
| 5535 __ CmpInstanceType(input, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); | 5528 __ CmpInstanceType(input, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); |
| 5536 __ j(above, false_label, false_distance); | 5529 __ j(above, false_label, false_distance); |
| 5537 // Check for undetectable objects => false. | 5530 // Check for undetectable objects => false. |
| 5538 __ testb(FieldOperand(input, Map::kBitFieldOffset), | 5531 __ testb(FieldOperand(input, Map::kBitFieldOffset), |
| 5539 Immediate(1 << Map::kIsUndetectable)); | 5532 Immediate(1 << Map::kIsUndetectable)); |
| 5540 final_branch_condition = zero; | 5533 final_branch_condition = zero; |
| 5541 | 5534 |
| 5542 } else { | 5535 } else { |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5842 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5835 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 5843 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5836 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5844 } | 5837 } |
| 5845 | 5838 |
| 5846 | 5839 |
| 5847 #undef __ | 5840 #undef __ |
| 5848 | 5841 |
| 5849 } } // namespace v8::internal | 5842 } } // namespace v8::internal |
| 5850 | 5843 |
| 5851 #endif // V8_TARGET_ARCH_X64 | 5844 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |