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 2151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2162 | 2162 |
2163 // Patch the receiver on the stack with the global proxy if | 2163 // Patch the receiver on the stack with the global proxy if |
2164 // necessary. | 2164 // necessary. |
2165 if (object->IsGlobalObject()) { | 2165 if (object->IsGlobalObject()) { |
2166 __ mov(edx, FieldOperand(edx, GlobalObject::kGlobalReceiverOffset)); | 2166 __ mov(edx, FieldOperand(edx, GlobalObject::kGlobalReceiverOffset)); |
2167 __ mov(Operand(esp, (argc + 1) * kPointerSize), edx); | 2167 __ mov(Operand(esp, (argc + 1) * kPointerSize), edx); |
2168 } | 2168 } |
2169 break; | 2169 break; |
2170 | 2170 |
2171 case STRING_CHECK: | 2171 case STRING_CHECK: |
2172 if (function->IsBuiltin() || function->shared()->strict_mode()) { | 2172 if (function->IsBuiltin() || !function->shared()->is_classic_mode()) { |
2173 // Check that the object is a string or a symbol. | 2173 // Check that the object is a string or a symbol. |
2174 __ CmpObjectType(edx, FIRST_NONSTRING_TYPE, eax); | 2174 __ CmpObjectType(edx, FIRST_NONSTRING_TYPE, eax); |
2175 __ j(above_equal, &miss); | 2175 __ j(above_equal, &miss); |
2176 // Check that the maps starting from the prototype haven't changed. | 2176 // Check that the maps starting from the prototype haven't changed. |
2177 GenerateDirectLoadGlobalFunctionPrototype( | 2177 GenerateDirectLoadGlobalFunctionPrototype( |
2178 masm(), Context::STRING_FUNCTION_INDEX, eax, &miss); | 2178 masm(), Context::STRING_FUNCTION_INDEX, eax, &miss); |
2179 CheckPrototypes( | 2179 CheckPrototypes( |
2180 Handle<JSObject>(JSObject::cast(object->GetPrototype())), | 2180 Handle<JSObject>(JSObject::cast(object->GetPrototype())), |
2181 eax, holder, ebx, edx, edi, name, &miss); | 2181 eax, holder, ebx, edx, edi, name, &miss); |
2182 } else { | 2182 } else { |
2183 // Calling non-strict non-builtins with a value as the receiver | 2183 // Calling non-strict non-builtins with a value as the receiver |
2184 // requires boxing. | 2184 // requires boxing. |
2185 __ jmp(&miss); | 2185 __ jmp(&miss); |
2186 } | 2186 } |
2187 break; | 2187 break; |
2188 | 2188 |
2189 case NUMBER_CHECK: | 2189 case NUMBER_CHECK: |
2190 if (function->IsBuiltin() || function->shared()->strict_mode()) { | 2190 if (function->IsBuiltin() || !function->shared()->is_classic_mode()) { |
2191 Label fast; | 2191 Label fast; |
2192 // Check that the object is a smi or a heap number. | 2192 // Check that the object is a smi or a heap number. |
2193 __ JumpIfSmi(edx, &fast); | 2193 __ JumpIfSmi(edx, &fast); |
2194 __ CmpObjectType(edx, HEAP_NUMBER_TYPE, eax); | 2194 __ CmpObjectType(edx, HEAP_NUMBER_TYPE, eax); |
2195 __ j(not_equal, &miss); | 2195 __ j(not_equal, &miss); |
2196 __ bind(&fast); | 2196 __ bind(&fast); |
2197 // Check that the maps starting from the prototype haven't changed. | 2197 // Check that the maps starting from the prototype haven't changed. |
2198 GenerateDirectLoadGlobalFunctionPrototype( | 2198 GenerateDirectLoadGlobalFunctionPrototype( |
2199 masm(), Context::NUMBER_FUNCTION_INDEX, eax, &miss); | 2199 masm(), Context::NUMBER_FUNCTION_INDEX, eax, &miss); |
2200 CheckPrototypes( | 2200 CheckPrototypes( |
2201 Handle<JSObject>(JSObject::cast(object->GetPrototype())), | 2201 Handle<JSObject>(JSObject::cast(object->GetPrototype())), |
2202 eax, holder, ebx, edx, edi, name, &miss); | 2202 eax, holder, ebx, edx, edi, name, &miss); |
2203 } else { | 2203 } else { |
2204 // Calling non-strict non-builtins with a value as the receiver | 2204 // Calling non-strict non-builtins with a value as the receiver |
2205 // requires boxing. | 2205 // requires boxing. |
2206 __ jmp(&miss); | 2206 __ jmp(&miss); |
2207 } | 2207 } |
2208 break; | 2208 break; |
2209 | 2209 |
2210 case BOOLEAN_CHECK: | 2210 case BOOLEAN_CHECK: |
2211 if (function->IsBuiltin() || function->shared()->strict_mode()) { | 2211 if (function->IsBuiltin() || !function->shared()->is_classic_mode()) { |
2212 Label fast; | 2212 Label fast; |
2213 // Check that the object is a boolean. | 2213 // Check that the object is a boolean. |
2214 __ cmp(edx, factory()->true_value()); | 2214 __ cmp(edx, factory()->true_value()); |
2215 __ j(equal, &fast); | 2215 __ j(equal, &fast); |
2216 __ cmp(edx, factory()->false_value()); | 2216 __ cmp(edx, factory()->false_value()); |
2217 __ j(not_equal, &miss); | 2217 __ j(not_equal, &miss); |
2218 __ bind(&fast); | 2218 __ bind(&fast); |
2219 // Check that the maps starting from the prototype haven't changed. | 2219 // Check that the maps starting from the prototype haven't changed. |
2220 GenerateDirectLoadGlobalFunctionPrototype( | 2220 GenerateDirectLoadGlobalFunctionPrototype( |
2221 masm(), Context::BOOLEAN_FUNCTION_INDEX, eax, &miss); | 2221 masm(), Context::BOOLEAN_FUNCTION_INDEX, eax, &miss); |
(...skipping 1625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3847 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss(); | 3847 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss(); |
3848 __ jmp(ic_miss, RelocInfo::CODE_TARGET); | 3848 __ jmp(ic_miss, RelocInfo::CODE_TARGET); |
3849 } | 3849 } |
3850 | 3850 |
3851 | 3851 |
3852 #undef __ | 3852 #undef __ |
3853 | 3853 |
3854 } } // namespace v8::internal | 3854 } } // namespace v8::internal |
3855 | 3855 |
3856 #endif // V8_TARGET_ARCH_IA32 | 3856 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |