| 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 2452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2463 // destination register in case we store into it (the write barrier | 2463 // destination register in case we store into it (the write barrier |
| 2464 // cannot be allowed to destroy the context in esi). | 2464 // cannot be allowed to destroy the context in esi). |
| 2465 mr(dst, cp); | 2465 mr(dst, cp); |
| 2466 } | 2466 } |
| 2467 } | 2467 } |
| 2468 | 2468 |
| 2469 | 2469 |
| 2470 void MacroAssembler::LoadTransitionedArrayMapConditional( | 2470 void MacroAssembler::LoadTransitionedArrayMapConditional( |
| 2471 ElementsKind expected_kind, ElementsKind transitioned_kind, | 2471 ElementsKind expected_kind, ElementsKind transitioned_kind, |
| 2472 Register map_in_out, Register scratch, Label* no_map_match) { | 2472 Register map_in_out, Register scratch, Label* no_map_match) { |
| 2473 DCHECK(IsFastElementsKind(expected_kind)); |
| 2474 DCHECK(IsFastElementsKind(transitioned_kind)); |
| 2475 |
| 2473 // Check that the function's map is the same as the expected cached map. | 2476 // Check that the function's map is the same as the expected cached map. |
| 2474 LoadNativeContextSlot(Context::JS_ARRAY_MAPS_INDEX, scratch); | 2477 LoadP(scratch, NativeContextMemOperand()); |
| 2475 size_t offset = expected_kind * kPointerSize + FixedArrayBase::kHeaderSize; | 2478 LoadP(ip, ContextMemOperand(scratch, Context::ArrayMapIndex(expected_kind))); |
| 2476 LoadP(ip, FieldMemOperand(scratch, offset)); | |
| 2477 cmp(map_in_out, ip); | 2479 cmp(map_in_out, ip); |
| 2478 bne(no_map_match); | 2480 bne(no_map_match); |
| 2479 | 2481 |
| 2480 // Use the transitioned cached map. | 2482 // Use the transitioned cached map. |
| 2481 offset = transitioned_kind * kPointerSize + FixedArrayBase::kHeaderSize; | 2483 LoadP(map_in_out, |
| 2482 LoadP(map_in_out, FieldMemOperand(scratch, offset)); | 2484 ContextMemOperand(scratch, Context::ArrayMapIndex(transitioned_kind))); |
| 2483 } | 2485 } |
| 2484 | 2486 |
| 2485 | 2487 |
| 2486 void MacroAssembler::LoadNativeContextSlot(int index, Register dst) { | 2488 void MacroAssembler::LoadNativeContextSlot(int index, Register dst) { |
| 2487 LoadP(dst, NativeContextMemOperand()); | 2489 LoadP(dst, NativeContextMemOperand()); |
| 2488 LoadP(dst, ContextMemOperand(dst, index)); | 2490 LoadP(dst, ContextMemOperand(dst, index)); |
| 2489 } | 2491 } |
| 2490 | 2492 |
| 2491 | 2493 |
| 2492 void MacroAssembler::LoadGlobalFunctionInitialMap(Register function, | 2494 void MacroAssembler::LoadGlobalFunctionInitialMap(Register function, |
| (...skipping 1909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4402 } | 4404 } |
| 4403 if (mag.shift > 0) srawi(result, result, mag.shift); | 4405 if (mag.shift > 0) srawi(result, result, mag.shift); |
| 4404 ExtractBit(r0, dividend, 31); | 4406 ExtractBit(r0, dividend, 31); |
| 4405 add(result, result, r0); | 4407 add(result, result, r0); |
| 4406 } | 4408 } |
| 4407 | 4409 |
| 4408 } // namespace internal | 4410 } // namespace internal |
| 4409 } // namespace v8 | 4411 } // namespace v8 |
| 4410 | 4412 |
| 4411 #endif // V8_TARGET_ARCH_PPC | 4413 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |