OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
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 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
809 Register scratch2, | 809 Register scratch2, |
810 Register unused, | 810 Register unused, |
811 Label* miss_label, | 811 Label* miss_label, |
812 Label* slow) { | 812 Label* slow) { |
813 int descriptor = transition->LastAdded(); | 813 int descriptor = transition->LastAdded(); |
814 DescriptorArray* descriptors = transition->instance_descriptors(); | 814 DescriptorArray* descriptors = transition->instance_descriptors(); |
815 PropertyDetails details = descriptors->GetDetails(descriptor); | 815 PropertyDetails details = descriptors->GetDetails(descriptor); |
816 Representation representation = details.representation(); | 816 Representation representation = details.representation(); |
817 ASSERT(!representation.IsNone()); | 817 ASSERT(!representation.IsNone()); |
818 | 818 |
819 if (details.type() == CONSTANT_FUNCTION) { | 819 if (details.type() == CONSTANT) { |
820 Handle<HeapObject> constant( | 820 Handle<Object> constant(descriptors->GetValue(descriptor), masm->isolate()); |
821 HeapObject::cast(descriptors->GetValue(descriptor))); | 821 __ CmpObject(value_reg, constant); |
822 __ LoadHeapObject(scratch1, constant); | |
823 __ cmp(value_reg, scratch1); | |
824 __ j(not_equal, miss_label); | 822 __ j(not_equal, miss_label); |
825 } else if (FLAG_track_fields && representation.IsSmi()) { | 823 } else if (FLAG_track_fields && representation.IsSmi()) { |
826 __ JumpIfNotSmi(value_reg, miss_label); | 824 __ JumpIfNotSmi(value_reg, miss_label); |
827 } else if (FLAG_track_heap_object_fields && representation.IsHeapObject()) { | 825 } else if (FLAG_track_heap_object_fields && representation.IsHeapObject()) { |
828 __ JumpIfSmi(value_reg, miss_label); | 826 __ JumpIfSmi(value_reg, miss_label); |
829 } else if (FLAG_track_double_fields && representation.IsDouble()) { | 827 } else if (FLAG_track_double_fields && representation.IsDouble()) { |
830 Label do_store, heap_number; | 828 Label do_store, heap_number; |
831 __ AllocateHeapNumber(storage_reg, scratch1, scratch2, slow); | 829 __ AllocateHeapNumber(storage_reg, scratch1, scratch2, slow); |
832 | 830 |
833 __ JumpIfNotSmi(value_reg, &heap_number); | 831 __ JumpIfNotSmi(value_reg, &heap_number); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
890 | 888 |
891 // Update the write barrier for the map field. | 889 // Update the write barrier for the map field. |
892 __ RecordWriteField(receiver_reg, | 890 __ RecordWriteField(receiver_reg, |
893 HeapObject::kMapOffset, | 891 HeapObject::kMapOffset, |
894 scratch1, | 892 scratch1, |
895 scratch2, | 893 scratch2, |
896 kDontSaveFPRegs, | 894 kDontSaveFPRegs, |
897 OMIT_REMEMBERED_SET, | 895 OMIT_REMEMBERED_SET, |
898 OMIT_SMI_CHECK); | 896 OMIT_SMI_CHECK); |
899 | 897 |
900 if (details.type() == CONSTANT_FUNCTION) { | 898 if (details.type() == CONSTANT) { |
901 ASSERT(value_reg.is(eax)); | 899 ASSERT(value_reg.is(eax)); |
902 __ ret(0); | 900 __ ret(0); |
903 return; | 901 return; |
904 } | 902 } |
905 | 903 |
906 int index = transition->instance_descriptors()->GetFieldIndex( | 904 int index = transition->instance_descriptors()->GetFieldIndex( |
907 transition->LastAdded()); | 905 transition->LastAdded()); |
908 | 906 |
909 // Adjust for the number of properties stored in the object. Even in the | 907 // Adjust for the number of properties stored in the object. Even in the |
910 // face of a transition we can use the old map here because the size of the | 908 // face of a transition we can use the old map here because the size of the |
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1421 | 1419 |
1422 __ CallApiFunctionAndReturn(getter_address, | 1420 __ CallApiFunctionAndReturn(getter_address, |
1423 thunk_address, | 1421 thunk_address, |
1424 ApiParameterOperand(2, returns_handle), | 1422 ApiParameterOperand(2, returns_handle), |
1425 kStackSpace, | 1423 kStackSpace, |
1426 returns_handle, | 1424 returns_handle, |
1427 6); | 1425 6); |
1428 } | 1426 } |
1429 | 1427 |
1430 | 1428 |
1431 void BaseLoadStubCompiler::GenerateLoadConstant(Handle<JSFunction> value) { | 1429 void BaseLoadStubCompiler::GenerateLoadConstant(Handle<Object> value) { |
1432 // Return the constant value. | 1430 // Return the constant value. |
1433 __ LoadHeapObject(eax, value); | 1431 __ LoadObject(eax, value); |
1434 __ ret(0); | 1432 __ ret(0); |
1435 } | 1433 } |
1436 | 1434 |
1437 | 1435 |
1438 void BaseLoadStubCompiler::GenerateLoadInterceptor( | 1436 void BaseLoadStubCompiler::GenerateLoadInterceptor( |
1439 Register holder_reg, | 1437 Register holder_reg, |
1440 Handle<JSObject> object, | 1438 Handle<JSObject> object, |
1441 Handle<JSObject> interceptor_holder, | 1439 Handle<JSObject> interceptor_holder, |
1442 LookupResult* lookup, | 1440 LookupResult* lookup, |
1443 Handle<Name> name) { | 1441 Handle<Name> name) { |
(...skipping 1276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2720 Handle<Object> object, | 2718 Handle<Object> object, |
2721 Handle<JSObject> holder, | 2719 Handle<JSObject> holder, |
2722 Handle<Name> name, | 2720 Handle<Name> name, |
2723 CheckType check, | 2721 CheckType check, |
2724 Handle<JSFunction> function) { | 2722 Handle<JSFunction> function) { |
2725 | 2723 |
2726 if (HasCustomCallGenerator(function)) { | 2724 if (HasCustomCallGenerator(function)) { |
2727 Handle<Code> code = CompileCustomCall(object, holder, | 2725 Handle<Code> code = CompileCustomCall(object, holder, |
2728 Handle<Cell>::null(), | 2726 Handle<Cell>::null(), |
2729 function, Handle<String>::cast(name), | 2727 function, Handle<String>::cast(name), |
2730 Code::CONSTANT_FUNCTION); | 2728 Code::CONSTANT); |
2731 // A null handle means bail out to the regular compiler code below. | 2729 // A null handle means bail out to the regular compiler code below. |
2732 if (!code.is_null()) return code; | 2730 if (!code.is_null()) return code; |
2733 } | 2731 } |
2734 | 2732 |
2735 Label success; | 2733 Label success; |
2736 | 2734 |
2737 CompileHandlerFrontend(object, holder, name, check, &success); | 2735 CompileHandlerFrontend(object, holder, name, check, &success); |
2738 __ bind(&success); | 2736 __ bind(&success); |
2739 CompileHandlerBackend(function); | 2737 CompileHandlerBackend(function); |
2740 | 2738 |
(...skipping 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3768 TailCallBuiltin(masm, Builtins::kKeyedStoreIC_Slow); | 3766 TailCallBuiltin(masm, Builtins::kKeyedStoreIC_Slow); |
3769 } | 3767 } |
3770 } | 3768 } |
3771 | 3769 |
3772 | 3770 |
3773 #undef __ | 3771 #undef __ |
3774 | 3772 |
3775 } } // namespace v8::internal | 3773 } } // namespace v8::internal |
3776 | 3774 |
3777 #endif // V8_TARGET_ARCH_IA32 | 3775 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |