OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
8 | 8 |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/ic-inl.h" | 10 #include "src/ic-inl.h" |
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
800 if (!miss->is_unused()) { | 800 if (!miss->is_unused()) { |
801 Label success; | 801 Label success; |
802 __ jmp(&success); | 802 __ jmp(&success); |
803 GenerateRestoreName(miss, name); | 803 GenerateRestoreName(miss, name); |
804 TailCallBuiltin(masm(), MissBuiltin(kind())); | 804 TailCallBuiltin(masm(), MissBuiltin(kind())); |
805 __ bind(&success); | 805 __ bind(&success); |
806 } | 806 } |
807 } | 807 } |
808 | 808 |
809 | 809 |
810 Register NamedLoadHandlerCompiler::CallbackFrontend(Register object_reg, | |
811 Handle<Name> name, | |
812 Handle<Object> callback) { | |
813 Label miss; | |
814 | |
815 Register reg = FrontendHeader(object_reg, name, &miss); | |
816 | |
817 if (!holder()->HasFastProperties()) { | |
818 DCHECK(!holder()->IsGlobalObject()); | |
819 DCHECK(!reg.is(scratch2())); | |
820 DCHECK(!reg.is(scratch3())); | |
821 Register dictionary = scratch1(); | |
822 bool must_preserve_dictionary_reg = reg.is(dictionary); | |
823 | |
824 // Load the properties dictionary. | |
825 if (must_preserve_dictionary_reg) { | |
826 __ push(dictionary); | |
827 } | |
828 __ mov(dictionary, FieldOperand(reg, JSObject::kPropertiesOffset)); | |
829 | |
830 // Probe the dictionary. | |
831 Label probe_done, pop_and_miss; | |
832 NameDictionaryLookupStub::GeneratePositiveLookup(masm(), | |
833 &pop_and_miss, | |
834 &probe_done, | |
835 dictionary, | |
836 this->name(), | |
837 scratch2(), | |
838 scratch3()); | |
839 __ bind(&pop_and_miss); | |
840 if (must_preserve_dictionary_reg) { | |
841 __ pop(dictionary); | |
842 } | |
843 __ jmp(&miss); | |
844 __ bind(&probe_done); | |
845 | |
846 // If probing finds an entry in the dictionary, scratch2 contains the | |
847 // index into the dictionary. Check that the value is the callback. | |
848 Register index = scratch2(); | |
849 const int kElementsStartOffset = | |
850 NameDictionary::kHeaderSize + | |
851 NameDictionary::kElementsStartIndex * kPointerSize; | |
852 const int kValueOffset = kElementsStartOffset + kPointerSize; | |
853 __ mov(scratch3(), | |
854 Operand(dictionary, index, times_4, kValueOffset - kHeapObjectTag)); | |
855 if (must_preserve_dictionary_reg) { | |
856 __ pop(dictionary); | |
857 } | |
858 __ cmp(scratch3(), callback); | |
859 __ j(not_equal, &miss); | |
860 } | |
861 | |
862 FrontendFooter(name, &miss); | |
863 return reg; | |
864 } | |
865 | |
866 | |
867 void NamedLoadHandlerCompiler::GenerateLoadField( | 810 void NamedLoadHandlerCompiler::GenerateLoadField( |
868 Register reg, FieldIndex field, Representation representation) { | 811 Register reg, FieldIndex field, Representation representation) { |
869 if (!reg.is(receiver())) __ mov(receiver(), reg); | 812 if (!reg.is(receiver())) __ mov(receiver(), reg); |
870 LoadFieldStub stub(isolate(), field); | 813 LoadFieldStub stub(isolate(), field); |
871 GenerateTailCall(masm(), stub.GetCode()); | 814 GenerateTailCall(masm(), stub.GetCode()); |
872 } | 815 } |
873 | 816 |
874 | 817 |
875 void NamedLoadHandlerCompiler::GenerateLoadCallback( | 818 void NamedLoadHandlerCompiler::GenerateLoadCallback( |
876 Register reg, Handle<ExecutableAccessorInfo> callback) { | 819 Register reg, Handle<ExecutableAccessorInfo> callback) { |
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1338 // ----------------------------------- | 1281 // ----------------------------------- |
1339 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 1282 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
1340 } | 1283 } |
1341 | 1284 |
1342 | 1285 |
1343 #undef __ | 1286 #undef __ |
1344 | 1287 |
1345 } } // namespace v8::internal | 1288 } } // namespace v8::internal |
1346 | 1289 |
1347 #endif // V8_TARGET_ARCH_IA32 | 1290 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |