OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 3483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3494 __ lw(t1, FieldMemOperand(a3, ExternalArray::kLengthOffset)); | 3494 __ lw(t1, FieldMemOperand(a3, ExternalArray::kLengthOffset)); |
3495 __ sra(t2, key, kSmiTagSize); | 3495 __ sra(t2, key, kSmiTagSize); |
3496 // Unsigned comparison catches both negative and too-large values. | 3496 // Unsigned comparison catches both negative and too-large values. |
3497 __ Branch(&miss_force_generic, Ugreater_equal, key, Operand(t1)); | 3497 __ Branch(&miss_force_generic, Ugreater_equal, key, Operand(t1)); |
3498 | 3498 |
3499 __ lw(a3, FieldMemOperand(a3, ExternalArray::kExternalPointerOffset)); | 3499 __ lw(a3, FieldMemOperand(a3, ExternalArray::kExternalPointerOffset)); |
3500 // a3: base pointer of external storage | 3500 // a3: base pointer of external storage |
3501 | 3501 |
3502 // We are not untagging smi key and instead work with it | 3502 // We are not untagging smi key and instead work with it |
3503 // as if it was premultiplied by 2. | 3503 // as if it was premultiplied by 2. |
3504 ASSERT((kSmiTag == 0) && (kSmiTagSize == 1)); | 3504 STATIC_ASSERT((kSmiTag == 0) && (kSmiTagSize == 1)); |
3505 | 3505 |
3506 Register value = a2; | 3506 Register value = a2; |
3507 switch (elements_kind) { | 3507 switch (elements_kind) { |
3508 case JSObject::EXTERNAL_BYTE_ELEMENTS: | 3508 case JSObject::EXTERNAL_BYTE_ELEMENTS: |
3509 __ srl(t2, key, 1); | 3509 __ srl(t2, key, 1); |
3510 __ addu(t3, a3, t2); | 3510 __ addu(t3, a3, t2); |
3511 __ lb(value, MemOperand(t3, 0)); | 3511 __ lb(value, MemOperand(t3, 0)); |
3512 break; | 3512 break; |
3513 case JSObject::EXTERNAL_PIXEL_ELEMENTS: | 3513 case JSObject::EXTERNAL_PIXEL_ELEMENTS: |
3514 case JSObject::EXTERNAL_UNSIGNED_BYTE_ELEMENTS: | 3514 case JSObject::EXTERNAL_UNSIGNED_BYTE_ELEMENTS: |
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4206 // Get the elements array. | 4206 // Get the elements array. |
4207 __ lw(a2, FieldMemOperand(a1, JSObject::kElementsOffset)); | 4207 __ lw(a2, FieldMemOperand(a1, JSObject::kElementsOffset)); |
4208 __ AssertFastElements(a2); | 4208 __ AssertFastElements(a2); |
4209 | 4209 |
4210 // Check that the key is within bounds. | 4210 // Check that the key is within bounds. |
4211 __ lw(a3, FieldMemOperand(a2, FixedArray::kLengthOffset)); | 4211 __ lw(a3, FieldMemOperand(a2, FixedArray::kLengthOffset)); |
4212 __ Branch(&miss_force_generic, hs, a0, Operand(a3)); | 4212 __ Branch(&miss_force_generic, hs, a0, Operand(a3)); |
4213 | 4213 |
4214 // Load the result and make sure it's not the hole. | 4214 // Load the result and make sure it's not the hole. |
4215 __ Addu(a3, a2, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); | 4215 __ Addu(a3, a2, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); |
4216 ASSERT(kSmiTag == 0 && kSmiTagSize < kPointerSizeLog2); | 4216 STATIC_ASSERT(kSmiTag == 0 && kSmiTagSize < kPointerSizeLog2); |
4217 __ sll(t0, a0, kPointerSizeLog2 - kSmiTagSize); | 4217 __ sll(t0, a0, kPointerSizeLog2 - kSmiTagSize); |
4218 __ Addu(t0, t0, a3); | 4218 __ Addu(t0, t0, a3); |
4219 __ lw(t0, MemOperand(t0)); | 4219 __ lw(t0, MemOperand(t0)); |
4220 __ LoadRoot(t1, Heap::kTheHoleValueRootIndex); | 4220 __ LoadRoot(t1, Heap::kTheHoleValueRootIndex); |
4221 __ Branch(&miss_force_generic, eq, t0, Operand(t1)); | 4221 __ Branch(&miss_force_generic, eq, t0, Operand(t1)); |
4222 __ mov(v0, t0); | 4222 __ mov(v0, t0); |
4223 __ Ret(); | 4223 __ Ret(); |
4224 | 4224 |
4225 __ bind(&miss_force_generic); | 4225 __ bind(&miss_force_generic); |
4226 Code* stub = masm->isolate()->builtins()->builtin( | 4226 Code* stub = masm->isolate()->builtins()->builtin( |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4337 if (is_js_array) { | 4337 if (is_js_array) { |
4338 __ lw(scratch, FieldMemOperand(receiver_reg, JSArray::kLengthOffset)); | 4338 __ lw(scratch, FieldMemOperand(receiver_reg, JSArray::kLengthOffset)); |
4339 } else { | 4339 } else { |
4340 __ lw(scratch, FieldMemOperand(elements_reg, FixedArray::kLengthOffset)); | 4340 __ lw(scratch, FieldMemOperand(elements_reg, FixedArray::kLengthOffset)); |
4341 } | 4341 } |
4342 // Compare smis. | 4342 // Compare smis. |
4343 __ Branch(&miss_force_generic, hs, key_reg, Operand(scratch)); | 4343 __ Branch(&miss_force_generic, hs, key_reg, Operand(scratch)); |
4344 | 4344 |
4345 __ Addu(scratch, | 4345 __ Addu(scratch, |
4346 elements_reg, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); | 4346 elements_reg, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); |
4347 ASSERT(kSmiTag == 0 && kSmiTagSize < kPointerSizeLog2); | 4347 STATIC_ASSERT(kSmiTag == 0 && kSmiTagSize < kPointerSizeLog2); |
4348 __ sll(scratch2, key_reg, kPointerSizeLog2 - kSmiTagSize); | 4348 __ sll(scratch2, key_reg, kPointerSizeLog2 - kSmiTagSize); |
4349 __ Addu(scratch3, scratch2, scratch); | 4349 __ Addu(scratch3, scratch2, scratch); |
4350 __ sw(value_reg, MemOperand(scratch3)); | 4350 __ sw(value_reg, MemOperand(scratch3)); |
4351 __ RecordWrite(scratch, Operand(scratch2), receiver_reg , elements_reg); | 4351 __ RecordWrite(scratch, Operand(scratch2), receiver_reg , elements_reg); |
4352 | 4352 |
4353 // value_reg (a0) is preserved. | 4353 // value_reg (a0) is preserved. |
4354 // Done. | 4354 // Done. |
4355 __ Ret(); | 4355 __ Ret(); |
4356 | 4356 |
4357 __ bind(&miss_force_generic); | 4357 __ bind(&miss_force_generic); |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4488 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); | 4488 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); |
4489 __ Jump(ic, RelocInfo::CODE_TARGET); | 4489 __ Jump(ic, RelocInfo::CODE_TARGET); |
4490 } | 4490 } |
4491 | 4491 |
4492 | 4492 |
4493 #undef __ | 4493 #undef __ |
4494 | 4494 |
4495 } } // namespace v8::internal | 4495 } } // namespace v8::internal |
4496 | 4496 |
4497 #endif // V8_TARGET_ARCH_MIPS | 4497 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |