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 "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_MIPS | 7 #if V8_TARGET_ARCH_MIPS |
8 | 8 |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 Register result1_; | 400 Register result1_; |
401 Register result2_; | 401 Register result2_; |
402 Register source_; | 402 Register source_; |
403 Register zeros_; | 403 Register zeros_; |
404 | 404 |
405 // Minor key encoding in 16 bits. | 405 // Minor key encoding in 16 bits. |
406 class ModeBits: public BitField<OverwriteMode, 0, 2> {}; | 406 class ModeBits: public BitField<OverwriteMode, 0, 2> {}; |
407 class OpBits: public BitField<Token::Value, 2, 14> {}; | 407 class OpBits: public BitField<Token::Value, 2, 14> {}; |
408 | 408 |
409 Major MajorKey() const { return ConvertToDouble; } | 409 Major MajorKey() const { return ConvertToDouble; } |
410 int MinorKey() const { | 410 uint32_t MinorKey() const { |
411 // Encode the parameters in a unique 16 bit value. | 411 // Encode the parameters in a unique 16 bit value. |
412 return result1_.code() + | 412 return result1_.code() + |
413 (result2_.code() << 4) + | 413 (result2_.code() << 4) + |
414 (source_.code() << 8) + | 414 (source_.code() << 8) + |
415 (zeros_.code() << 12); | 415 (zeros_.code() << 12); |
416 } | 416 } |
417 | 417 |
418 void Generate(MacroAssembler* masm); | 418 void Generate(MacroAssembler* masm); |
419 }; | 419 }; |
420 | 420 |
(...skipping 1058 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1479 // NOTE: s0-s2 hold the arguments of this function instead of a0-a2. | 1479 // NOTE: s0-s2 hold the arguments of this function instead of a0-a2. |
1480 // The reason for this is that these arguments would need to be saved anyway | 1480 // The reason for this is that these arguments would need to be saved anyway |
1481 // so it's faster to set them up directly. | 1481 // so it's faster to set them up directly. |
1482 // See MacroAssembler::PrepareCEntryArgs and PrepareCEntryFunction. | 1482 // See MacroAssembler::PrepareCEntryArgs and PrepareCEntryFunction. |
1483 | 1483 |
1484 // Compute the argv pointer in a callee-saved register. | 1484 // Compute the argv pointer in a callee-saved register. |
1485 __ Addu(s1, sp, s1); | 1485 __ Addu(s1, sp, s1); |
1486 | 1486 |
1487 // Enter the exit frame that transitions from JavaScript to C++. | 1487 // Enter the exit frame that transitions from JavaScript to C++. |
1488 FrameScope scope(masm, StackFrame::MANUAL); | 1488 FrameScope scope(masm, StackFrame::MANUAL); |
1489 __ EnterExitFrame(save_doubles_); | 1489 __ EnterExitFrame(save_doubles()); |
1490 | 1490 |
1491 // s0: number of arguments including receiver (C callee-saved) | 1491 // s0: number of arguments including receiver (C callee-saved) |
1492 // s1: pointer to first argument (C callee-saved) | 1492 // s1: pointer to first argument (C callee-saved) |
1493 // s2: pointer to builtin function (C callee-saved) | 1493 // s2: pointer to builtin function (C callee-saved) |
1494 | 1494 |
1495 // Prepare arguments for C routine. | 1495 // Prepare arguments for C routine. |
1496 // a0 = argc | 1496 // a0 = argc |
1497 __ mov(a0, s0); | 1497 __ mov(a0, s0); |
1498 // a1 = argv (set in the delay slot after find_ra below). | 1498 // a1 = argv (set in the delay slot after find_ra below). |
1499 | 1499 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1567 __ Branch(&okay, eq, t0, Operand(a2)); | 1567 __ Branch(&okay, eq, t0, Operand(a2)); |
1568 __ stop("Unexpected pending exception"); | 1568 __ stop("Unexpected pending exception"); |
1569 __ bind(&okay); | 1569 __ bind(&okay); |
1570 } | 1570 } |
1571 | 1571 |
1572 // Exit C frame and return. | 1572 // Exit C frame and return. |
1573 // v0:v1: result | 1573 // v0:v1: result |
1574 // sp: stack pointer | 1574 // sp: stack pointer |
1575 // fp: frame pointer | 1575 // fp: frame pointer |
1576 // s0: still holds argc (callee-saved). | 1576 // s0: still holds argc (callee-saved). |
1577 __ LeaveExitFrame(save_doubles_, s0, true, EMIT_RETURN); | 1577 __ LeaveExitFrame(save_doubles(), s0, true, EMIT_RETURN); |
1578 | 1578 |
1579 // Handling of exception. | 1579 // Handling of exception. |
1580 __ bind(&exception_returned); | 1580 __ bind(&exception_returned); |
1581 | 1581 |
1582 // Retrieve the pending exception. | 1582 // Retrieve the pending exception. |
1583 __ li(a2, Operand(pending_exception_address)); | 1583 __ li(a2, Operand(pending_exception_address)); |
1584 __ lw(v0, MemOperand(a2)); | 1584 __ lw(v0, MemOperand(a2)); |
1585 | 1585 |
1586 // Clear the pending exception. | 1586 // Clear the pending exception. |
1587 __ li(a3, Operand(isolate()->factory()->the_hole_value())); | 1587 __ li(a3, Operand(isolate()->factory()->the_hole_value())); |
(...skipping 3698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5286 MemOperand(fp, 6 * kPointerSize), | 5286 MemOperand(fp, 6 * kPointerSize), |
5287 NULL); | 5287 NULL); |
5288 } | 5288 } |
5289 | 5289 |
5290 | 5290 |
5291 #undef __ | 5291 #undef __ |
5292 | 5292 |
5293 } } // namespace v8::internal | 5293 } } // namespace v8::internal |
5294 | 5294 |
5295 #endif // V8_TARGET_ARCH_MIPS | 5295 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |