| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 <assert.h> // For assert | 5 #include <assert.h> // For assert |
| 6 #include <limits.h> // For LONG_MIN, LONG_MAX. | 6 #include <limits.h> // For LONG_MIN, LONG_MAX. |
| 7 | 7 |
| 8 #if V8_TARGET_ARCH_PPC | 8 #if V8_TARGET_ARCH_PPC |
| 9 | 9 |
| 10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 void MacroAssembler::Call(Label* target) { b(target, SetLK); } | 182 void MacroAssembler::Call(Label* target) { b(target, SetLK); } |
| 183 | 183 |
| 184 | 184 |
| 185 void MacroAssembler::Push(Handle<Object> handle) { | 185 void MacroAssembler::Push(Handle<Object> handle) { |
| 186 mov(r0, Operand(handle)); | 186 mov(r0, Operand(handle)); |
| 187 push(r0); | 187 push(r0); |
| 188 } | 188 } |
| 189 | 189 |
| 190 | 190 |
| 191 void MacroAssembler::Move(Register dst, Handle<Object> value) { | 191 void MacroAssembler::Move(Register dst, Handle<Object> value) { |
| 192 AllowDeferredHandleDereference smi_check; | 192 mov(dst, Operand(value)); |
| 193 if (value->IsSmi()) { | |
| 194 LoadSmiLiteral(dst, reinterpret_cast<Smi*>(*value)); | |
| 195 } else { | |
| 196 DCHECK(value->IsHeapObject()); | |
| 197 if (isolate()->heap()->InNewSpace(*value)) { | |
| 198 Handle<Cell> cell = isolate()->factory()->NewCell(value); | |
| 199 mov(dst, Operand(cell)); | |
| 200 LoadP(dst, FieldMemOperand(dst, Cell::kValueOffset)); | |
| 201 } else { | |
| 202 mov(dst, Operand(value)); | |
| 203 } | |
| 204 } | |
| 205 } | 193 } |
| 206 | 194 |
| 207 | 195 |
| 208 void MacroAssembler::Move(Register dst, Register src, Condition cond) { | 196 void MacroAssembler::Move(Register dst, Register src, Condition cond) { |
| 209 DCHECK(cond == al); | 197 DCHECK(cond == al); |
| 210 if (!dst.is(src)) { | 198 if (!dst.is(src)) { |
| 211 mr(dst, src); | 199 mr(dst, src); |
| 212 } | 200 } |
| 213 } | 201 } |
| 214 | 202 |
| (...skipping 4664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4879 } | 4867 } |
| 4880 if (mag.shift > 0) srawi(result, result, mag.shift); | 4868 if (mag.shift > 0) srawi(result, result, mag.shift); |
| 4881 ExtractBit(r0, dividend, 31); | 4869 ExtractBit(r0, dividend, 31); |
| 4882 add(result, result, r0); | 4870 add(result, result, r0); |
| 4883 } | 4871 } |
| 4884 | 4872 |
| 4885 } // namespace internal | 4873 } // namespace internal |
| 4886 } // namespace v8 | 4874 } // namespace v8 |
| 4887 | 4875 |
| 4888 #endif // V8_TARGET_ARCH_PPC | 4876 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |