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/code-stubs.h" | 7 #include "src/code-stubs.h" |
8 #include "src/hydrogen-osr.h" | 8 #include "src/hydrogen-osr.h" |
9 #include "src/mips64/lithium-codegen-mips64.h" | 9 #include "src/mips64/lithium-codegen-mips64.h" |
10 #include "src/mips64/lithium-gap-resolver-mips64.h" | 10 #include "src/mips64/lithium-gap-resolver-mips64.h" |
(...skipping 5561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5572 final_branch_condition = eq; | 5572 final_branch_condition = eq; |
5573 | 5573 |
5574 } else if (String::Equals(type_name, factory->boolean_string())) { | 5574 } else if (String::Equals(type_name, factory->boolean_string())) { |
5575 __ LoadRoot(at, Heap::kTrueValueRootIndex); | 5575 __ LoadRoot(at, Heap::kTrueValueRootIndex); |
5576 __ Branch(USE_DELAY_SLOT, true_label, eq, at, Operand(input)); | 5576 __ Branch(USE_DELAY_SLOT, true_label, eq, at, Operand(input)); |
5577 __ LoadRoot(at, Heap::kFalseValueRootIndex); | 5577 __ LoadRoot(at, Heap::kFalseValueRootIndex); |
5578 *cmp1 = at; | 5578 *cmp1 = at; |
5579 *cmp2 = Operand(input); | 5579 *cmp2 = Operand(input); |
5580 final_branch_condition = eq; | 5580 final_branch_condition = eq; |
5581 | 5581 |
5582 } else if (FLAG_harmony_typeof && | |
5583 String::Equals(type_name, factory->null_string())) { | |
5584 __ LoadRoot(at, Heap::kNullValueRootIndex); | |
5585 *cmp1 = at; | |
5586 *cmp2 = Operand(input); | |
5587 final_branch_condition = eq; | |
5588 | |
5589 } else if (String::Equals(type_name, factory->undefined_string())) { | 5582 } else if (String::Equals(type_name, factory->undefined_string())) { |
5590 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); | 5583 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); |
5591 __ Branch(USE_DELAY_SLOT, true_label, eq, at, Operand(input)); | 5584 __ Branch(USE_DELAY_SLOT, true_label, eq, at, Operand(input)); |
5592 // The first instruction of JumpIfSmi is an And - it is safe in the delay | 5585 // The first instruction of JumpIfSmi is an And - it is safe in the delay |
5593 // slot. | 5586 // slot. |
5594 __ JumpIfSmi(input, false_label); | 5587 __ JumpIfSmi(input, false_label); |
5595 // Check for undetectable objects => true. | 5588 // Check for undetectable objects => true. |
5596 __ ld(input, FieldMemOperand(input, HeapObject::kMapOffset)); | 5589 __ ld(input, FieldMemOperand(input, HeapObject::kMapOffset)); |
5597 __ lbu(at, FieldMemOperand(input, Map::kBitFieldOffset)); | 5590 __ lbu(at, FieldMemOperand(input, Map::kBitFieldOffset)); |
5598 __ And(at, at, 1 << Map::kIsUndetectable); | 5591 __ And(at, at, 1 << Map::kIsUndetectable); |
5599 *cmp1 = at; | 5592 *cmp1 = at; |
5600 *cmp2 = Operand(zero_reg); | 5593 *cmp2 = Operand(zero_reg); |
5601 final_branch_condition = ne; | 5594 final_branch_condition = ne; |
5602 | 5595 |
5603 } else if (String::Equals(type_name, factory->function_string())) { | 5596 } else if (String::Equals(type_name, factory->function_string())) { |
5604 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); | 5597 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); |
5605 __ JumpIfSmi(input, false_label); | 5598 __ JumpIfSmi(input, false_label); |
5606 __ GetObjectType(input, scratch, input); | 5599 __ GetObjectType(input, scratch, input); |
5607 __ Branch(true_label, eq, input, Operand(JS_FUNCTION_TYPE)); | 5600 __ Branch(true_label, eq, input, Operand(JS_FUNCTION_TYPE)); |
5608 *cmp1 = input; | 5601 *cmp1 = input; |
5609 *cmp2 = Operand(JS_FUNCTION_PROXY_TYPE); | 5602 *cmp2 = Operand(JS_FUNCTION_PROXY_TYPE); |
5610 final_branch_condition = eq; | 5603 final_branch_condition = eq; |
5611 | 5604 |
5612 } else if (String::Equals(type_name, factory->object_string())) { | 5605 } else if (String::Equals(type_name, factory->object_string())) { |
5613 __ JumpIfSmi(input, false_label); | 5606 __ JumpIfSmi(input, false_label); |
5614 if (!FLAG_harmony_typeof) { | 5607 __ LoadRoot(at, Heap::kNullValueRootIndex); |
5615 __ LoadRoot(at, Heap::kNullValueRootIndex); | 5608 __ Branch(USE_DELAY_SLOT, true_label, eq, at, Operand(input)); |
5616 __ Branch(USE_DELAY_SLOT, true_label, eq, at, Operand(input)); | |
5617 } | |
5618 Register map = input; | 5609 Register map = input; |
5619 __ GetObjectType(input, map, scratch); | 5610 __ GetObjectType(input, map, scratch); |
5620 __ Branch(false_label, | 5611 __ Branch(false_label, |
5621 lt, scratch, Operand(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); | 5612 lt, scratch, Operand(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); |
5622 __ Branch(USE_DELAY_SLOT, false_label, | 5613 __ Branch(USE_DELAY_SLOT, false_label, |
5623 gt, scratch, Operand(LAST_NONCALLABLE_SPEC_OBJECT_TYPE)); | 5614 gt, scratch, Operand(LAST_NONCALLABLE_SPEC_OBJECT_TYPE)); |
5624 // map is still valid, so the BitField can be loaded in delay slot. | 5615 // map is still valid, so the BitField can be loaded in delay slot. |
5625 // Check for undetectable objects => false. | 5616 // Check for undetectable objects => false. |
5626 __ lbu(at, FieldMemOperand(map, Map::kBitFieldOffset)); | 5617 __ lbu(at, FieldMemOperand(map, Map::kBitFieldOffset)); |
5627 __ And(at, at, 1 << Map::kIsUndetectable); | 5618 __ And(at, at, 1 << Map::kIsUndetectable); |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5941 __ li(at, scope_info); | 5932 __ li(at, scope_info); |
5942 __ Push(at, ToRegister(instr->function())); | 5933 __ Push(at, ToRegister(instr->function())); |
5943 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5934 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5944 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5935 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5945 } | 5936 } |
5946 | 5937 |
5947 | 5938 |
5948 #undef __ | 5939 #undef __ |
5949 | 5940 |
5950 } } // namespace v8::internal | 5941 } } // namespace v8::internal |
OLD | NEW |