| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #if V8_TARGET_ARCH_X64 | 5 #if V8_TARGET_ARCH_X64 |
| 6 | 6 |
| 7 #include "src/ic/handler-compiler.h" | 7 #include "src/ic/handler-compiler.h" |
| 8 | 8 |
| 9 #include "src/api-arguments.h" | 9 #include "src/api-arguments.h" |
| 10 #include "src/field-type.h" | 10 #include "src/field-type.h" |
| 11 #include "src/ic/call-optimization.h" | 11 #include "src/ic/call-optimization.h" |
| 12 #include "src/ic/ic.h" | 12 #include "src/ic/ic.h" |
| 13 #include "src/isolate-inl.h" | 13 #include "src/isolate-inl.h" |
| 14 | 14 |
| 15 namespace v8 { | 15 namespace v8 { |
| 16 namespace internal { | 16 namespace internal { |
| 17 | 17 |
| 18 #define __ ACCESS_MASM(masm) | 18 #define __ ACCESS_MASM(masm) |
| 19 | 19 |
| 20 void PropertyHandlerCompiler::PushVectorAndSlot(Register vector, | 20 void PropertyHandlerCompiler::PushVectorAndSlot(Register vector, |
| 21 Register slot) { | 21 Register slot) { |
| 22 MacroAssembler* masm = this->masm(); | 22 MacroAssembler* masm = this->masm(); |
| 23 STATIC_ASSERT(LoadWithVectorDescriptor::kSlot < |
| 24 LoadWithVectorDescriptor::kVector); |
| 25 STATIC_ASSERT(StoreWithVectorDescriptor::kSlot < |
| 26 StoreWithVectorDescriptor::kVector); |
| 27 STATIC_ASSERT(StoreTransitionDescriptor::kSlot < |
| 28 StoreTransitionDescriptor::kVector); |
| 29 __ Push(slot); |
| 23 __ Push(vector); | 30 __ Push(vector); |
| 24 __ Push(slot); | |
| 25 } | 31 } |
| 26 | 32 |
| 27 | 33 |
| 28 void PropertyHandlerCompiler::PopVectorAndSlot(Register vector, Register slot) { | 34 void PropertyHandlerCompiler::PopVectorAndSlot(Register vector, Register slot) { |
| 29 MacroAssembler* masm = this->masm(); | 35 MacroAssembler* masm = this->masm(); |
| 36 __ Pop(vector); |
| 30 __ Pop(slot); | 37 __ Pop(slot); |
| 31 __ Pop(vector); | |
| 32 } | 38 } |
| 33 | 39 |
| 34 | 40 |
| 35 void PropertyHandlerCompiler::DiscardVectorAndSlot() { | 41 void PropertyHandlerCompiler::DiscardVectorAndSlot() { |
| 36 MacroAssembler* masm = this->masm(); | 42 MacroAssembler* masm = this->masm(); |
| 37 // Remove vector and slot. | 43 // Remove vector and slot. |
| 38 __ addp(rsp, Immediate(2 * kPointerSize)); | 44 __ addp(rsp, Immediate(2 * kPointerSize)); |
| 39 } | 45 } |
| 40 | 46 |
| 47 void PropertyHandlerCompiler::PushReturnAddress(Register tmp) { UNREACHABLE(); } |
| 48 |
| 49 void PropertyHandlerCompiler::PopReturnAddress(Register tmp) { UNREACHABLE(); } |
| 41 | 50 |
| 42 void PropertyHandlerCompiler::GenerateDictionaryNegativeLookup( | 51 void PropertyHandlerCompiler::GenerateDictionaryNegativeLookup( |
| 43 MacroAssembler* masm, Label* miss_label, Register receiver, | 52 MacroAssembler* masm, Label* miss_label, Register receiver, |
| 44 Handle<Name> name, Register scratch0, Register scratch1) { | 53 Handle<Name> name, Register scratch0, Register scratch1) { |
| 45 DCHECK(name->IsUniqueName()); | 54 DCHECK(name->IsUniqueName()); |
| 46 DCHECK(!receiver.is(scratch0)); | 55 DCHECK(!receiver.is(scratch0)); |
| 47 Counters* counters = masm->isolate()->counters(); | 56 Counters* counters = masm->isolate()->counters(); |
| 48 __ IncrementCounter(counters->negative_lookups(), 1); | 57 __ IncrementCounter(counters->negative_lookups(), 1); |
| 49 __ IncrementCounter(counters->negative_lookups_miss(), 1); | 58 __ IncrementCounter(counters->negative_lookups_miss(), 1); |
| 50 | 59 |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 __ Move(this->name(), name); | 369 __ Move(this->name(), name); |
| 361 } | 370 } |
| 362 } | 371 } |
| 363 | 372 |
| 364 | 373 |
| 365 void NamedStoreHandlerCompiler::GenerateRestoreName(Handle<Name> name) { | 374 void NamedStoreHandlerCompiler::GenerateRestoreName(Handle<Name> name) { |
| 366 __ Move(this->name(), name); | 375 __ Move(this->name(), name); |
| 367 } | 376 } |
| 368 | 377 |
| 369 | 378 |
| 370 void NamedStoreHandlerCompiler::RearrangeVectorAndSlot( | |
| 371 Register current_map, Register destination_map) { | |
| 372 DCHECK(false); // Not implemented. | |
| 373 } | |
| 374 | |
| 375 | |
| 376 void NamedStoreHandlerCompiler::GenerateRestoreMap(Handle<Map> transition, | 379 void NamedStoreHandlerCompiler::GenerateRestoreMap(Handle<Map> transition, |
| 377 Register map_reg, | 380 Register map_reg, |
| 378 Register scratch, | 381 Register scratch, |
| 379 Label* miss) { | 382 Label* miss) { |
| 380 Handle<WeakCell> cell = Map::WeakCellForMap(transition); | 383 Handle<WeakCell> cell = Map::WeakCellForMap(transition); |
| 381 DCHECK(!map_reg.is(scratch)); | 384 DCHECK(!map_reg.is(scratch)); |
| 382 __ LoadWeakValue(map_reg, cell, miss); | 385 __ LoadWeakValue(map_reg, cell, miss); |
| 383 if (transition->CanBeDeprecated()) { | 386 if (transition->CanBeDeprecated()) { |
| 384 __ movl(scratch, FieldOperand(map_reg, Map::kBitField3Offset)); | 387 __ movl(scratch, FieldOperand(map_reg, Map::kBitField3Offset)); |
| 385 __ andl(scratch, Immediate(Map::Deprecated::kMask)); | 388 __ andl(scratch, Immediate(Map::Deprecated::kMask)); |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 708 // Return the generated code. | 711 // Return the generated code. |
| 709 return GetCode(kind(), name); | 712 return GetCode(kind(), name); |
| 710 } | 713 } |
| 711 | 714 |
| 712 | 715 |
| 713 #undef __ | 716 #undef __ |
| 714 } // namespace internal | 717 } // namespace internal |
| 715 } // namespace v8 | 718 } // namespace v8 |
| 716 | 719 |
| 717 #endif // V8_TARGET_ARCH_X64 | 720 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |