OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 __ test_b(FieldOperand(r1, Map::kBitFieldOffset), | 90 __ test_b(FieldOperand(r1, Map::kBitFieldOffset), |
91 (1 << Map::kIsAccessCheckNeeded) | | 91 (1 << Map::kIsAccessCheckNeeded) | |
92 (1 << Map::kHasNamedInterceptor)); | 92 (1 << Map::kHasNamedInterceptor)); |
93 __ j(not_zero, miss, not_taken); | 93 __ j(not_zero, miss, not_taken); |
94 | 94 |
95 __ mov(r0, FieldOperand(receiver, JSObject::kPropertiesOffset)); | 95 __ mov(r0, FieldOperand(receiver, JSObject::kPropertiesOffset)); |
96 __ CheckMap(r0, FACTORY->hash_table_map(), miss, true); | 96 __ CheckMap(r0, FACTORY->hash_table_map(), miss, true); |
97 } | 97 } |
98 | 98 |
99 | 99 |
100 | |
101 // Helper function used to load a property from a dictionary backing | 100 // Helper function used to load a property from a dictionary backing |
102 // storage. This function may fail to load a property even though it is | 101 // storage. This function may fail to load a property even though it is |
103 // in the dictionary, so code at miss_label must always call a backup | 102 // in the dictionary, so code at miss_label must always call a backup |
104 // property load that is complete. This function is safe to call if | 103 // property load that is complete. This function is safe to call if |
105 // name is not a symbol, and will jump to the miss_label in that | 104 // name is not a symbol, and will jump to the miss_label in that |
106 // case. The generated code assumes that the receiver has slow | 105 // case. The generated code assumes that the receiver has slow |
107 // properties, is not a global object and does not have interceptors. | 106 // properties, is not a global object and does not have interceptors. |
108 static void GenerateDictionaryLoad(MacroAssembler* masm, | 107 static void GenerateDictionaryLoad(MacroAssembler* masm, |
109 Label* miss_label, | 108 Label* miss_label, |
110 Register elements, | 109 Register elements, |
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 | 741 |
743 // Extra capacity case: Check if there is extra capacity to | 742 // Extra capacity case: Check if there is extra capacity to |
744 // perform the store and update the length. Used for adding one | 743 // perform the store and update the length. Used for adding one |
745 // element to the array by writing to array[array.length]. | 744 // element to the array by writing to array[array.length]. |
746 __ bind(&extra); | 745 __ bind(&extra); |
747 // eax: value | 746 // eax: value |
748 // edx: receiver, a JSArray | 747 // edx: receiver, a JSArray |
749 // ecx: key, a smi. | 748 // ecx: key, a smi. |
750 // edi: receiver->elements, a FixedArray | 749 // edi: receiver->elements, a FixedArray |
751 // flags: compare (ecx, edx.length()) | 750 // flags: compare (ecx, edx.length()) |
752 __ j(not_equal, &slow, not_taken); // do not leave holes in the array | 751 // do not leave holes in the array: |
| 752 __ j(not_equal, &slow, not_taken); |
753 __ cmp(ecx, FieldOperand(edi, FixedArray::kLengthOffset)); | 753 __ cmp(ecx, FieldOperand(edi, FixedArray::kLengthOffset)); |
754 __ j(above_equal, &slow, not_taken); | 754 __ j(above_equal, &slow, not_taken); |
755 // Add 1 to receiver->length, and go to fast array write. | 755 // Add 1 to receiver->length, and go to fast array write. |
756 __ add(FieldOperand(edx, JSArray::kLengthOffset), | 756 __ add(FieldOperand(edx, JSArray::kLengthOffset), |
757 Immediate(Smi::FromInt(1))); | 757 Immediate(Smi::FromInt(1))); |
758 __ jmp(&fast); | 758 __ jmp(&fast); |
759 | 759 |
760 // Array case: Get the length and the elements array from the JS | 760 // Array case: Get the length and the elements array from the JS |
761 // array. Check that the array is in fast mode (and writable); if it | 761 // array. Check that the array is in fast mode (and writable); if it |
762 // is the length is always a smi. | 762 // is the length is always a smi. |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
935 // Move result to edi and exit the internal frame. | 935 // Move result to edi and exit the internal frame. |
936 __ mov(edi, eax); | 936 __ mov(edi, eax); |
937 __ LeaveInternalFrame(); | 937 __ LeaveInternalFrame(); |
938 | 938 |
939 // Check if the receiver is a global object of some sort. | 939 // Check if the receiver is a global object of some sort. |
940 // This can happen only for regular CallIC but not KeyedCallIC. | 940 // This can happen only for regular CallIC but not KeyedCallIC. |
941 if (id == IC::kCallIC_Miss) { | 941 if (id == IC::kCallIC_Miss) { |
942 Label invoke, global; | 942 Label invoke, global; |
943 __ mov(edx, Operand(esp, (argc + 1) * kPointerSize)); // receiver | 943 __ mov(edx, Operand(esp, (argc + 1) * kPointerSize)); // receiver |
944 __ test(edx, Immediate(kSmiTagMask)); | 944 __ test(edx, Immediate(kSmiTagMask)); |
945 __ j(zero, &invoke, not_taken); | 945 __ j(zero, &invoke, not_taken, Label::kNear); |
946 __ mov(ebx, FieldOperand(edx, HeapObject::kMapOffset)); | 946 __ mov(ebx, FieldOperand(edx, HeapObject::kMapOffset)); |
947 __ movzx_b(ebx, FieldOperand(ebx, Map::kInstanceTypeOffset)); | 947 __ movzx_b(ebx, FieldOperand(ebx, Map::kInstanceTypeOffset)); |
948 __ cmp(ebx, JS_GLOBAL_OBJECT_TYPE); | 948 __ cmp(ebx, JS_GLOBAL_OBJECT_TYPE); |
949 __ j(equal, &global); | 949 __ j(equal, &global, Label::kNear); |
950 __ cmp(ebx, JS_BUILTINS_OBJECT_TYPE); | 950 __ cmp(ebx, JS_BUILTINS_OBJECT_TYPE); |
951 __ j(not_equal, &invoke); | 951 __ j(not_equal, &invoke, Label::kNear); |
952 | 952 |
953 // Patch the receiver on the stack. | 953 // Patch the receiver on the stack. |
954 __ bind(&global); | 954 __ bind(&global); |
955 __ mov(edx, FieldOperand(edx, GlobalObject::kGlobalReceiverOffset)); | 955 __ mov(edx, FieldOperand(edx, GlobalObject::kGlobalReceiverOffset)); |
956 __ mov(Operand(esp, (argc + 1) * kPointerSize), edx); | 956 __ mov(Operand(esp, (argc + 1) * kPointerSize), edx); |
957 __ bind(&invoke); | 957 __ bind(&invoke); |
958 } | 958 } |
959 | 959 |
960 // Invoke the function. | 960 // Invoke the function. |
961 ParameterCount actual(argc); | 961 ParameterCount actual(argc); |
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1538 Condition cc = *jmp_address == Assembler::kJncShortOpcode | 1538 Condition cc = *jmp_address == Assembler::kJncShortOpcode |
1539 ? not_zero | 1539 ? not_zero |
1540 : zero; | 1540 : zero; |
1541 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 1541 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
1542 } | 1542 } |
1543 | 1543 |
1544 | 1544 |
1545 } } // namespace v8::internal | 1545 } } // namespace v8::internal |
1546 | 1546 |
1547 #endif // V8_TARGET_ARCH_IA32 | 1547 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |