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 2115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2126 mov(dst, ContextOperand(dst, Context::GLOBAL_PROXY_INDEX)); | 2126 mov(dst, ContextOperand(dst, Context::GLOBAL_PROXY_INDEX)); |
2127 } | 2127 } |
2128 | 2128 |
2129 | 2129 |
2130 void MacroAssembler::LoadTransitionedArrayMapConditional( | 2130 void MacroAssembler::LoadTransitionedArrayMapConditional( |
2131 ElementsKind expected_kind, | 2131 ElementsKind expected_kind, |
2132 ElementsKind transitioned_kind, | 2132 ElementsKind transitioned_kind, |
2133 Register map_in_out, | 2133 Register map_in_out, |
2134 Register scratch, | 2134 Register scratch, |
2135 Label* no_map_match) { | 2135 Label* no_map_match) { |
2136 // Load the global or builtins object from the current context. | 2136 DCHECK(IsFastElementsKind(expected_kind)); |
2137 mov(scratch, NativeContextOperand()); | 2137 DCHECK(IsFastElementsKind(transitioned_kind)); |
2138 | 2138 |
2139 // Check that the function's map is the same as the expected cached map. | 2139 // Check that the function's map is the same as the expected cached map. |
2140 mov(scratch, Operand(scratch, | 2140 mov(scratch, NativeContextOperand()); |
2141 Context::SlotOffset(Context::JS_ARRAY_MAPS_INDEX))); | 2141 cmp(map_in_out, |
2142 | 2142 ContextOperand(scratch, Context::ArrayMapIndex(expected_kind))); |
2143 size_t offset = expected_kind * kPointerSize + | |
2144 FixedArrayBase::kHeaderSize; | |
2145 cmp(map_in_out, FieldOperand(scratch, offset)); | |
2146 j(not_equal, no_map_match); | 2143 j(not_equal, no_map_match); |
2147 | 2144 |
2148 // Use the transitioned cached map. | 2145 // Use the transitioned cached map. |
2149 offset = transitioned_kind * kPointerSize + | 2146 mov(map_in_out, |
2150 FixedArrayBase::kHeaderSize; | 2147 ContextOperand(scratch, Context::ArrayMapIndex(transitioned_kind))); |
2151 mov(map_in_out, FieldOperand(scratch, offset)); | |
2152 } | 2148 } |
2153 | 2149 |
2154 | 2150 |
2155 void MacroAssembler::LoadGlobalFunction(int index, Register function) { | 2151 void MacroAssembler::LoadGlobalFunction(int index, Register function) { |
2156 // Load the native context from the current context. | 2152 // Load the native context from the current context. |
2157 mov(function, NativeContextOperand()); | 2153 mov(function, NativeContextOperand()); |
2158 // Load the function from the native context. | 2154 // Load the function from the native context. |
2159 mov(function, ContextOperand(function, index)); | 2155 mov(function, ContextOperand(function, index)); |
2160 } | 2156 } |
2161 | 2157 |
(...skipping 883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3045 mov(eax, dividend); | 3041 mov(eax, dividend); |
3046 shr(eax, 31); | 3042 shr(eax, 31); |
3047 add(edx, eax); | 3043 add(edx, eax); |
3048 } | 3044 } |
3049 | 3045 |
3050 | 3046 |
3051 } // namespace internal | 3047 } // namespace internal |
3052 } // namespace v8 | 3048 } // namespace v8 |
3053 | 3049 |
3054 #endif // V8_TARGET_ARCH_X87 | 3050 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |