| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 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 2662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2673 __ Push(object); | 2673 __ Push(object); |
| 2674 CallRuntime(Runtime::kGetPropertyNamesFast, 1, instr); | 2674 CallRuntime(Runtime::kGetPropertyNamesFast, 1, instr); |
| 2675 | 2675 |
| 2676 __ Ldr(x1, FieldMemOperand(object, HeapObject::kMapOffset)); | 2676 __ Ldr(x1, FieldMemOperand(object, HeapObject::kMapOffset)); |
| 2677 __ JumpIfNotRoot(x1, Heap::kMetaMapRootIndex, &deopt); | 2677 __ JumpIfNotRoot(x1, Heap::kMetaMapRootIndex, &deopt); |
| 2678 | 2678 |
| 2679 __ Bind(&use_cache); | 2679 __ Bind(&use_cache); |
| 2680 } | 2680 } |
| 2681 | 2681 |
| 2682 | 2682 |
| 2683 void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) { |
| 2684 Register input = ToRegister(instr->value()); |
| 2685 Register result = ToRegister(instr->result()); |
| 2686 |
| 2687 __ AssertString(input); |
| 2688 |
| 2689 // Assert that we can use a W register load to get the hash. |
| 2690 ASSERT((String::kHashShift + String::kArrayIndexValueBits) < kWRegSize); |
| 2691 __ Ldr(result.W(), FieldMemOperand(input, String::kHashFieldOffset)); |
| 2692 __ IndexFromHash(result, result); |
| 2693 } |
| 2694 |
| 2695 |
| 2683 void LCodeGen::DoGlobalObject(LGlobalObject* instr) { | 2696 void LCodeGen::DoGlobalObject(LGlobalObject* instr) { |
| 2684 Register result = ToRegister(instr->result()); | 2697 Register result = ToRegister(instr->result()); |
| 2685 __ Ldr(result, GlobalObjectMemOperand()); | 2698 __ Ldr(result, GlobalObjectMemOperand()); |
| 2686 } | 2699 } |
| 2687 | 2700 |
| 2688 | 2701 |
| 2689 void LCodeGen::DoGlobalReceiver(LGlobalReceiver* instr) { | 2702 void LCodeGen::DoGlobalReceiver(LGlobalReceiver* instr) { |
| 2690 Register global = ToRegister(instr->global_object()); | 2703 Register global = ToRegister(instr->global_object()); |
| 2691 Register result = ToRegister(instr->result()); | 2704 Register result = ToRegister(instr->result()); |
| 2692 __ Ldr(result, FieldMemOperand(global, GlobalObject::kGlobalReceiverOffset)); | 2705 __ Ldr(result, FieldMemOperand(global, GlobalObject::kGlobalReceiverOffset)); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 2707 __ B(chunk_->GetAssemblyLabel(LookupDestination(block))); | 2720 __ B(chunk_->GetAssemblyLabel(LookupDestination(block))); |
| 2708 } | 2721 } |
| 2709 } | 2722 } |
| 2710 | 2723 |
| 2711 | 2724 |
| 2712 void LCodeGen::DoGoto(LGoto* instr) { | 2725 void LCodeGen::DoGoto(LGoto* instr) { |
| 2713 EmitGoto(instr->block_id()); | 2726 EmitGoto(instr->block_id()); |
| 2714 } | 2727 } |
| 2715 | 2728 |
| 2716 | 2729 |
| 2730 void LCodeGen::DoHasCachedArrayIndexAndBranch( |
| 2731 LHasCachedArrayIndexAndBranch* instr) { |
| 2732 Register input = ToRegister(instr->value()); |
| 2733 Register temp = ToRegister32(instr->temp()); |
| 2734 |
| 2735 // Assert that the cache status bits fit in a W register. |
| 2736 ASSERT(is_uint32(String::kContainsCachedArrayIndexMask)); |
| 2737 __ Ldr(temp, FieldMemOperand(input, String::kHashFieldOffset)); |
| 2738 __ Tst(temp, String::kContainsCachedArrayIndexMask); |
| 2739 EmitBranch(instr, eq); |
| 2740 } |
| 2741 |
| 2742 |
| 2717 // HHasInstanceTypeAndBranch instruction is built with an interval of type | 2743 // HHasInstanceTypeAndBranch instruction is built with an interval of type |
| 2718 // to test but is only used in very restricted ways. The only possible kinds | 2744 // to test but is only used in very restricted ways. The only possible kinds |
| 2719 // of intervals are: | 2745 // of intervals are: |
| 2720 // - [ FIRST_TYPE, instr->to() ] | 2746 // - [ FIRST_TYPE, instr->to() ] |
| 2721 // - [ instr->form(), LAST_TYPE ] | 2747 // - [ instr->form(), LAST_TYPE ] |
| 2722 // - instr->from() == instr->to() | 2748 // - instr->from() == instr->to() |
| 2723 // | 2749 // |
| 2724 // These kinds of intervals can be check with only one compare instruction | 2750 // These kinds of intervals can be check with only one compare instruction |
| 2725 // providing the correct value and test condition are used. | 2751 // providing the correct value and test condition are used. |
| 2726 // | 2752 // |
| (...skipping 2716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5443 __ Bind(&out_of_object); | 5469 __ Bind(&out_of_object); |
| 5444 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 5470 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
| 5445 // Index is equal to negated out of object property index plus 1. | 5471 // Index is equal to negated out of object property index plus 1. |
| 5446 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); | 5472 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); |
| 5447 __ Ldr(result, FieldMemOperand(result, | 5473 __ Ldr(result, FieldMemOperand(result, |
| 5448 FixedArray::kHeaderSize - kPointerSize)); | 5474 FixedArray::kHeaderSize - kPointerSize)); |
| 5449 __ Bind(&done); | 5475 __ Bind(&done); |
| 5450 } | 5476 } |
| 5451 | 5477 |
| 5452 } } // namespace v8::internal | 5478 } } // namespace v8::internal |
| OLD | NEW |