OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved.7 | 1 // Copyright 2012 the V8 project authors. All rights reserved.7 |
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 2458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2469 Register reg = ToRegister(instr->parameter_count()); | 2469 Register reg = ToRegister(instr->parameter_count()); |
2470 // The argument count parameter is a smi | 2470 // The argument count parameter is a smi |
2471 __ SmiUntag(reg); | 2471 __ SmiUntag(reg); |
2472 __ Lsa(sp, sp, reg, kPointerSizeLog2); | 2472 __ Lsa(sp, sp, reg, kPointerSizeLog2); |
2473 } | 2473 } |
2474 | 2474 |
2475 __ Jump(ra); | 2475 __ Jump(ra); |
2476 } | 2476 } |
2477 | 2477 |
2478 | 2478 |
2479 template <class T> | |
2480 void LCodeGen::EmitVectorLoadICRegisters(T* instr) { | |
2481 Register vector_register = ToRegister(instr->temp_vector()); | |
2482 Register slot_register = LoadWithVectorDescriptor::SlotRegister(); | |
2483 DCHECK(vector_register.is(LoadWithVectorDescriptor::VectorRegister())); | |
2484 DCHECK(slot_register.is(a0)); | |
2485 | |
2486 AllowDeferredHandleDereference vector_structure_check; | |
2487 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); | |
2488 __ li(vector_register, vector); | |
2489 // No need to allocate this register. | |
2490 FeedbackVectorSlot slot = instr->hydrogen()->slot(); | |
2491 int index = vector->GetIndex(slot); | |
2492 __ li(slot_register, Operand(Smi::FromInt(index))); | |
2493 } | |
2494 | |
2495 | |
2496 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 2479 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
2497 Register context = ToRegister(instr->context()); | 2480 Register context = ToRegister(instr->context()); |
2498 Register result = ToRegister(instr->result()); | 2481 Register result = ToRegister(instr->result()); |
2499 | 2482 |
2500 __ lw(result, ContextMemOperand(context, instr->slot_index())); | 2483 __ lw(result, ContextMemOperand(context, instr->slot_index())); |
2501 if (instr->hydrogen()->RequiresHoleCheck()) { | 2484 if (instr->hydrogen()->RequiresHoleCheck()) { |
2502 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); | 2485 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); |
2503 | 2486 |
2504 if (instr->hydrogen()->DeoptimizesOnHole()) { | 2487 if (instr->hydrogen()->DeoptimizesOnHole()) { |
2505 DeoptimizeIf(eq, instr, DeoptimizeReason::kHole, result, Operand(at)); | 2488 DeoptimizeIf(eq, instr, DeoptimizeReason::kHole, result, Operand(at)); |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2868 return MemOperand(scratch0(), base_offset); | 2851 return MemOperand(scratch0(), base_offset); |
2869 } else { | 2852 } else { |
2870 DCHECK_EQ(-1, shift_size); | 2853 DCHECK_EQ(-1, shift_size); |
2871 __ sra(scratch0(), key, 1); | 2854 __ sra(scratch0(), key, 1); |
2872 __ Addu(scratch0(), base, scratch0()); | 2855 __ Addu(scratch0(), base, scratch0()); |
2873 return MemOperand(scratch0(), base_offset); | 2856 return MemOperand(scratch0(), base_offset); |
2874 } | 2857 } |
2875 } | 2858 } |
2876 | 2859 |
2877 | 2860 |
2878 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { | |
2879 DCHECK(ToRegister(instr->context()).is(cp)); | |
2880 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | |
2881 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); | |
2882 | |
2883 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); | |
2884 | |
2885 Handle<Code> ic = CodeFactory::KeyedLoadICInOptimizedCode(isolate()).code(); | |
2886 CallCode(ic, RelocInfo::CODE_TARGET, instr); | |
2887 } | |
2888 | |
2889 | |
2890 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { | 2861 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { |
2891 Register scratch = scratch0(); | 2862 Register scratch = scratch0(); |
2892 Register temp = scratch1(); | 2863 Register temp = scratch1(); |
2893 Register result = ToRegister(instr->result()); | 2864 Register result = ToRegister(instr->result()); |
2894 | 2865 |
2895 if (instr->hydrogen()->from_inlined()) { | 2866 if (instr->hydrogen()->from_inlined()) { |
2896 __ Subu(result, sp, 2 * kPointerSize); | 2867 __ Subu(result, sp, 2 * kPointerSize); |
2897 } else if (instr->hydrogen()->arguments_adaptor()) { | 2868 } else if (instr->hydrogen()->arguments_adaptor()) { |
2898 // Check if the calling frame is an arguments adaptor frame. | 2869 // Check if the calling frame is an arguments adaptor frame. |
2899 Label done, adapted; | 2870 Label done, adapted; |
(...skipping 2567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5467 __ lw(result, FieldMemOperand(scratch, | 5438 __ lw(result, FieldMemOperand(scratch, |
5468 FixedArray::kHeaderSize - kPointerSize)); | 5439 FixedArray::kHeaderSize - kPointerSize)); |
5469 __ bind(deferred->exit()); | 5440 __ bind(deferred->exit()); |
5470 __ bind(&done); | 5441 __ bind(&done); |
5471 } | 5442 } |
5472 | 5443 |
5473 #undef __ | 5444 #undef __ |
5474 | 5445 |
5475 } // namespace internal | 5446 } // namespace internal |
5476 } // namespace v8 | 5447 } // namespace v8 |
OLD | NEW |