| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 5032 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5043 } | 5043 } |
| 5044 | 5044 |
| 5045 | 5045 |
| 5046 void MacroAssembler::EmitSeqStringSetCharCheck(Register string, | 5046 void MacroAssembler::EmitSeqStringSetCharCheck(Register string, |
| 5047 Register index, | 5047 Register index, |
| 5048 Register value, | 5048 Register value, |
| 5049 Register scratch, | 5049 Register scratch, |
| 5050 uint32_t encoding_mask) { | 5050 uint32_t encoding_mask) { |
| 5051 Label is_object; | 5051 Label is_object; |
| 5052 SmiTst(string, at); | 5052 SmiTst(string, at); |
| 5053 ThrowIf(eq, kNonObject, at, Operand(zero_reg)); | 5053 Check(ne, kNonObject, at, Operand(zero_reg)); |
| 5054 | 5054 |
| 5055 lw(at, FieldMemOperand(string, HeapObject::kMapOffset)); | 5055 lw(at, FieldMemOperand(string, HeapObject::kMapOffset)); |
| 5056 lbu(at, FieldMemOperand(at, Map::kInstanceTypeOffset)); | 5056 lbu(at, FieldMemOperand(at, Map::kInstanceTypeOffset)); |
| 5057 | 5057 |
| 5058 andi(at, at, kStringRepresentationMask | kStringEncodingMask); | 5058 andi(at, at, kStringRepresentationMask | kStringEncodingMask); |
| 5059 li(scratch, Operand(encoding_mask)); | 5059 li(scratch, Operand(encoding_mask)); |
| 5060 ThrowIf(ne, kUnexpectedStringType, at, Operand(scratch)); | 5060 Check(eq, kUnexpectedStringType, at, Operand(scratch)); |
| 5061 | 5061 |
| 5062 // The index is assumed to be untagged coming in, tag it to compare with the | 5062 // The index is assumed to be untagged coming in, tag it to compare with the |
| 5063 // string length without using a temp register, it is restored at the end of | 5063 // string length without using a temp register, it is restored at the end of |
| 5064 // this function. | 5064 // this function. |
| 5065 Label index_tag_ok, index_tag_bad; | 5065 Label index_tag_ok, index_tag_bad; |
| 5066 TrySmiTag(index, scratch, &index_tag_bad); | 5066 TrySmiTag(index, scratch, &index_tag_bad); |
| 5067 Branch(&index_tag_ok); | 5067 Branch(&index_tag_ok); |
| 5068 bind(&index_tag_bad); | 5068 bind(&index_tag_bad); |
| 5069 Throw(kIndexIsTooLarge); | 5069 Abort(kIndexIsTooLarge); |
| 5070 bind(&index_tag_ok); | 5070 bind(&index_tag_ok); |
| 5071 | 5071 |
| 5072 lw(at, FieldMemOperand(string, String::kLengthOffset)); | 5072 lw(at, FieldMemOperand(string, String::kLengthOffset)); |
| 5073 ThrowIf(ge, kIndexIsTooLarge, index, Operand(at)); | 5073 Check(lt, kIndexIsTooLarge, index, Operand(at)); |
| 5074 | 5074 |
| 5075 ASSERT(Smi::FromInt(0) == 0); | 5075 ASSERT(Smi::FromInt(0) == 0); |
| 5076 ThrowIf(lt, kIndexIsNegative, index, Operand(zero_reg)); | 5076 Check(ge, kIndexIsNegative, index, Operand(zero_reg)); |
| 5077 | 5077 |
| 5078 SmiUntag(index, index); | 5078 SmiUntag(index, index); |
| 5079 } | 5079 } |
| 5080 | 5080 |
| 5081 | 5081 |
| 5082 void MacroAssembler::PrepareCallCFunction(int num_reg_arguments, | 5082 void MacroAssembler::PrepareCallCFunction(int num_reg_arguments, |
| 5083 int num_double_arguments, | 5083 int num_double_arguments, |
| 5084 Register scratch) { | 5084 Register scratch) { |
| 5085 int frame_alignment = ActivationFrameAlignment(); | 5085 int frame_alignment = ActivationFrameAlignment(); |
| 5086 | 5086 |
| (...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5745 opcode == BGTZL); | 5745 opcode == BGTZL); |
| 5746 opcode = (cond == eq) ? BEQ : BNE; | 5746 opcode = (cond == eq) ? BEQ : BNE; |
| 5747 instr = (instr & ~kOpcodeMask) | opcode; | 5747 instr = (instr & ~kOpcodeMask) | opcode; |
| 5748 masm_.emit(instr); | 5748 masm_.emit(instr); |
| 5749 } | 5749 } |
| 5750 | 5750 |
| 5751 | 5751 |
| 5752 } } // namespace v8::internal | 5752 } } // namespace v8::internal |
| 5753 | 5753 |
| 5754 #endif // V8_TARGET_ARCH_MIPS | 5754 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |