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 #include "v8.h" | 7 #include "v8.h" |
8 | 8 |
9 #if V8_TARGET_ARCH_MIPS | 9 #if V8_TARGET_ARCH_MIPS |
10 | 10 |
(...skipping 5389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5400 | 5400 |
5401 And(bitmap_scratch, bitmap_scratch, Operand(~Page::kPageAlignmentMask)); | 5401 And(bitmap_scratch, bitmap_scratch, Operand(~Page::kPageAlignmentMask)); |
5402 lw(t8, MemOperand(bitmap_scratch, MemoryChunk::kLiveBytesOffset)); | 5402 lw(t8, MemOperand(bitmap_scratch, MemoryChunk::kLiveBytesOffset)); |
5403 Addu(t8, t8, Operand(length)); | 5403 Addu(t8, t8, Operand(length)); |
5404 sw(t8, MemOperand(bitmap_scratch, MemoryChunk::kLiveBytesOffset)); | 5404 sw(t8, MemOperand(bitmap_scratch, MemoryChunk::kLiveBytesOffset)); |
5405 | 5405 |
5406 bind(&done); | 5406 bind(&done); |
5407 } | 5407 } |
5408 | 5408 |
5409 | 5409 |
5410 void MacroAssembler::Throw(BailoutReason reason) { | |
5411 Label throw_start; | |
5412 bind(&throw_start); | |
5413 #ifdef DEBUG | |
5414 const char* msg = GetBailoutReason(reason); | |
5415 if (msg != NULL) { | |
5416 RecordComment("Throw message: "); | |
5417 RecordComment(msg); | |
5418 } | |
5419 #endif | |
5420 | |
5421 li(a0, Operand(Smi::FromInt(reason))); | |
5422 push(a0); | |
5423 // Disable stub call restrictions to always allow calls to throw. | |
5424 if (!has_frame_) { | |
5425 // We don't actually want to generate a pile of code for this, so just | |
5426 // claim there is a stack frame, without generating one. | |
5427 FrameScope scope(this, StackFrame::NONE); | |
5428 CallRuntime(Runtime::kHiddenThrowMessage, 1); | |
5429 } else { | |
5430 CallRuntime(Runtime::kHiddenThrowMessage, 1); | |
5431 } | |
5432 // will not return here | |
5433 if (is_trampoline_pool_blocked()) { | |
5434 // If the calling code cares throw the exact number of | |
5435 // instructions generated, we insert padding here to keep the size | |
5436 // of the ThrowMessage macro constant. | |
5437 // Currently in debug mode with debug_code enabled the number of | |
5438 // generated instructions is 14, so we use this as a maximum value. | |
5439 static const int kExpectedThrowMessageInstructions = 14; | |
5440 int throw_instructions = InstructionsGeneratedSince(&throw_start); | |
5441 ASSERT(throw_instructions <= kExpectedThrowMessageInstructions); | |
5442 while (throw_instructions++ < kExpectedThrowMessageInstructions) { | |
5443 nop(); | |
5444 } | |
5445 } | |
5446 } | |
5447 | |
5448 | |
5449 void MacroAssembler::ThrowIf(Condition cc, | |
5450 BailoutReason reason, | |
5451 Register rs, | |
5452 Operand rt) { | |
5453 Label L; | |
5454 Branch(&L, NegateCondition(cc), rs, rt); | |
5455 Throw(reason); | |
5456 // will not return here | |
5457 bind(&L); | |
5458 } | |
5459 | |
5460 | |
5461 void MacroAssembler::LoadInstanceDescriptors(Register map, | 5410 void MacroAssembler::LoadInstanceDescriptors(Register map, |
5462 Register descriptors) { | 5411 Register descriptors) { |
5463 lw(descriptors, FieldMemOperand(map, Map::kDescriptorsOffset)); | 5412 lw(descriptors, FieldMemOperand(map, Map::kDescriptorsOffset)); |
5464 } | 5413 } |
5465 | 5414 |
5466 | 5415 |
5467 void MacroAssembler::NumberOfOwnDescriptors(Register dst, Register map) { | 5416 void MacroAssembler::NumberOfOwnDescriptors(Register dst, Register map) { |
5468 lw(dst, FieldMemOperand(map, Map::kBitField3Offset)); | 5417 lw(dst, FieldMemOperand(map, Map::kBitField3Offset)); |
5469 DecodeField<Map::NumberOfOwnDescriptorsBits>(dst); | 5418 DecodeField<Map::NumberOfOwnDescriptorsBits>(dst); |
5470 } | 5419 } |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5721 } | 5670 } |
5722 if (ms.shift() > 0) sra(result, result, ms.shift()); | 5671 if (ms.shift() > 0) sra(result, result, ms.shift()); |
5723 srl(at, dividend, 31); | 5672 srl(at, dividend, 31); |
5724 Addu(result, result, Operand(at)); | 5673 Addu(result, result, Operand(at)); |
5725 } | 5674 } |
5726 | 5675 |
5727 | 5676 |
5728 } } // namespace v8::internal | 5677 } } // namespace v8::internal |
5729 | 5678 |
5730 #endif // V8_TARGET_ARCH_MIPS | 5679 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |