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/mips64/macro-assembler-mips64.cc

Issue 1324553004: MIPS: minor cleanup in macro-assembler. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « src/mips/macro-assembler-mips.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <limits.h> // For LONG_MIN, LONG_MAX. 5 #include <limits.h> // For LONG_MIN, LONG_MAX.
6 6
7 #if V8_TARGET_ARCH_MIPS64 7 #if V8_TARGET_ARCH_MIPS64
8 8
9 #include "src/base/division-by-constant.h" 9 #include "src/base/division-by-constant.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 1421 matching lines...) Expand 10 before | Expand all | Expand 10 after
1432 } 1432 }
1433 daddiu(sp, sp, stack_offset); 1433 daddiu(sp, sp, stack_offset);
1434 } 1434 }
1435 1435
1436 1436
1437 void MacroAssembler::FlushICache(Register address, unsigned instructions) { 1437 void MacroAssembler::FlushICache(Register address, unsigned instructions) {
1438 RegList saved_regs = kJSCallerSaved | ra.bit(); 1438 RegList saved_regs = kJSCallerSaved | ra.bit();
1439 MultiPush(saved_regs); 1439 MultiPush(saved_regs);
1440 AllowExternalCallThatCantCauseGC scope(this); 1440 AllowExternalCallThatCantCauseGC scope(this);
1441 1441
1442 // Save to a0 in case address == a4.
1443 Move(a0, address); 1442 Move(a0, address);
1444 PrepareCallCFunction(2, a4); 1443 PrepareCallCFunction(2, t8);
1445 1444
1446 li(a1, instructions * kInstrSize); 1445 li(a1, instructions * kInstrSize);
1447 CallCFunction(ExternalReference::flush_icache_function(isolate()), 2); 1446 CallCFunction(ExternalReference::flush_icache_function(isolate()), 2);
1448 MultiPop(saved_regs); 1447 MultiPop(saved_regs);
1449 } 1448 }
1450 1449
1451 1450
1452 void MacroAssembler::Ext(Register rt, 1451 void MacroAssembler::Ext(Register rt,
1453 Register rs, 1452 Register rs,
1454 uint16_t pos, 1453 uint16_t pos,
(...skipping 3886 matching lines...) Expand 10 before | Expand all | Expand 10 after
5341 STATIC_ASSERT(kSmiTag == 0); 5340 STATIC_ASSERT(kSmiTag == 0);
5342 andi(at, object, kSmiTagMask); 5341 andi(at, object, kSmiTagMask);
5343 Check(eq, kOperandIsASmi, at, Operand(zero_reg)); 5342 Check(eq, kOperandIsASmi, at, Operand(zero_reg));
5344 } 5343 }
5345 } 5344 }
5346 5345
5347 5346
5348 void MacroAssembler::AssertString(Register object) { 5347 void MacroAssembler::AssertString(Register object) {
5349 if (emit_debug_code()) { 5348 if (emit_debug_code()) {
5350 STATIC_ASSERT(kSmiTag == 0); 5349 STATIC_ASSERT(kSmiTag == 0);
5351 SmiTst(object, a4); 5350 SmiTst(object, t8);
5352 Check(ne, kOperandIsASmiAndNotAString, a4, Operand(zero_reg)); 5351 Check(ne, kOperandIsASmiAndNotAString, t8, Operand(zero_reg));
5353 push(object); 5352 GetObjectType(object, t8, t8);
5354 ld(object, FieldMemOperand(object, HeapObject::kMapOffset)); 5353 Check(lo, kOperandIsNotAString, t8, Operand(FIRST_NONSTRING_TYPE));
5355 lbu(object, FieldMemOperand(object, Map::kInstanceTypeOffset));
5356 Check(lo, kOperandIsNotAString, object, Operand(FIRST_NONSTRING_TYPE));
5357 pop(object);
5358 } 5354 }
5359 } 5355 }
5360 5356
5361 5357
5362 void MacroAssembler::AssertName(Register object) { 5358 void MacroAssembler::AssertName(Register object) {
5363 if (emit_debug_code()) { 5359 if (emit_debug_code()) {
5364 STATIC_ASSERT(kSmiTag == 0); 5360 STATIC_ASSERT(kSmiTag == 0);
5365 SmiTst(object, a4); 5361 SmiTst(object, t8);
5366 Check(ne, kOperandIsASmiAndNotAName, a4, Operand(zero_reg)); 5362 Check(ne, kOperandIsASmiAndNotAName, t8, Operand(zero_reg));
5367 push(object); 5363 GetObjectType(object, t8, t8);
5368 ld(object, FieldMemOperand(object, HeapObject::kMapOffset)); 5364 Check(le, kOperandIsNotAName, t8, Operand(LAST_NAME_TYPE));
5369 lbu(object, FieldMemOperand(object, Map::kInstanceTypeOffset));
5370 Check(le, kOperandIsNotAName, object, Operand(LAST_NAME_TYPE));
5371 pop(object);
5372 } 5365 }
5373 } 5366 }
5374 5367
5375 5368
5376 void MacroAssembler::AssertFunction(Register object) { 5369 void MacroAssembler::AssertFunction(Register object) {
5377 if (emit_debug_code()) { 5370 if (emit_debug_code()) {
5378 STATIC_ASSERT(kSmiTag == 0); 5371 STATIC_ASSERT(kSmiTag == 0);
5379 SmiTst(object, t0); 5372 SmiTst(object, t8);
5380 Check(ne, kOperandIsASmiAndNotAFunction, t0, Operand(zero_reg)); 5373 Check(ne, kOperandIsASmiAndNotAFunction, t8, Operand(zero_reg));
5381 GetObjectType(object, t0, t0); 5374 GetObjectType(object, t8, t8);
5382 Check(eq, kOperandIsNotAFunction, t0, Operand(JS_FUNCTION_TYPE)); 5375 Check(eq, kOperandIsNotAFunction, t8, Operand(JS_FUNCTION_TYPE));
5383 } 5376 }
5384 } 5377 }
5385 5378
5386 5379
5387 void MacroAssembler::AssertUndefinedOrAllocationSite(Register object, 5380 void MacroAssembler::AssertUndefinedOrAllocationSite(Register object,
5388 Register scratch) { 5381 Register scratch) {
5389 if (emit_debug_code()) { 5382 if (emit_debug_code()) {
5390 Label done_checking; 5383 Label done_checking;
5391 AssertNotSmi(object); 5384 AssertNotSmi(object);
5392 LoadRoot(scratch, Heap::kUndefinedValueRootIndex); 5385 LoadRoot(scratch, Heap::kUndefinedValueRootIndex);
5393 Branch(&done_checking, eq, object, Operand(scratch)); 5386 Branch(&done_checking, eq, object, Operand(scratch));
5394 push(object); 5387 ld(t8, FieldMemOperand(object, HeapObject::kMapOffset));
5395 ld(object, FieldMemOperand(object, HeapObject::kMapOffset));
5396 LoadRoot(scratch, Heap::kAllocationSiteMapRootIndex); 5388 LoadRoot(scratch, Heap::kAllocationSiteMapRootIndex);
5397 Assert(eq, kExpectedUndefinedOrCell, object, Operand(scratch)); 5389 Assert(eq, kExpectedUndefinedOrCell, t8, Operand(scratch));
5398 pop(object);
5399 bind(&done_checking); 5390 bind(&done_checking);
5400 } 5391 }
5401 } 5392 }
5402 5393
5403 5394
5404 void MacroAssembler::AssertIsRoot(Register reg, Heap::RootListIndex index) { 5395 void MacroAssembler::AssertIsRoot(Register reg, Heap::RootListIndex index) {
5405 if (emit_debug_code()) { 5396 if (emit_debug_code()) {
5406 DCHECK(!reg.is(at)); 5397 DCHECK(!reg.is(at));
5407 LoadRoot(at, index); 5398 LoadRoot(at, index);
5408 Check(eq, kHeapNumberMapRegisterClobbered, reg, Operand(at)); 5399 Check(eq, kHeapNumberMapRegisterClobbered, reg, Operand(at));
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after
6216 if (mag.shift > 0) sra(result, result, mag.shift); 6207 if (mag.shift > 0) sra(result, result, mag.shift);
6217 srl(at, dividend, 31); 6208 srl(at, dividend, 31);
6218 Addu(result, result, Operand(at)); 6209 Addu(result, result, Operand(at));
6219 } 6210 }
6220 6211
6221 6212
6222 } // namespace internal 6213 } // namespace internal
6223 } // namespace v8 6214 } // namespace v8
6224 6215
6225 #endif // V8_TARGET_ARCH_MIPS64 6216 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips/macro-assembler-mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698