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_ARM | 7 #if V8_TARGET_ARCH_ARM |
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 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
831 if (!miss->is_unused()) { | 831 if (!miss->is_unused()) { |
832 Label success; | 832 Label success; |
833 __ b(&success); | 833 __ b(&success); |
834 GenerateRestoreName(miss, name); | 834 GenerateRestoreName(miss, name); |
835 TailCallBuiltin(masm(), MissBuiltin(kind())); | 835 TailCallBuiltin(masm(), MissBuiltin(kind())); |
836 __ bind(&success); | 836 __ bind(&success); |
837 } | 837 } |
838 } | 838 } |
839 | 839 |
840 | 840 |
841 Register NamedLoadHandlerCompiler::CallbackFrontend(Register object_reg, | |
842 Handle<Name> name, | |
843 Handle<Object> callback) { | |
844 Label miss; | |
845 | |
846 Register reg = FrontendHeader(object_reg, name, &miss); | |
847 | |
848 if (!holder()->HasFastProperties()) { | |
849 DCHECK(!holder()->IsGlobalObject()); | |
850 DCHECK(!reg.is(scratch2())); | |
851 DCHECK(!reg.is(scratch3())); | |
852 DCHECK(!reg.is(scratch4())); | |
853 | |
854 // Load the properties dictionary. | |
855 Register dictionary = scratch4(); | |
856 __ ldr(dictionary, FieldMemOperand(reg, JSObject::kPropertiesOffset)); | |
857 | |
858 // Probe the dictionary. | |
859 Label probe_done; | |
860 NameDictionaryLookupStub::GeneratePositiveLookup(masm(), | |
861 &miss, | |
862 &probe_done, | |
863 dictionary, | |
864 this->name(), | |
865 scratch2(), | |
866 scratch3()); | |
867 __ bind(&probe_done); | |
868 | |
869 // If probing finds an entry in the dictionary, scratch3 contains the | |
870 // pointer into the dictionary. Check that the value is the callback. | |
871 Register pointer = scratch3(); | |
872 const int kElementsStartOffset = NameDictionary::kHeaderSize + | |
873 NameDictionary::kElementsStartIndex * kPointerSize; | |
874 const int kValueOffset = kElementsStartOffset + kPointerSize; | |
875 __ ldr(scratch2(), FieldMemOperand(pointer, kValueOffset)); | |
876 __ cmp(scratch2(), Operand(callback)); | |
877 __ b(ne, &miss); | |
878 } | |
879 | |
880 FrontendFooter(name, &miss); | |
881 return reg; | |
882 } | |
883 | |
884 | |
885 void NamedLoadHandlerCompiler::GenerateLoadField( | 841 void NamedLoadHandlerCompiler::GenerateLoadField( |
886 Register reg, FieldIndex field, Representation representation) { | 842 Register reg, FieldIndex field, Representation representation) { |
887 if (!reg.is(receiver())) __ mov(receiver(), reg); | 843 if (!reg.is(receiver())) __ mov(receiver(), reg); |
888 LoadFieldStub stub(isolate(), field); | 844 LoadFieldStub stub(isolate(), field); |
889 GenerateTailCall(masm(), stub.GetCode()); | 845 GenerateTailCall(masm(), stub.GetCode()); |
890 } | 846 } |
891 | 847 |
892 | 848 |
893 void NamedLoadHandlerCompiler::GenerateLoadConstant(Handle<Object> value) { | 849 void NamedLoadHandlerCompiler::GenerateLoadConstant(Handle<Object> value) { |
894 // Return the constant value. | 850 // Return the constant value. |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1327 | 1283 |
1328 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 1284 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
1329 } | 1285 } |
1330 | 1286 |
1331 | 1287 |
1332 #undef __ | 1288 #undef __ |
1333 | 1289 |
1334 } } // namespace v8::internal | 1290 } } // namespace v8::internal |
1335 | 1291 |
1336 #endif // V8_TARGET_ARCH_ARM | 1292 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |