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 3469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3480 ASSERT(ToRegister(instr->key()).is(r1)); | 3480 ASSERT(ToRegister(instr->key()).is(r1)); |
3481 ASSERT(ToRegister(instr->value()).is(r0)); | 3481 ASSERT(ToRegister(instr->value()).is(r0)); |
3482 | 3482 |
3483 Handle<Code> ic = instr->strict_mode() | 3483 Handle<Code> ic = instr->strict_mode() |
3484 ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict() | 3484 ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict() |
3485 : isolate()->builtins()->KeyedStoreIC_Initialize(); | 3485 : isolate()->builtins()->KeyedStoreIC_Initialize(); |
3486 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3486 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
3487 } | 3487 } |
3488 | 3488 |
3489 | 3489 |
| 3490 void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) { |
| 3491 Register object_reg = ToRegister(instr->object()); |
| 3492 Register new_map_reg = ToRegister(instr->new_map_reg()); |
| 3493 Register scratch = scratch0(); |
| 3494 |
| 3495 Handle<Map> from_map = instr->original_map(); |
| 3496 Handle<Map> to_map = instr->transitioned_map(); |
| 3497 ElementsKind from_kind = from_map->elements_kind(); |
| 3498 ElementsKind to_kind = to_map->elements_kind(); |
| 3499 |
| 3500 Label not_applicable; |
| 3501 __ ldr(scratch, FieldMemOperand(object_reg, HeapObject::kMapOffset)); |
| 3502 __ cmp(scratch, Operand(from_map)); |
| 3503 __ b(ne, ¬_applicable); |
| 3504 __ mov(new_map_reg, Operand(to_map)); |
| 3505 if (from_kind == FAST_SMI_ONLY_ELEMENTS && to_kind == FAST_ELEMENTS) { |
| 3506 __ str(new_map_reg, FieldMemOperand(object_reg, HeapObject::kMapOffset)); |
| 3507 // Write barrier. |
| 3508 __ RecordWriteField(object_reg, HeapObject::kMapOffset, new_map_reg, |
| 3509 scratch, kLRHasBeenSaved, kDontSaveFPRegs); |
| 3510 } else if (from_kind == FAST_SMI_ONLY_ELEMENTS && |
| 3511 to_kind == FAST_DOUBLE_ELEMENTS) { |
| 3512 Register fixed_object_reg = ToRegister(instr->temp_reg()); |
| 3513 ASSERT(fixed_object_reg.is(r2)); |
| 3514 ASSERT(new_map_reg.is(r3)); |
| 3515 __ mov(fixed_object_reg, object_reg); |
| 3516 CallCode(isolate()->builtins()->TransitionElementsSmiToDouble(), |
| 3517 RelocInfo::CODE_TARGET, instr); |
| 3518 } else if (from_kind == FAST_DOUBLE_ELEMENTS && to_kind == FAST_ELEMENTS) { |
| 3519 Register fixed_object_reg = ToRegister(instr->temp_reg()); |
| 3520 ASSERT(fixed_object_reg.is(r2)); |
| 3521 ASSERT(new_map_reg.is(r3)); |
| 3522 __ mov(fixed_object_reg, object_reg); |
| 3523 CallCode(isolate()->builtins()->TransitionElementsDoubleToObject(), |
| 3524 RelocInfo::CODE_TARGET, instr); |
| 3525 } else { |
| 3526 UNREACHABLE(); |
| 3527 } |
| 3528 __ bind(¬_applicable); |
| 3529 } |
| 3530 |
| 3531 |
3490 void LCodeGen::DoStringAdd(LStringAdd* instr) { | 3532 void LCodeGen::DoStringAdd(LStringAdd* instr) { |
3491 __ push(ToRegister(instr->left())); | 3533 __ push(ToRegister(instr->left())); |
3492 __ push(ToRegister(instr->right())); | 3534 __ push(ToRegister(instr->right())); |
3493 StringAddStub stub(NO_STRING_CHECK_IN_STUB); | 3535 StringAddStub stub(NO_STRING_CHECK_IN_STUB); |
3494 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 3536 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
3495 } | 3537 } |
3496 | 3538 |
3497 | 3539 |
3498 void LCodeGen::DoStringCharCodeAt(LStringCharCodeAt* instr) { | 3540 void LCodeGen::DoStringCharCodeAt(LStringCharCodeAt* instr) { |
3499 class DeferredStringCharCodeAt: public LDeferredCode { | 3541 class DeferredStringCharCodeAt: public LDeferredCode { |
(...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4566 ASSERT(osr_pc_offset_ == -1); | 4608 ASSERT(osr_pc_offset_ == -1); |
4567 osr_pc_offset_ = masm()->pc_offset(); | 4609 osr_pc_offset_ = masm()->pc_offset(); |
4568 } | 4610 } |
4569 | 4611 |
4570 | 4612 |
4571 | 4613 |
4572 | 4614 |
4573 #undef __ | 4615 #undef __ |
4574 | 4616 |
4575 } } // namespace v8::internal | 4617 } } // namespace v8::internal |
OLD | NEW |