| 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 #if V8_TARGET_ARCH_X87 | 5 #if V8_TARGET_ARCH_X87 |
| 6 | 6 |
| 7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
| 8 #include "src/base/division-by-constant.h" | 8 #include "src/base/division-by-constant.h" |
| 9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 } | 109 } |
| 110 | 110 |
| 111 | 111 |
| 112 void MacroAssembler::CompareRoot(const Operand& with, | 112 void MacroAssembler::CompareRoot(const Operand& with, |
| 113 Heap::RootListIndex index) { | 113 Heap::RootListIndex index) { |
| 114 DCHECK(isolate()->heap()->RootCanBeTreatedAsConstant(index)); | 114 DCHECK(isolate()->heap()->RootCanBeTreatedAsConstant(index)); |
| 115 cmp(with, isolate()->heap()->root_handle(index)); | 115 cmp(with, isolate()->heap()->root_handle(index)); |
| 116 } | 116 } |
| 117 | 117 |
| 118 | 118 |
| 119 void MacroAssembler::PushRoot(Heap::RootListIndex index) { |
| 120 DCHECK(isolate()->heap()->RootCanBeTreatedAsConstant(index)); |
| 121 Push(isolate()->heap()->root_handle(index)); |
| 122 } |
| 123 |
| 124 |
| 119 void MacroAssembler::InNewSpace( | 125 void MacroAssembler::InNewSpace( |
| 120 Register object, | 126 Register object, |
| 121 Register scratch, | 127 Register scratch, |
| 122 Condition cc, | 128 Condition cc, |
| 123 Label* condition_met, | 129 Label* condition_met, |
| 124 Label::Distance condition_met_distance) { | 130 Label::Distance condition_met_distance) { |
| 125 DCHECK(cc == equal || cc == not_equal); | 131 DCHECK(cc == equal || cc == not_equal); |
| 126 if (scratch.is(object)) { | 132 if (scratch.is(object)) { |
| 127 and_(scratch, Immediate(~Page::kPageAlignmentMask)); | 133 and_(scratch, Immediate(~Page::kPageAlignmentMask)); |
| 128 } else { | 134 } else { |
| (...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 769 Check(not_equal, kOperandIsASmiAndNotAName); | 775 Check(not_equal, kOperandIsASmiAndNotAName); |
| 770 push(object); | 776 push(object); |
| 771 mov(object, FieldOperand(object, HeapObject::kMapOffset)); | 777 mov(object, FieldOperand(object, HeapObject::kMapOffset)); |
| 772 CmpInstanceType(object, LAST_NAME_TYPE); | 778 CmpInstanceType(object, LAST_NAME_TYPE); |
| 773 pop(object); | 779 pop(object); |
| 774 Check(below_equal, kOperandIsNotAName); | 780 Check(below_equal, kOperandIsNotAName); |
| 775 } | 781 } |
| 776 } | 782 } |
| 777 | 783 |
| 778 | 784 |
| 785 void MacroAssembler::AssertFunction(Register object) { |
| 786 if (emit_debug_code()) { |
| 787 test(object, Immediate(kSmiTagMask)); |
| 788 Check(not_equal, kOperandIsASmiAndNotAFunction); |
| 789 Push(object); |
| 790 CmpObjectType(object, JS_FUNCTION_TYPE, object); |
| 791 Pop(object); |
| 792 Check(equal, kOperandIsNotAFunction); |
| 793 } |
| 794 } |
| 795 |
| 796 |
| 779 void MacroAssembler::AssertUndefinedOrAllocationSite(Register object) { | 797 void MacroAssembler::AssertUndefinedOrAllocationSite(Register object) { |
| 780 if (emit_debug_code()) { | 798 if (emit_debug_code()) { |
| 781 Label done_checking; | 799 Label done_checking; |
| 782 AssertNotSmi(object); | 800 AssertNotSmi(object); |
| 783 cmp(object, isolate()->factory()->undefined_value()); | 801 cmp(object, isolate()->factory()->undefined_value()); |
| 784 j(equal, &done_checking); | 802 j(equal, &done_checking); |
| 785 cmp(FieldOperand(object, 0), | 803 cmp(FieldOperand(object, 0), |
| 786 Immediate(isolate()->factory()->allocation_site_map())); | 804 Immediate(isolate()->factory()->allocation_site_map())); |
| 787 Assert(equal, kExpectedUndefinedOrCell); | 805 Assert(equal, kExpectedUndefinedOrCell); |
| 788 bind(&done_checking); | 806 bind(&done_checking); |
| (...skipping 1266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2055 // A variable occurring in such a scope should have slot type LOOKUP and | 2073 // A variable occurring in such a scope should have slot type LOOKUP and |
| 2056 // not CONTEXT. | 2074 // not CONTEXT. |
| 2057 if (emit_debug_code()) { | 2075 if (emit_debug_code()) { |
| 2058 cmp(FieldOperand(dst, HeapObject::kMapOffset), | 2076 cmp(FieldOperand(dst, HeapObject::kMapOffset), |
| 2059 isolate()->factory()->with_context_map()); | 2077 isolate()->factory()->with_context_map()); |
| 2060 Check(not_equal, kVariableResolvedToWithContext); | 2078 Check(not_equal, kVariableResolvedToWithContext); |
| 2061 } | 2079 } |
| 2062 } | 2080 } |
| 2063 | 2081 |
| 2064 | 2082 |
| 2083 void MacroAssembler::LoadGlobalProxy(Register dst) { |
| 2084 mov(dst, GlobalObjectOperand()); |
| 2085 mov(dst, FieldOperand(dst, GlobalObject::kGlobalProxyOffset)); |
| 2086 } |
| 2087 |
| 2088 |
| 2065 void MacroAssembler::LoadTransitionedArrayMapConditional( | 2089 void MacroAssembler::LoadTransitionedArrayMapConditional( |
| 2066 ElementsKind expected_kind, | 2090 ElementsKind expected_kind, |
| 2067 ElementsKind transitioned_kind, | 2091 ElementsKind transitioned_kind, |
| 2068 Register map_in_out, | 2092 Register map_in_out, |
| 2069 Register scratch, | 2093 Register scratch, |
| 2070 Label* no_map_match) { | 2094 Label* no_map_match) { |
| 2071 // Load the global or builtins object from the current context. | 2095 // Load the global or builtins object from the current context. |
| 2072 mov(scratch, Operand(esi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); | 2096 mov(scratch, Operand(esi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); |
| 2073 mov(scratch, FieldOperand(scratch, GlobalObject::kNativeContextOffset)); | 2097 mov(scratch, FieldOperand(scratch, GlobalObject::kNativeContextOffset)); |
| 2074 | 2098 |
| (...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3040 mov(eax, dividend); | 3064 mov(eax, dividend); |
| 3041 shr(eax, 31); | 3065 shr(eax, 31); |
| 3042 add(edx, eax); | 3066 add(edx, eax); |
| 3043 } | 3067 } |
| 3044 | 3068 |
| 3045 | 3069 |
| 3046 } // namespace internal | 3070 } // namespace internal |
| 3047 } // namespace v8 | 3071 } // namespace v8 |
| 3048 | 3072 |
| 3049 #endif // V8_TARGET_ARCH_X87 | 3073 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |