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 3415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3426 return stack_passed_words; | 3426 return stack_passed_words; |
3427 } | 3427 } |
3428 | 3428 |
3429 | 3429 |
3430 void MacroAssembler::EmitSeqStringSetCharCheck(Register string, | 3430 void MacroAssembler::EmitSeqStringSetCharCheck(Register string, |
3431 Register index, | 3431 Register index, |
3432 Register value, | 3432 Register value, |
3433 uint32_t encoding_mask) { | 3433 uint32_t encoding_mask) { |
3434 Label is_object; | 3434 Label is_object; |
3435 SmiTst(string); | 3435 SmiTst(string); |
3436 ThrowIf(eq, kNonObject); | 3436 Check(ne, kNonObject); |
3437 | 3437 |
3438 ldr(ip, FieldMemOperand(string, HeapObject::kMapOffset)); | 3438 ldr(ip, FieldMemOperand(string, HeapObject::kMapOffset)); |
3439 ldrb(ip, FieldMemOperand(ip, Map::kInstanceTypeOffset)); | 3439 ldrb(ip, FieldMemOperand(ip, Map::kInstanceTypeOffset)); |
3440 | 3440 |
3441 and_(ip, ip, Operand(kStringRepresentationMask | kStringEncodingMask)); | 3441 and_(ip, ip, Operand(kStringRepresentationMask | kStringEncodingMask)); |
3442 cmp(ip, Operand(encoding_mask)); | 3442 cmp(ip, Operand(encoding_mask)); |
3443 ThrowIf(ne, kUnexpectedStringType); | 3443 Check(eq, kUnexpectedStringType); |
3444 | 3444 |
3445 // The index is assumed to be untagged coming in, tag it to compare with the | 3445 // The index is assumed to be untagged coming in, tag it to compare with the |
3446 // string length without using a temp register, it is restored at the end of | 3446 // string length without using a temp register, it is restored at the end of |
3447 // this function. | 3447 // this function. |
3448 Label index_tag_ok, index_tag_bad; | 3448 Label index_tag_ok, index_tag_bad; |
3449 TrySmiTag(index, index, &index_tag_bad); | 3449 TrySmiTag(index, index, &index_tag_bad); |
3450 b(&index_tag_ok); | 3450 b(&index_tag_ok); |
3451 bind(&index_tag_bad); | 3451 bind(&index_tag_bad); |
3452 Throw(kIndexIsTooLarge); | 3452 Abort(kIndexIsTooLarge); |
3453 bind(&index_tag_ok); | 3453 bind(&index_tag_ok); |
3454 | 3454 |
3455 ldr(ip, FieldMemOperand(string, String::kLengthOffset)); | 3455 ldr(ip, FieldMemOperand(string, String::kLengthOffset)); |
3456 cmp(index, ip); | 3456 cmp(index, ip); |
3457 ThrowIf(ge, kIndexIsTooLarge); | 3457 Check(lt, kIndexIsTooLarge); |
3458 | 3458 |
3459 cmp(index, Operand(Smi::FromInt(0))); | 3459 cmp(index, Operand(Smi::FromInt(0))); |
3460 ThrowIf(lt, kIndexIsNegative); | 3460 Check(ge, kIndexIsNegative); |
3461 | 3461 |
3462 SmiUntag(index, index); | 3462 SmiUntag(index, index); |
3463 } | 3463 } |
3464 | 3464 |
3465 | 3465 |
3466 void MacroAssembler::PrepareCallCFunction(int num_reg_arguments, | 3466 void MacroAssembler::PrepareCallCFunction(int num_reg_arguments, |
3467 int num_double_arguments, | 3467 int num_double_arguments, |
3468 Register scratch) { | 3468 Register scratch) { |
3469 int frame_alignment = ActivationFrameAlignment(); | 3469 int frame_alignment = ActivationFrameAlignment(); |
3470 int stack_passed_arguments = CalculateStackPassedWords( | 3470 int stack_passed_arguments = CalculateStackPassedWords( |
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4076 void CodePatcher::EmitCondition(Condition cond) { | 4076 void CodePatcher::EmitCondition(Condition cond) { |
4077 Instr instr = Assembler::instr_at(masm_.pc_); | 4077 Instr instr = Assembler::instr_at(masm_.pc_); |
4078 instr = (instr & ~kCondMask) | cond; | 4078 instr = (instr & ~kCondMask) | cond; |
4079 masm_.emit(instr); | 4079 masm_.emit(instr); |
4080 } | 4080 } |
4081 | 4081 |
4082 | 4082 |
4083 } } // namespace v8::internal | 4083 } } // namespace v8::internal |
4084 | 4084 |
4085 #endif // V8_TARGET_ARCH_ARM | 4085 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |