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 3205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3216 bind(&succeed); | 3216 bind(&succeed); |
3217 } | 3217 } |
3218 | 3218 |
3219 | 3219 |
3220 void MacroAssembler::EmitSeqStringSetCharCheck(Register string, | 3220 void MacroAssembler::EmitSeqStringSetCharCheck(Register string, |
3221 Register index, | 3221 Register index, |
3222 Register value, | 3222 Register value, |
3223 uint32_t encoding_mask) { | 3223 uint32_t encoding_mask) { |
3224 Label is_object; | 3224 Label is_object; |
3225 JumpIfNotSmi(string, &is_object, Label::kNear); | 3225 JumpIfNotSmi(string, &is_object, Label::kNear); |
3226 Throw(kNonObject); | 3226 Abort(kNonObject); |
3227 bind(&is_object); | 3227 bind(&is_object); |
3228 | 3228 |
3229 push(value); | 3229 push(value); |
3230 mov(value, FieldOperand(string, HeapObject::kMapOffset)); | 3230 mov(value, FieldOperand(string, HeapObject::kMapOffset)); |
3231 movzx_b(value, FieldOperand(value, Map::kInstanceTypeOffset)); | 3231 movzx_b(value, FieldOperand(value, Map::kInstanceTypeOffset)); |
3232 | 3232 |
3233 and_(value, Immediate(kStringRepresentationMask | kStringEncodingMask)); | 3233 and_(value, Immediate(kStringRepresentationMask | kStringEncodingMask)); |
3234 cmp(value, Immediate(encoding_mask)); | 3234 cmp(value, Immediate(encoding_mask)); |
3235 pop(value); | 3235 pop(value); |
3236 ThrowIf(not_equal, kUnexpectedStringType); | 3236 Check(equal, kUnexpectedStringType); |
3237 | 3237 |
3238 // The index is assumed to be untagged coming in, tag it to compare with the | 3238 // The index is assumed to be untagged coming in, tag it to compare with the |
3239 // string length without using a temp register, it is restored at the end of | 3239 // string length without using a temp register, it is restored at the end of |
3240 // this function. | 3240 // this function. |
3241 SmiTag(index); | 3241 SmiTag(index); |
3242 // Can't use overflow here directly, compiler can't seem to disambiguate. | 3242 Check(no_overflow, kIndexIsTooLarge); |
3243 ThrowIf(NegateCondition(no_overflow), kIndexIsTooLarge); | |
3244 | 3243 |
3245 cmp(index, FieldOperand(string, String::kLengthOffset)); | 3244 cmp(index, FieldOperand(string, String::kLengthOffset)); |
3246 ThrowIf(greater_equal, kIndexIsTooLarge); | 3245 Check(less, kIndexIsTooLarge); |
3247 | 3246 |
3248 cmp(index, Immediate(Smi::FromInt(0))); | 3247 cmp(index, Immediate(Smi::FromInt(0))); |
3249 ThrowIf(less, kIndexIsNegative); | 3248 Check(greater_equal, kIndexIsNegative); |
3250 | 3249 |
3251 // Restore the index | 3250 // Restore the index |
3252 SmiUntag(index); | 3251 SmiUntag(index); |
3253 } | 3252 } |
3254 | 3253 |
3255 | 3254 |
3256 void MacroAssembler::PrepareCallCFunction(int num_arguments, Register scratch) { | 3255 void MacroAssembler::PrepareCallCFunction(int num_arguments, Register scratch) { |
3257 int frame_alignment = OS::ActivationFrameAlignment(); | 3256 int frame_alignment = OS::ActivationFrameAlignment(); |
3258 if (frame_alignment != 0) { | 3257 if (frame_alignment != 0) { |
3259 // Make stack end at alignment and make room for num_arguments words | 3258 // Make stack end at alignment and make room for num_arguments words |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3644 cmp(scratch1, Immediate(DICTIONARY_ELEMENTS)); | 3643 cmp(scratch1, Immediate(DICTIONARY_ELEMENTS)); |
3645 j(equal, found); | 3644 j(equal, found); |
3646 mov(current, FieldOperand(current, Map::kPrototypeOffset)); | 3645 mov(current, FieldOperand(current, Map::kPrototypeOffset)); |
3647 cmp(current, Immediate(factory->null_value())); | 3646 cmp(current, Immediate(factory->null_value())); |
3648 j(not_equal, &loop_again); | 3647 j(not_equal, &loop_again); |
3649 } | 3648 } |
3650 | 3649 |
3651 } } // namespace v8::internal | 3650 } } // namespace v8::internal |
3652 | 3651 |
3653 #endif // V8_TARGET_ARCH_IA32 | 3652 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |