OLD | NEW |
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 6237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6248 AssertNotSmi(object); | 6248 AssertNotSmi(object); |
6249 LoadRoot(scratch, Heap::kUndefinedValueRootIndex); | 6249 LoadRoot(scratch, Heap::kUndefinedValueRootIndex); |
6250 Branch(&done_checking, eq, object, Operand(scratch)); | 6250 Branch(&done_checking, eq, object, Operand(scratch)); |
6251 Ld(t8, FieldMemOperand(object, HeapObject::kMapOffset)); | 6251 Ld(t8, FieldMemOperand(object, HeapObject::kMapOffset)); |
6252 LoadRoot(scratch, Heap::kAllocationSiteMapRootIndex); | 6252 LoadRoot(scratch, Heap::kAllocationSiteMapRootIndex); |
6253 Assert(eq, kExpectedUndefinedOrCell, t8, Operand(scratch)); | 6253 Assert(eq, kExpectedUndefinedOrCell, t8, Operand(scratch)); |
6254 bind(&done_checking); | 6254 bind(&done_checking); |
6255 } | 6255 } |
6256 } | 6256 } |
6257 | 6257 |
| 6258 void MacroAssembler::AssertApiCallResult(Register object) { |
| 6259 if (emit_debug_code()) { |
| 6260 Label done_checking; |
| 6261 Push(object); |
| 6262 |
| 6263 // Check for Smis. |
| 6264 JumpIfSmi(object, &done_checking); |
| 6265 |
| 6266 // Check for valid Oddballs. |
| 6267 JumpIfRoot(object, Heap::kTrueValueRootIndex, &done_checking); |
| 6268 JumpIfRoot(object, Heap::kFalseValueRootIndex, &done_checking); |
| 6269 JumpIfRoot(object, Heap::kNullValueRootIndex, &done_checking); |
| 6270 JumpIfRoot(object, Heap::kUndefinedValueRootIndex, &done_checking); |
| 6271 |
| 6272 // Check for other primitives (String, Symbol and HeapNumber). |
| 6273 STATIC_ASSERT(LAST_PRIMITIVE_TYPE == ODDBALL_TYPE); |
| 6274 GetObjectType(object, object, object); |
| 6275 Branch(&done_checking, lo, object, Operand(LAST_PRIMITIVE_TYPE)); |
| 6276 |
| 6277 // Check for JSReceivers. |
| 6278 Check(hs, kAPICallReturnedInvalidObject, object, |
| 6279 Operand(FIRST_JS_RECEIVER_TYPE)); |
| 6280 |
| 6281 bind(&done_checking); |
| 6282 Pop(object); |
| 6283 } |
| 6284 } |
6258 | 6285 |
6259 void MacroAssembler::AssertIsRoot(Register reg, Heap::RootListIndex index) { | 6286 void MacroAssembler::AssertIsRoot(Register reg, Heap::RootListIndex index) { |
6260 if (emit_debug_code()) { | 6287 if (emit_debug_code()) { |
6261 DCHECK(!reg.is(at)); | 6288 DCHECK(!reg.is(at)); |
6262 LoadRoot(at, index); | 6289 LoadRoot(at, index); |
6263 Check(eq, kHeapNumberMapRegisterClobbered, reg, Operand(at)); | 6290 Check(eq, kHeapNumberMapRegisterClobbered, reg, Operand(at)); |
6264 } | 6291 } |
6265 } | 6292 } |
6266 | 6293 |
6267 | 6294 |
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7013 if (mag.shift > 0) sra(result, result, mag.shift); | 7040 if (mag.shift > 0) sra(result, result, mag.shift); |
7014 srl(at, dividend, 31); | 7041 srl(at, dividend, 31); |
7015 Addu(result, result, Operand(at)); | 7042 Addu(result, result, Operand(at)); |
7016 } | 7043 } |
7017 | 7044 |
7018 | 7045 |
7019 } // namespace internal | 7046 } // namespace internal |
7020 } // namespace v8 | 7047 } // namespace v8 |
7021 | 7048 |
7022 #endif // V8_TARGET_ARCH_MIPS64 | 7049 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |