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 2314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2325 // Patch the receiver on the stack with the global proxy if | 2325 // Patch the receiver on the stack with the global proxy if |
2326 // necessary. | 2326 // necessary. |
2327 if (object->IsGlobalObject()) { | 2327 if (object->IsGlobalObject()) { |
2328 ASSERT(depth == kInvalidProtoDepth); | 2328 ASSERT(depth == kInvalidProtoDepth); |
2329 __ ldr(r3, FieldMemOperand(r1, GlobalObject::kGlobalReceiverOffset)); | 2329 __ ldr(r3, FieldMemOperand(r1, GlobalObject::kGlobalReceiverOffset)); |
2330 __ str(r3, MemOperand(sp, argc * kPointerSize)); | 2330 __ str(r3, MemOperand(sp, argc * kPointerSize)); |
2331 } | 2331 } |
2332 break; | 2332 break; |
2333 | 2333 |
2334 case STRING_CHECK: | 2334 case STRING_CHECK: |
2335 if (!function->IsBuiltin()) { | 2335 if (!function->IsBuiltin() && !function_info->strict_mode()) { |
Lasse Reichstein
2011/02/16 13:34:30
It would be great if we could just make all builti
Martin Maly
2011/02/17 05:25:55
Good idea, Lasse. If it is ok, I'll put this on my
| |
2336 // Calling non-builtins with a value as receiver requires boxing. | 2336 // Calling non-strict non-builtins with a value as the receiver |
2337 // requires boxing. | |
2337 __ jmp(&miss); | 2338 __ jmp(&miss); |
2338 } else { | 2339 } else { |
2339 // Check that the object is a two-byte string or a symbol. | 2340 // Check that the object is a two-byte string or a symbol. |
2340 __ CompareObjectType(r1, r3, r3, FIRST_NONSTRING_TYPE); | 2341 __ CompareObjectType(r1, r3, r3, FIRST_NONSTRING_TYPE); |
2341 __ b(hs, &miss); | 2342 __ b(hs, &miss); |
2342 // Check that the maps starting from the prototype haven't changed. | 2343 // Check that the maps starting from the prototype haven't changed. |
2343 GenerateDirectLoadGlobalFunctionPrototype( | 2344 GenerateDirectLoadGlobalFunctionPrototype( |
2344 masm(), Context::STRING_FUNCTION_INDEX, r0, &miss); | 2345 masm(), Context::STRING_FUNCTION_INDEX, r0, &miss); |
2345 CheckPrototypes(JSObject::cast(object->GetPrototype()), r0, holder, r3, | 2346 CheckPrototypes(JSObject::cast(object->GetPrototype()), r0, holder, r3, |
2346 r1, r4, name, &miss); | 2347 r1, r4, name, &miss); |
2347 } | 2348 } |
2348 break; | 2349 break; |
2349 | 2350 |
2350 case NUMBER_CHECK: { | 2351 case NUMBER_CHECK: { |
2351 if (!function->IsBuiltin()) { | 2352 if (!function->IsBuiltin() && !function_info->strict_mode()) { |
2352 // Calling non-builtins with a value as receiver requires boxing. | 2353 // Calling non-strict non-builtins with a value as the receiver |
2354 // requires boxing. | |
2353 __ jmp(&miss); | 2355 __ jmp(&miss); |
2354 } else { | 2356 } else { |
2355 Label fast; | 2357 Label fast; |
2356 // Check that the object is a smi or a heap number. | 2358 // Check that the object is a smi or a heap number. |
2357 __ tst(r1, Operand(kSmiTagMask)); | 2359 __ tst(r1, Operand(kSmiTagMask)); |
2358 __ b(eq, &fast); | 2360 __ b(eq, &fast); |
2359 __ CompareObjectType(r1, r0, r0, HEAP_NUMBER_TYPE); | 2361 __ CompareObjectType(r1, r0, r0, HEAP_NUMBER_TYPE); |
2360 __ b(ne, &miss); | 2362 __ b(ne, &miss); |
2361 __ bind(&fast); | 2363 __ bind(&fast); |
2362 // Check that the maps starting from the prototype haven't changed. | 2364 // Check that the maps starting from the prototype haven't changed. |
2363 GenerateDirectLoadGlobalFunctionPrototype( | 2365 GenerateDirectLoadGlobalFunctionPrototype( |
2364 masm(), Context::NUMBER_FUNCTION_INDEX, r0, &miss); | 2366 masm(), Context::NUMBER_FUNCTION_INDEX, r0, &miss); |
2365 CheckPrototypes(JSObject::cast(object->GetPrototype()), r0, holder, r3, | 2367 CheckPrototypes(JSObject::cast(object->GetPrototype()), r0, holder, r3, |
2366 r1, r4, name, &miss); | 2368 r1, r4, name, &miss); |
2367 } | 2369 } |
2368 break; | 2370 break; |
2369 } | 2371 } |
2370 | 2372 |
2371 case BOOLEAN_CHECK: { | 2373 case BOOLEAN_CHECK: { |
2372 if (!function->IsBuiltin()) { | 2374 if (!function->IsBuiltin() && !function_info->strict_mode()) { |
2373 // Calling non-builtins with a value as receiver requires boxing. | 2375 // Calling non-strict non-builtins with a value as the receiver |
2376 // requires boxing. | |
2374 __ jmp(&miss); | 2377 __ jmp(&miss); |
2375 } else { | 2378 } else { |
2376 Label fast; | 2379 Label fast; |
2377 // Check that the object is a boolean. | 2380 // Check that the object is a boolean. |
2378 __ LoadRoot(ip, Heap::kTrueValueRootIndex); | 2381 __ LoadRoot(ip, Heap::kTrueValueRootIndex); |
2379 __ cmp(r1, ip); | 2382 __ cmp(r1, ip); |
2380 __ b(eq, &fast); | 2383 __ b(eq, &fast); |
2381 __ LoadRoot(ip, Heap::kFalseValueRootIndex); | 2384 __ LoadRoot(ip, Heap::kFalseValueRootIndex); |
2382 __ cmp(r1, ip); | 2385 __ cmp(r1, ip); |
2383 __ b(ne, &miss); | 2386 __ b(ne, &miss); |
(...skipping 1655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4039 | 4042 |
4040 return GetCode(flags); | 4043 return GetCode(flags); |
4041 } | 4044 } |
4042 | 4045 |
4043 | 4046 |
4044 #undef __ | 4047 #undef __ |
4045 | 4048 |
4046 } } // namespace v8::internal | 4049 } } // namespace v8::internal |
4047 | 4050 |
4048 #endif // V8_TARGET_ARCH_ARM | 4051 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |