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 1177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1188 Handle<String> name, | 1188 Handle<String> name, |
1189 Label* miss) { | 1189 Label* miss) { |
1190 ASSERT(holder->IsGlobalObject()); | 1190 ASSERT(holder->IsGlobalObject()); |
1191 | 1191 |
1192 // Get the number of arguments. | 1192 // Get the number of arguments. |
1193 const int argc = arguments().immediate(); | 1193 const int argc = arguments().immediate(); |
1194 | 1194 |
1195 // Get the receiver from the stack. | 1195 // Get the receiver from the stack. |
1196 __ mov(edx, Operand(esp, (argc + 1) * kPointerSize)); | 1196 __ mov(edx, Operand(esp, (argc + 1) * kPointerSize)); |
1197 | 1197 |
1198 // If the object is the holder then we know that it's a global | |
1199 // object which can only happen for contextual calls. In this case, | |
1200 // the receiver cannot be a smi. | |
1201 if (!object.is_identical_to(holder)) { | |
1202 __ JumpIfSmi(edx, miss); | |
1203 } | |
1204 | 1198 |
1205 // Check that the maps haven't changed. | 1199 // Check that the maps haven't changed. |
| 1200 __ JumpIfSmi(edx, miss); |
1206 CheckPrototypes(object, edx, holder, ebx, eax, edi, name, miss); | 1201 CheckPrototypes(object, edx, holder, ebx, eax, edi, name, miss); |
1207 } | 1202 } |
1208 | 1203 |
1209 | 1204 |
1210 void CallStubCompiler::GenerateLoadFunctionFromCell( | 1205 void CallStubCompiler::GenerateLoadFunctionFromCell( |
1211 Handle<JSGlobalPropertyCell> cell, | 1206 Handle<JSGlobalPropertyCell> cell, |
1212 Handle<JSFunction> function, | 1207 Handle<JSFunction> function, |
1213 Label* miss) { | 1208 Label* miss) { |
1214 // Get the value from the cell. | 1209 // Get the value from the cell. |
1215 if (Serializer::enabled()) { | 1210 if (Serializer::enabled()) { |
(...skipping 1533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2749 Handle<JSGlobalPropertyCell> cell, | 2744 Handle<JSGlobalPropertyCell> cell, |
2750 Handle<String> name, | 2745 Handle<String> name, |
2751 bool is_dont_delete) { | 2746 bool is_dont_delete) { |
2752 // ----------- S t a t e ------------- | 2747 // ----------- S t a t e ------------- |
2753 // -- eax : receiver | 2748 // -- eax : receiver |
2754 // -- ecx : name | 2749 // -- ecx : name |
2755 // -- esp[0] : return address | 2750 // -- esp[0] : return address |
2756 // ----------------------------------- | 2751 // ----------------------------------- |
2757 Label miss; | 2752 Label miss; |
2758 | 2753 |
2759 // If the object is the holder then we know that it's a global | |
2760 // object which can only happen for contextual loads. In this case, | |
2761 // the receiver cannot be a smi. | |
2762 if (!object.is_identical_to(holder)) { | |
2763 __ JumpIfSmi(eax, &miss); | |
2764 } | |
2765 | |
2766 // Check that the maps haven't changed. | 2754 // Check that the maps haven't changed. |
| 2755 __ JumpIfSmi(eax, &miss); |
2767 CheckPrototypes(object, eax, holder, ebx, edx, edi, name, &miss); | 2756 CheckPrototypes(object, eax, holder, ebx, edx, edi, name, &miss); |
2768 | 2757 |
2769 // Get the value from the cell. | 2758 // Get the value from the cell. |
2770 if (Serializer::enabled()) { | 2759 if (Serializer::enabled()) { |
2771 __ mov(ebx, Immediate(cell)); | 2760 __ mov(ebx, Immediate(cell)); |
2772 __ mov(ebx, FieldOperand(ebx, JSGlobalPropertyCell::kValueOffset)); | 2761 __ mov(ebx, FieldOperand(ebx, JSGlobalPropertyCell::kValueOffset)); |
2773 } else { | 2762 } else { |
2774 __ mov(ebx, Operand::Cell(cell)); | 2763 __ mov(ebx, Operand::Cell(cell)); |
2775 } | 2764 } |
2776 | 2765 |
(...skipping 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3815 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss(); | 3804 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss(); |
3816 __ jmp(ic_miss, RelocInfo::CODE_TARGET); | 3805 __ jmp(ic_miss, RelocInfo::CODE_TARGET); |
3817 } | 3806 } |
3818 | 3807 |
3819 | 3808 |
3820 #undef __ | 3809 #undef __ |
3821 | 3810 |
3822 } } // namespace v8::internal | 3811 } } // namespace v8::internal |
3823 | 3812 |
3824 #endif // V8_TARGET_ARCH_IA32 | 3813 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |