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

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

Issue 1475823003: [runtime] First step to sanitize regexp literal creation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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 3581 matching lines...) Expand 10 before | Expand all | Expand 10 after
3592 FPURegister value, 3592 FPURegister value,
3593 Register scratch1, 3593 Register scratch1,
3594 Register scratch2, 3594 Register scratch2,
3595 Label* gc_required) { 3595 Label* gc_required) {
3596 LoadRoot(t8, Heap::kHeapNumberMapRootIndex); 3596 LoadRoot(t8, Heap::kHeapNumberMapRootIndex);
3597 AllocateHeapNumber(result, scratch1, scratch2, t8, gc_required); 3597 AllocateHeapNumber(result, scratch1, scratch2, t8, gc_required);
3598 sdc1(value, FieldMemOperand(result, HeapNumber::kValueOffset)); 3598 sdc1(value, FieldMemOperand(result, HeapNumber::kValueOffset));
3599 } 3599 }
3600 3600
3601 3601
3602 // Copies a fixed number of fields of heap objects from src to dst.
3603 void MacroAssembler::CopyFields(Register dst,
3604 Register src,
3605 RegList temps,
3606 int field_count) {
3607 DCHECK((temps & dst.bit()) == 0);
3608 DCHECK((temps & src.bit()) == 0);
3609 // Primitive implementation using only one temporary register.
3610
3611 Register tmp = no_reg;
3612 // Find a temp register in temps list.
3613 for (int i = 0; i < kNumRegisters; i++) {
3614 if ((temps & (1 << i)) != 0) {
3615 tmp.reg_code = i;
3616 break;
3617 }
3618 }
3619 DCHECK(!tmp.is(no_reg));
3620
3621 for (int i = 0; i < field_count; i++) {
3622 lw(tmp, FieldMemOperand(src, i * kPointerSize));
3623 sw(tmp, FieldMemOperand(dst, i * kPointerSize));
3624 }
3625 }
3626
3627
3628 void MacroAssembler::CopyBytes(Register src, 3602 void MacroAssembler::CopyBytes(Register src,
3629 Register dst, 3603 Register dst,
3630 Register length, 3604 Register length,
3631 Register scratch) { 3605 Register scratch) {
3632 Label align_loop_1, word_loop, byte_loop, byte_loop_1, done; 3606 Label align_loop_1, word_loop, byte_loop, byte_loop_1, done;
3633 3607
3634 // Align src before copying in word size chunks. 3608 // Align src before copying in word size chunks.
3635 Branch(&byte_loop, le, length, Operand(kPointerSize)); 3609 Branch(&byte_loop, le, length, Operand(kPointerSize));
3636 bind(&align_loop_1); 3610 bind(&align_loop_1);
3637 And(scratch, src, kPointerSize - 1); 3611 And(scratch, src, kPointerSize - 1);
(...skipping 2205 matching lines...) Expand 10 before | Expand all | Expand 10 after
5843 if (mag.shift > 0) sra(result, result, mag.shift); 5817 if (mag.shift > 0) sra(result, result, mag.shift);
5844 srl(at, dividend, 31); 5818 srl(at, dividend, 31);
5845 Addu(result, result, Operand(at)); 5819 Addu(result, result, Operand(at));
5846 } 5820 }
5847 5821
5848 5822
5849 } // namespace internal 5823 } // namespace internal
5850 } // namespace v8 5824 } // namespace v8
5851 5825
5852 #endif // V8_TARGET_ARCH_MIPS 5826 #endif // V8_TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698