Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(407)

Side by Side Diff: src/mips/macro-assembler-mips.cc

Issue 1573243009: [builtins] Migrate Number constructor similar to String constructor. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 1
2 // Copyright 2012 the V8 project authors. All rights reserved. 2 // Copyright 2012 the V8 project authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be 3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file. 4 // found in the LICENSE file.
5 5
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_MIPS 8 #if V8_TARGET_ARCH_MIPS
9 9
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 3582 matching lines...) Expand 10 before | Expand all | Expand 10 after
3593 FPURegister value, 3593 FPURegister value,
3594 Register scratch1, 3594 Register scratch1,
3595 Register scratch2, 3595 Register scratch2,
3596 Label* gc_required) { 3596 Label* gc_required) {
3597 LoadRoot(t8, Heap::kHeapNumberMapRootIndex); 3597 LoadRoot(t8, Heap::kHeapNumberMapRootIndex);
3598 AllocateHeapNumber(result, scratch1, scratch2, t8, gc_required); 3598 AllocateHeapNumber(result, scratch1, scratch2, t8, gc_required);
3599 sdc1(value, FieldMemOperand(result, HeapNumber::kValueOffset)); 3599 sdc1(value, FieldMemOperand(result, HeapNumber::kValueOffset));
3600 } 3600 }
3601 3601
3602 3602
3603 void MacroAssembler::AllocateJSValue(Register result, Register constructor,
3604 Register value, Register scratch1,
3605 Register scratch2, Label* gc_required) {
3606 DCHECK(!result.is(constructor));
3607 DCHECK(!result.is(scratch1));
3608 DCHECK(!result.is(scratch2));
3609 DCHECK(!result.is(value));
3610
3611 // Allocate JSValue in new space.
3612 Allocate(JSValue::kSize, result, scratch1, scratch2, gc_required, TAG_OBJECT);
3613
3614 // Initialize the JSValue.
3615 LoadGlobalFunctionInitialMap(constructor, scratch1, scratch2);
3616 sw(scratch1, FieldMemOperand(result, HeapObject::kMapOffset));
3617 LoadRoot(scratch1, Heap::kEmptyFixedArrayRootIndex);
3618 sw(scratch1, FieldMemOperand(result, JSObject::kPropertiesOffset));
3619 sw(scratch1, FieldMemOperand(result, JSObject::kElementsOffset));
3620 sw(value, FieldMemOperand(result, JSValue::kValueOffset));
3621 STATIC_ASSERT(JSValue::kSize == 4 * kPointerSize);
3622 }
3623
3624
3603 void MacroAssembler::CopyBytes(Register src, 3625 void MacroAssembler::CopyBytes(Register src,
3604 Register dst, 3626 Register dst,
3605 Register length, 3627 Register length,
3606 Register scratch) { 3628 Register scratch) {
3607 Label align_loop_1, word_loop, byte_loop, byte_loop_1, done; 3629 Label align_loop_1, word_loop, byte_loop, byte_loop_1, done;
3608 3630
3609 // Align src before copying in word size chunks. 3631 // Align src before copying in word size chunks.
3610 Branch(&byte_loop, le, length, Operand(kPointerSize)); 3632 Branch(&byte_loop, le, length, Operand(kPointerSize));
3611 bind(&align_loop_1); 3633 bind(&align_loop_1);
3612 And(scratch, src, kPointerSize - 1); 3634 And(scratch, src, kPointerSize - 1);
(...skipping 2153 matching lines...) Expand 10 before | Expand all | Expand 10 after
5766 if (mag.shift > 0) sra(result, result, mag.shift); 5788 if (mag.shift > 0) sra(result, result, mag.shift);
5767 srl(at, dividend, 31); 5789 srl(at, dividend, 31);
5768 Addu(result, result, Operand(at)); 5790 Addu(result, result, Operand(at));
5769 } 5791 }
5770 5792
5771 5793
5772 } // namespace internal 5794 } // namespace internal
5773 } // namespace v8 5795 } // namespace v8
5774 5796
5775 #endif // V8_TARGET_ARCH_MIPS 5797 #endif // V8_TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698