| 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 2475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2486 AllowDeferredHandleDereference vector_structure_check; | 2486 AllowDeferredHandleDereference vector_structure_check; |
| 2487 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); | 2487 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); |
| 2488 __ li(vector_register, vector); | 2488 __ li(vector_register, vector); |
| 2489 // No need to allocate this register. | 2489 // No need to allocate this register. |
| 2490 FeedbackVectorSlot slot = instr->hydrogen()->slot(); | 2490 FeedbackVectorSlot slot = instr->hydrogen()->slot(); |
| 2491 int index = vector->GetIndex(slot); | 2491 int index = vector->GetIndex(slot); |
| 2492 __ li(slot_register, Operand(Smi::FromInt(index))); | 2492 __ li(slot_register, Operand(Smi::FromInt(index))); |
| 2493 } | 2493 } |
| 2494 | 2494 |
| 2495 | 2495 |
| 2496 template <class T> | |
| 2497 void LCodeGen::EmitVectorStoreICRegisters(T* instr) { | |
| 2498 Register vector_register = ToRegister(instr->temp_vector()); | |
| 2499 Register slot_register = ToRegister(instr->temp_slot()); | |
| 2500 | |
| 2501 AllowDeferredHandleDereference vector_structure_check; | |
| 2502 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); | |
| 2503 __ li(vector_register, vector); | |
| 2504 FeedbackVectorSlot slot = instr->hydrogen()->slot(); | |
| 2505 int index = vector->GetIndex(slot); | |
| 2506 __ li(slot_register, Operand(Smi::FromInt(index))); | |
| 2507 } | |
| 2508 | |
| 2509 | |
| 2510 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { | 2496 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { |
| 2511 DCHECK(ToRegister(instr->context()).is(cp)); | 2497 DCHECK(ToRegister(instr->context()).is(cp)); |
| 2512 DCHECK(ToRegister(instr->result()).is(v0)); | 2498 DCHECK(ToRegister(instr->result()).is(v0)); |
| 2513 | 2499 |
| 2514 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); | 2500 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); |
| 2515 Handle<Code> ic = | 2501 Handle<Code> ic = |
| 2516 CodeFactory::LoadGlobalICInOptimizedCode(isolate(), instr->typeof_mode()) | 2502 CodeFactory::LoadGlobalICInOptimizedCode(isolate(), instr->typeof_mode()) |
| 2517 .code(); | 2503 .code(); |
| 2518 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2504 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 2519 } | 2505 } |
| (...skipping 1479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3999 if (instr->is_fixed_typed_array()) { | 3985 if (instr->is_fixed_typed_array()) { |
| 4000 DoStoreKeyedExternalArray(instr); | 3986 DoStoreKeyedExternalArray(instr); |
| 4001 } else if (instr->hydrogen()->value()->representation().IsDouble()) { | 3987 } else if (instr->hydrogen()->value()->representation().IsDouble()) { |
| 4002 DoStoreKeyedFixedDoubleArray(instr); | 3988 DoStoreKeyedFixedDoubleArray(instr); |
| 4003 } else { | 3989 } else { |
| 4004 DoStoreKeyedFixedArray(instr); | 3990 DoStoreKeyedFixedArray(instr); |
| 4005 } | 3991 } |
| 4006 } | 3992 } |
| 4007 | 3993 |
| 4008 | 3994 |
| 4009 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { | |
| 4010 DCHECK(ToRegister(instr->context()).is(cp)); | |
| 4011 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); | |
| 4012 DCHECK(ToRegister(instr->key()).is(StoreDescriptor::NameRegister())); | |
| 4013 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); | |
| 4014 | |
| 4015 EmitVectorStoreICRegisters<LStoreKeyedGeneric>(instr); | |
| 4016 | |
| 4017 Handle<Code> ic = CodeFactory::KeyedStoreICInOptimizedCode( | |
| 4018 isolate(), instr->language_mode()) | |
| 4019 .code(); | |
| 4020 CallCode(ic, RelocInfo::CODE_TARGET, instr); | |
| 4021 } | |
| 4022 | |
| 4023 | |
| 4024 void LCodeGen::DoMaybeGrowElements(LMaybeGrowElements* instr) { | 3995 void LCodeGen::DoMaybeGrowElements(LMaybeGrowElements* instr) { |
| 4025 class DeferredMaybeGrowElements final : public LDeferredCode { | 3996 class DeferredMaybeGrowElements final : public LDeferredCode { |
| 4026 public: | 3997 public: |
| 4027 DeferredMaybeGrowElements(LCodeGen* codegen, LMaybeGrowElements* instr) | 3998 DeferredMaybeGrowElements(LCodeGen* codegen, LMaybeGrowElements* instr) |
| 4028 : LDeferredCode(codegen), instr_(instr) {} | 3999 : LDeferredCode(codegen), instr_(instr) {} |
| 4029 void Generate() override { codegen()->DoDeferredMaybeGrowElements(instr_); } | 4000 void Generate() override { codegen()->DoDeferredMaybeGrowElements(instr_); } |
| 4030 LInstruction* instr() override { return instr_; } | 4001 LInstruction* instr() override { return instr_; } |
| 4031 | 4002 |
| 4032 private: | 4003 private: |
| 4033 LMaybeGrowElements* instr_; | 4004 LMaybeGrowElements* instr_; |
| (...skipping 1487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5521 __ lw(result, FieldMemOperand(scratch, | 5492 __ lw(result, FieldMemOperand(scratch, |
| 5522 FixedArray::kHeaderSize - kPointerSize)); | 5493 FixedArray::kHeaderSize - kPointerSize)); |
| 5523 __ bind(deferred->exit()); | 5494 __ bind(deferred->exit()); |
| 5524 __ bind(&done); | 5495 __ bind(&done); |
| 5525 } | 5496 } |
| 5526 | 5497 |
| 5527 #undef __ | 5498 #undef __ |
| 5528 | 5499 |
| 5529 } // namespace internal | 5500 } // namespace internal |
| 5530 } // namespace v8 | 5501 } // namespace v8 |
| OLD | NEW |