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 1223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1234 CheckType check) { | 1234 CheckType check) { |
1235 // ----------- S t a t e ------------- | 1235 // ----------- S t a t e ------------- |
1236 // -- ecx : name | 1236 // -- ecx : name |
1237 // -- esp[0] : return address | 1237 // -- esp[0] : return address |
1238 // -- esp[(argc - n) * 4] : arg[n] (zero-based) | 1238 // -- esp[(argc - n) * 4] : arg[n] (zero-based) |
1239 // -- ... | 1239 // -- ... |
1240 // -- esp[(argc + 1) * 4] : receiver | 1240 // -- esp[(argc + 1) * 4] : receiver |
1241 // ----------------------------------- | 1241 // ----------------------------------- |
1242 ASSERT(check == RECEIVER_MAP_CHECK); | 1242 ASSERT(check == RECEIVER_MAP_CHECK); |
1243 | 1243 |
| 1244 // If object is not an array, bail out to regular call. |
| 1245 if (!object->IsJSArray()) { |
| 1246 return Heap::undefined_value(); |
| 1247 } |
| 1248 |
1244 Label miss; | 1249 Label miss; |
1245 | 1250 |
1246 // Get the receiver from the stack. | 1251 // Get the receiver from the stack. |
1247 const int argc = arguments().immediate(); | 1252 const int argc = arguments().immediate(); |
1248 __ mov(edx, Operand(esp, (argc + 1) * kPointerSize)); | 1253 __ mov(edx, Operand(esp, (argc + 1) * kPointerSize)); |
1249 | 1254 |
1250 // Check that the receiver isn't a smi. | 1255 // Check that the receiver isn't a smi. |
1251 __ test(edx, Immediate(kSmiTagMask)); | 1256 __ test(edx, Immediate(kSmiTagMask)); |
1252 __ j(zero, &miss); | 1257 __ j(zero, &miss); |
1253 | 1258 |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1382 CheckType check) { | 1387 CheckType check) { |
1383 // ----------- S t a t e ------------- | 1388 // ----------- S t a t e ------------- |
1384 // -- ecx : name | 1389 // -- ecx : name |
1385 // -- esp[0] : return address | 1390 // -- esp[0] : return address |
1386 // -- esp[(argc - n) * 4] : arg[n] (zero-based) | 1391 // -- esp[(argc - n) * 4] : arg[n] (zero-based) |
1387 // -- ... | 1392 // -- ... |
1388 // -- esp[(argc + 1) * 4] : receiver | 1393 // -- esp[(argc + 1) * 4] : receiver |
1389 // ----------------------------------- | 1394 // ----------------------------------- |
1390 ASSERT(check == RECEIVER_MAP_CHECK); | 1395 ASSERT(check == RECEIVER_MAP_CHECK); |
1391 | 1396 |
| 1397 // If object is not an array, bail out to regular call. |
| 1398 if (!object->IsJSArray()) { |
| 1399 return Heap::undefined_value(); |
| 1400 } |
| 1401 |
1392 Label miss, empty_array, call_builtin; | 1402 Label miss, empty_array, call_builtin; |
1393 | 1403 |
1394 // Get the receiver from the stack. | 1404 // Get the receiver from the stack. |
1395 const int argc = arguments().immediate(); | 1405 const int argc = arguments().immediate(); |
1396 __ mov(edx, Operand(esp, (argc + 1) * kPointerSize)); | 1406 __ mov(edx, Operand(esp, (argc + 1) * kPointerSize)); |
1397 | 1407 |
1398 // Check that the receiver isn't a smi. | 1408 // Check that the receiver isn't a smi. |
1399 __ test(edx, Immediate(kSmiTagMask)); | 1409 __ test(edx, Immediate(kSmiTagMask)); |
1400 __ j(zero, &miss); | 1410 __ j(zero, &miss); |
1401 | 1411 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1469 // -- esp[0] : return address | 1479 // -- esp[0] : return address |
1470 // -- esp[(argc - n) * 4] : arg[n] (zero-based) | 1480 // -- esp[(argc - n) * 4] : arg[n] (zero-based) |
1471 // -- ... | 1481 // -- ... |
1472 // -- esp[(argc + 1) * 4] : receiver | 1482 // -- esp[(argc + 1) * 4] : receiver |
1473 // ----------------------------------- | 1483 // ----------------------------------- |
1474 | 1484 |
1475 SharedFunctionInfo* function_info = function->shared(); | 1485 SharedFunctionInfo* function_info = function->shared(); |
1476 if (function_info->HasCustomCallGenerator()) { | 1486 if (function_info->HasCustomCallGenerator()) { |
1477 CustomCallGenerator generator = | 1487 CustomCallGenerator generator = |
1478 ToCData<CustomCallGenerator>(function_info->function_data()); | 1488 ToCData<CustomCallGenerator>(function_info->function_data()); |
1479 return generator(this, object, holder, function, name, check); | 1489 Object* result = generator(this, object, holder, function, name, check); |
| 1490 // undefined means bail out to regular compiler. |
| 1491 if (!result->IsUndefined()) { |
| 1492 return result; |
| 1493 } |
1480 } | 1494 } |
1481 | 1495 |
1482 Label miss_in_smi_check; | 1496 Label miss_in_smi_check; |
1483 | 1497 |
1484 // Get the receiver from the stack. | 1498 // Get the receiver from the stack. |
1485 const int argc = arguments().immediate(); | 1499 const int argc = arguments().immediate(); |
1486 __ mov(edx, Operand(esp, (argc + 1) * kPointerSize)); | 1500 __ mov(edx, Operand(esp, (argc + 1) * kPointerSize)); |
1487 | 1501 |
1488 // Check that the receiver isn't a smi. | 1502 // Check that the receiver isn't a smi. |
1489 if (check != NUMBER_CHECK) { | 1503 if (check != NUMBER_CHECK) { |
(...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2485 __ jmp(generic_construct_stub, RelocInfo::CODE_TARGET); | 2499 __ jmp(generic_construct_stub, RelocInfo::CODE_TARGET); |
2486 | 2500 |
2487 // Return the generated code. | 2501 // Return the generated code. |
2488 return GetCode(); | 2502 return GetCode(); |
2489 } | 2503 } |
2490 | 2504 |
2491 | 2505 |
2492 #undef __ | 2506 #undef __ |
2493 | 2507 |
2494 } } // namespace v8::internal | 2508 } } // namespace v8::internal |
OLD | NEW |