OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 2186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2197 // Patch the receiver on the stack with the global proxy if | 2197 // Patch the receiver on the stack with the global proxy if |
2198 // necessary. | 2198 // necessary. |
2199 if (object->IsGlobalObject()) { | 2199 if (object->IsGlobalObject()) { |
2200 ASSERT(depth == kInvalidProtoDepth); | 2200 ASSERT(depth == kInvalidProtoDepth); |
2201 __ mov(edx, FieldOperand(edx, GlobalObject::kGlobalReceiverOffset)); | 2201 __ mov(edx, FieldOperand(edx, GlobalObject::kGlobalReceiverOffset)); |
2202 __ mov(Operand(esp, (argc + 1) * kPointerSize), edx); | 2202 __ mov(Operand(esp, (argc + 1) * kPointerSize), edx); |
2203 } | 2203 } |
2204 break; | 2204 break; |
2205 | 2205 |
2206 case STRING_CHECK: | 2206 case STRING_CHECK: |
2207 if (!function->IsBuiltin()) { | 2207 if (!function->IsBuiltin() && !function_info->strict_mode()) { |
2208 // Calling non-builtins with a value as receiver requires boxing. | 2208 // Calling non-strict non-builtins with a value as the receiver |
| 2209 // requires boxing. |
2209 __ jmp(&miss); | 2210 __ jmp(&miss); |
2210 } else { | 2211 } else { |
2211 // Check that the object is a string or a symbol. | 2212 // Check that the object is a string or a symbol. |
2212 __ CmpObjectType(edx, FIRST_NONSTRING_TYPE, eax); | 2213 __ CmpObjectType(edx, FIRST_NONSTRING_TYPE, eax); |
2213 __ j(above_equal, &miss, not_taken); | 2214 __ j(above_equal, &miss, not_taken); |
2214 // Check that the maps starting from the prototype haven't changed. | 2215 // Check that the maps starting from the prototype haven't changed. |
2215 GenerateDirectLoadGlobalFunctionPrototype( | 2216 GenerateDirectLoadGlobalFunctionPrototype( |
2216 masm(), Context::STRING_FUNCTION_INDEX, eax, &miss); | 2217 masm(), Context::STRING_FUNCTION_INDEX, eax, &miss); |
2217 CheckPrototypes(JSObject::cast(object->GetPrototype()), eax, holder, | 2218 CheckPrototypes(JSObject::cast(object->GetPrototype()), eax, holder, |
2218 ebx, edx, edi, name, &miss); | 2219 ebx, edx, edi, name, &miss); |
2219 } | 2220 } |
2220 break; | 2221 break; |
2221 | 2222 |
2222 case NUMBER_CHECK: { | 2223 case NUMBER_CHECK: { |
2223 if (!function->IsBuiltin()) { | 2224 if (!function->IsBuiltin() && !function_info->strict_mode()) { |
2224 // Calling non-builtins with a value as receiver requires boxing. | 2225 // Calling non-strict non-builtins with a value as the receiver |
| 2226 // requires boxing. |
2225 __ jmp(&miss); | 2227 __ jmp(&miss); |
2226 } else { | 2228 } else { |
2227 Label fast; | 2229 Label fast; |
2228 // Check that the object is a smi or a heap number. | 2230 // Check that the object is a smi or a heap number. |
2229 __ test(edx, Immediate(kSmiTagMask)); | 2231 __ test(edx, Immediate(kSmiTagMask)); |
2230 __ j(zero, &fast, taken); | 2232 __ j(zero, &fast, taken); |
2231 __ CmpObjectType(edx, HEAP_NUMBER_TYPE, eax); | 2233 __ CmpObjectType(edx, HEAP_NUMBER_TYPE, eax); |
2232 __ j(not_equal, &miss, not_taken); | 2234 __ j(not_equal, &miss, not_taken); |
2233 __ bind(&fast); | 2235 __ bind(&fast); |
2234 // Check that the maps starting from the prototype haven't changed. | 2236 // Check that the maps starting from the prototype haven't changed. |
2235 GenerateDirectLoadGlobalFunctionPrototype( | 2237 GenerateDirectLoadGlobalFunctionPrototype( |
2236 masm(), Context::NUMBER_FUNCTION_INDEX, eax, &miss); | 2238 masm(), Context::NUMBER_FUNCTION_INDEX, eax, &miss); |
2237 CheckPrototypes(JSObject::cast(object->GetPrototype()), eax, holder, | 2239 CheckPrototypes(JSObject::cast(object->GetPrototype()), eax, holder, |
2238 ebx, edx, edi, name, &miss); | 2240 ebx, edx, edi, name, &miss); |
2239 } | 2241 } |
2240 break; | 2242 break; |
2241 } | 2243 } |
2242 | 2244 |
2243 case BOOLEAN_CHECK: { | 2245 case BOOLEAN_CHECK: { |
2244 if (!function->IsBuiltin()) { | 2246 if (!function->IsBuiltin() && !function_info->strict_mode()) { |
2245 // Calling non-builtins with a value as receiver requires boxing. | 2247 // Calling non-strict non-builtins with a value as the receiver |
| 2248 // requires boxing. |
2246 __ jmp(&miss); | 2249 __ jmp(&miss); |
2247 } else { | 2250 } else { |
2248 Label fast; | 2251 Label fast; |
2249 // Check that the object is a boolean. | 2252 // Check that the object is a boolean. |
2250 __ cmp(edx, Factory::true_value()); | 2253 __ cmp(edx, Factory::true_value()); |
2251 __ j(equal, &fast, taken); | 2254 __ j(equal, &fast, taken); |
2252 __ cmp(edx, Factory::false_value()); | 2255 __ cmp(edx, Factory::false_value()); |
2253 __ j(not_equal, &miss, not_taken); | 2256 __ j(not_equal, &miss, not_taken); |
2254 __ bind(&fast); | 2257 __ bind(&fast); |
2255 // Check that the maps starting from the prototype haven't changed. | 2258 // Check that the maps starting from the prototype haven't changed. |
(...skipping 1460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3716 | 3719 |
3717 return GetCode(flags); | 3720 return GetCode(flags); |
3718 } | 3721 } |
3719 | 3722 |
3720 | 3723 |
3721 #undef __ | 3724 #undef __ |
3722 | 3725 |
3723 } } // namespace v8::internal | 3726 } } // namespace v8::internal |
3724 | 3727 |
3725 #endif // V8_TARGET_ARCH_IA32 | 3728 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |