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 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/base/division-by-constant.h" | 10 #include "src/base/division-by-constant.h" |
(...skipping 2123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2134 | 2134 |
2135 void MacroAssembler::GetBuiltinEntry(Register target, Builtins::JavaScript id) { | 2135 void MacroAssembler::GetBuiltinEntry(Register target, Builtins::JavaScript id) { |
2136 DCHECK(!target.is(edi)); | 2136 DCHECK(!target.is(edi)); |
2137 // Load the JavaScript builtin function from the builtins object. | 2137 // Load the JavaScript builtin function from the builtins object. |
2138 GetBuiltinFunction(edi, id); | 2138 GetBuiltinFunction(edi, id); |
2139 // Load the code entry point from the function into the target register. | 2139 // Load the code entry point from the function into the target register. |
2140 mov(target, FieldOperand(edi, JSFunction::kCodeEntryOffset)); | 2140 mov(target, FieldOperand(edi, JSFunction::kCodeEntryOffset)); |
2141 } | 2141 } |
2142 | 2142 |
2143 | 2143 |
2144 void MacroAssembler::BranchIfNotBuiltin(Register function, Register temp, | |
2145 BuiltinFunctionId id, Label* miss) { | |
2146 mov(temp, FieldOperand(function, JSFunction::kSharedFunctionInfoOffset)); | |
2147 mov(temp, FieldOperand(temp, SharedFunctionInfo::kFunctionDataOffset)); | |
2148 cmp(temp, Immediate(Smi::FromInt(id))); | |
2149 j(not_equal, miss); | |
2150 } | |
2151 | |
2152 | |
2153 void MacroAssembler::LoadContext(Register dst, int context_chain_length) { | 2144 void MacroAssembler::LoadContext(Register dst, int context_chain_length) { |
2154 if (context_chain_length > 0) { | 2145 if (context_chain_length > 0) { |
2155 // Move up the chain of contexts to the context containing the slot. | 2146 // Move up the chain of contexts to the context containing the slot. |
2156 mov(dst, Operand(esi, Context::SlotOffset(Context::PREVIOUS_INDEX))); | 2147 mov(dst, Operand(esi, Context::SlotOffset(Context::PREVIOUS_INDEX))); |
2157 for (int i = 1; i < context_chain_length; i++) { | 2148 for (int i = 1; i < context_chain_length; i++) { |
2158 mov(dst, Operand(dst, Context::SlotOffset(Context::PREVIOUS_INDEX))); | 2149 mov(dst, Operand(dst, Context::SlotOffset(Context::PREVIOUS_INDEX))); |
2159 } | 2150 } |
2160 } else { | 2151 } else { |
2161 // Slot is in the current function context. Move it into the | 2152 // Slot is in the current function context. Move it into the |
2162 // destination register in case we store into it (the write barrier | 2153 // destination register in case we store into it (the write barrier |
(...skipping 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3231 if (mag.shift > 0) sar(edx, mag.shift); | 3222 if (mag.shift > 0) sar(edx, mag.shift); |
3232 mov(eax, dividend); | 3223 mov(eax, dividend); |
3233 shr(eax, 31); | 3224 shr(eax, 31); |
3234 add(edx, eax); | 3225 add(edx, eax); |
3235 } | 3226 } |
3236 | 3227 |
3237 | 3228 |
3238 } } // namespace v8::internal | 3229 } } // namespace v8::internal |
3239 | 3230 |
3240 #endif // V8_TARGET_ARCH_IA32 | 3231 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |