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 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 static Operand GenerateMappedArgumentsLookup(MacroAssembler* masm, | 466 static Operand GenerateMappedArgumentsLookup(MacroAssembler* masm, |
467 Register object, | 467 Register object, |
468 Register key, | 468 Register key, |
469 Register scratch1, | 469 Register scratch1, |
470 Register scratch2, | 470 Register scratch2, |
471 Label* unmapped_case, | 471 Label* unmapped_case, |
472 Label* slow_case) { | 472 Label* slow_case) { |
473 Heap* heap = masm->isolate()->heap(); | 473 Heap* heap = masm->isolate()->heap(); |
474 Factory* factory = masm->isolate()->factory(); | 474 Factory* factory = masm->isolate()->factory(); |
475 | 475 |
476 // Check that the receiver isn't a smi. | 476 // Check that the receiver is a JSObject. Because of the elements |
| 477 // map check later, we do not need to check for interceptors or |
| 478 // whether it requires access checks. |
477 __ JumpIfSmi(object, slow_case); | 479 __ JumpIfSmi(object, slow_case); |
| 480 // Check that the object is some kind of JSObject. |
| 481 __ CmpObjectType(object, FIRST_JS_RECEIVER_TYPE, scratch1); |
| 482 __ j(below, slow_case); |
478 | 483 |
479 // Check that the key is a positive smi. | 484 // Check that the key is a positive smi. |
480 __ test(key, Immediate(0x8000001)); | 485 __ test(key, Immediate(0x8000001)); |
481 __ j(not_zero, slow_case); | 486 __ j(not_zero, slow_case); |
482 | 487 |
483 // Load the elements into scratch1 and check its map. | 488 // Load the elements into scratch1 and check its map. |
484 Handle<Map> arguments_map(heap->non_strict_arguments_elements_map()); | 489 Handle<Map> arguments_map(heap->non_strict_arguments_elements_map()); |
485 __ mov(scratch1, FieldOperand(object, JSObject::kElementsOffset)); | 490 __ mov(scratch1, FieldOperand(object, JSObject::kElementsOffset)); |
486 __ CheckMap(scratch1, arguments_map, slow_case, DONT_DO_SMI_CHECK); | 491 __ CheckMap(scratch1, arguments_map, slow_case, DONT_DO_SMI_CHECK); |
487 | 492 |
(...skipping 1242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1730 Condition cc = *jmp_address == Assembler::kJncShortOpcode | 1735 Condition cc = *jmp_address == Assembler::kJncShortOpcode |
1731 ? not_zero | 1736 ? not_zero |
1732 : zero; | 1737 : zero; |
1733 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 1738 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
1734 } | 1739 } |
1735 | 1740 |
1736 | 1741 |
1737 } } // namespace v8::internal | 1742 } } // namespace v8::internal |
1738 | 1743 |
1739 #endif // V8_TARGET_ARCH_IA32 | 1744 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |