OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved.7 | 1 // Copyright 2012 the V8 project authors. All rights reserved.7 |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 5530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5541 final_branch_condition = eq; | 5541 final_branch_condition = eq; |
5542 | 5542 |
5543 } else if (String::Equals(type_name, factory->boolean_string())) { | 5543 } else if (String::Equals(type_name, factory->boolean_string())) { |
5544 __ LoadRoot(at, Heap::kTrueValueRootIndex); | 5544 __ LoadRoot(at, Heap::kTrueValueRootIndex); |
5545 __ Branch(USE_DELAY_SLOT, true_label, eq, at, Operand(input)); | 5545 __ Branch(USE_DELAY_SLOT, true_label, eq, at, Operand(input)); |
5546 __ LoadRoot(at, Heap::kFalseValueRootIndex); | 5546 __ LoadRoot(at, Heap::kFalseValueRootIndex); |
5547 *cmp1 = at; | 5547 *cmp1 = at; |
5548 *cmp2 = Operand(input); | 5548 *cmp2 = Operand(input); |
5549 final_branch_condition = eq; | 5549 final_branch_condition = eq; |
5550 | 5550 |
5551 } else if (FLAG_harmony_typeof && | |
5552 String::Equals(type_name, factory->null_string())) { | |
5553 __ LoadRoot(at, Heap::kNullValueRootIndex); | |
5554 *cmp1 = at; | |
5555 *cmp2 = Operand(input); | |
5556 final_branch_condition = eq; | |
5557 | |
5558 } else if (String::Equals(type_name, factory->undefined_string())) { | 5551 } else if (String::Equals(type_name, factory->undefined_string())) { |
5559 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); | 5552 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); |
5560 __ Branch(USE_DELAY_SLOT, true_label, eq, at, Operand(input)); | 5553 __ Branch(USE_DELAY_SLOT, true_label, eq, at, Operand(input)); |
5561 // The first instruction of JumpIfSmi is an And - it is safe in the delay | 5554 // The first instruction of JumpIfSmi is an And - it is safe in the delay |
5562 // slot. | 5555 // slot. |
5563 __ JumpIfSmi(input, false_label); | 5556 __ JumpIfSmi(input, false_label); |
5564 // Check for undetectable objects => true. | 5557 // Check for undetectable objects => true. |
5565 __ lw(input, FieldMemOperand(input, HeapObject::kMapOffset)); | 5558 __ lw(input, FieldMemOperand(input, HeapObject::kMapOffset)); |
5566 __ lbu(at, FieldMemOperand(input, Map::kBitFieldOffset)); | 5559 __ lbu(at, FieldMemOperand(input, Map::kBitFieldOffset)); |
5567 __ And(at, at, 1 << Map::kIsUndetectable); | 5560 __ And(at, at, 1 << Map::kIsUndetectable); |
5568 *cmp1 = at; | 5561 *cmp1 = at; |
5569 *cmp2 = Operand(zero_reg); | 5562 *cmp2 = Operand(zero_reg); |
5570 final_branch_condition = ne; | 5563 final_branch_condition = ne; |
5571 | 5564 |
5572 } else if (String::Equals(type_name, factory->function_string())) { | 5565 } else if (String::Equals(type_name, factory->function_string())) { |
5573 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); | 5566 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); |
5574 __ JumpIfSmi(input, false_label); | 5567 __ JumpIfSmi(input, false_label); |
5575 __ GetObjectType(input, scratch, input); | 5568 __ GetObjectType(input, scratch, input); |
5576 __ Branch(true_label, eq, input, Operand(JS_FUNCTION_TYPE)); | 5569 __ Branch(true_label, eq, input, Operand(JS_FUNCTION_TYPE)); |
5577 *cmp1 = input; | 5570 *cmp1 = input; |
5578 *cmp2 = Operand(JS_FUNCTION_PROXY_TYPE); | 5571 *cmp2 = Operand(JS_FUNCTION_PROXY_TYPE); |
5579 final_branch_condition = eq; | 5572 final_branch_condition = eq; |
5580 | 5573 |
5581 } else if (String::Equals(type_name, factory->object_string())) { | 5574 } else if (String::Equals(type_name, factory->object_string())) { |
5582 __ JumpIfSmi(input, false_label); | 5575 __ JumpIfSmi(input, false_label); |
5583 if (!FLAG_harmony_typeof) { | 5576 __ LoadRoot(at, Heap::kNullValueRootIndex); |
5584 __ LoadRoot(at, Heap::kNullValueRootIndex); | 5577 __ Branch(USE_DELAY_SLOT, true_label, eq, at, Operand(input)); |
5585 __ Branch(USE_DELAY_SLOT, true_label, eq, at, Operand(input)); | |
5586 } | |
5587 Register map = input; | 5578 Register map = input; |
5588 __ GetObjectType(input, map, scratch); | 5579 __ GetObjectType(input, map, scratch); |
5589 __ Branch(false_label, | 5580 __ Branch(false_label, |
5590 lt, scratch, Operand(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); | 5581 lt, scratch, Operand(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); |
5591 __ Branch(USE_DELAY_SLOT, false_label, | 5582 __ Branch(USE_DELAY_SLOT, false_label, |
5592 gt, scratch, Operand(LAST_NONCALLABLE_SPEC_OBJECT_TYPE)); | 5583 gt, scratch, Operand(LAST_NONCALLABLE_SPEC_OBJECT_TYPE)); |
5593 // map is still valid, so the BitField can be loaded in delay slot. | 5584 // map is still valid, so the BitField can be loaded in delay slot. |
5594 // Check for undetectable objects => false. | 5585 // Check for undetectable objects => false. |
5595 __ lbu(at, FieldMemOperand(map, Map::kBitFieldOffset)); | 5586 __ lbu(at, FieldMemOperand(map, Map::kBitFieldOffset)); |
5596 __ And(at, at, 1 << Map::kIsUndetectable); | 5587 __ And(at, at, 1 << Map::kIsUndetectable); |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5912 __ li(at, scope_info); | 5903 __ li(at, scope_info); |
5913 __ Push(at, ToRegister(instr->function())); | 5904 __ Push(at, ToRegister(instr->function())); |
5914 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5905 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5915 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5906 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5916 } | 5907 } |
5917 | 5908 |
5918 | 5909 |
5919 #undef __ | 5910 #undef __ |
5920 | 5911 |
5921 } } // namespace v8::internal | 5912 } } // namespace v8::internal |
OLD | NEW |