| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 __ JumpIfSmi(object, slow_case); | 344 __ JumpIfSmi(object, slow_case); |
| 345 // Check that the object is some kind of JSObject. | 345 // Check that the object is some kind of JSObject. |
| 346 __ CmpObjectType(object, FIRST_JS_RECEIVER_TYPE, scratch1); | 346 __ CmpObjectType(object, FIRST_JS_RECEIVER_TYPE, scratch1); |
| 347 __ j(below, slow_case); | 347 __ j(below, slow_case); |
| 348 | 348 |
| 349 // Check that the key is a positive smi. | 349 // Check that the key is a positive smi. |
| 350 __ test(key, Immediate(0x80000001)); | 350 __ test(key, Immediate(0x80000001)); |
| 351 __ j(not_zero, slow_case); | 351 __ j(not_zero, slow_case); |
| 352 | 352 |
| 353 // Load the elements into scratch1 and check its map. | 353 // Load the elements into scratch1 and check its map. |
| 354 Handle<Map> arguments_map(heap->non_strict_arguments_elements_map()); | 354 Handle<Map> arguments_map(heap->sloppy_arguments_elements_map()); |
| 355 __ mov(scratch1, FieldOperand(object, JSObject::kElementsOffset)); | 355 __ mov(scratch1, FieldOperand(object, JSObject::kElementsOffset)); |
| 356 __ CheckMap(scratch1, arguments_map, slow_case, DONT_DO_SMI_CHECK); | 356 __ CheckMap(scratch1, arguments_map, slow_case, DONT_DO_SMI_CHECK); |
| 357 | 357 |
| 358 // Check if element is in the range of mapped arguments. If not, jump | 358 // Check if element is in the range of mapped arguments. If not, jump |
| 359 // to the unmapped lookup with the parameter map in scratch1. | 359 // to the unmapped lookup with the parameter map in scratch1. |
| 360 __ mov(scratch2, FieldOperand(scratch1, FixedArray::kLengthOffset)); | 360 __ mov(scratch2, FieldOperand(scratch1, FixedArray::kLengthOffset)); |
| 361 __ sub(scratch2, Immediate(Smi::FromInt(2))); | 361 __ sub(scratch2, Immediate(Smi::FromInt(2))); |
| 362 __ cmp(key, scratch2); | 362 __ cmp(key, scratch2); |
| 363 __ j(above_equal, unmapped_case); | 363 __ j(above_equal, unmapped_case); |
| 364 | 364 |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 650 ExternalReference ref = | 650 ExternalReference ref = |
| 651 ExternalReference(IC_Utility(kKeyedLoadPropertyWithInterceptor), | 651 ExternalReference(IC_Utility(kKeyedLoadPropertyWithInterceptor), |
| 652 masm->isolate()); | 652 masm->isolate()); |
| 653 __ TailCallExternalReference(ref, 2, 1); | 653 __ TailCallExternalReference(ref, 2, 1); |
| 654 | 654 |
| 655 __ bind(&slow); | 655 __ bind(&slow); |
| 656 GenerateMiss(masm); | 656 GenerateMiss(masm); |
| 657 } | 657 } |
| 658 | 658 |
| 659 | 659 |
| 660 void KeyedLoadIC::GenerateNonStrictArguments(MacroAssembler* masm) { | 660 void KeyedLoadIC::GenerateSloppyArguments(MacroAssembler* masm) { |
| 661 // ----------- S t a t e ------------- | 661 // ----------- S t a t e ------------- |
| 662 // -- ecx : key | 662 // -- ecx : key |
| 663 // -- edx : receiver | 663 // -- edx : receiver |
| 664 // -- esp[0] : return address | 664 // -- esp[0] : return address |
| 665 // ----------------------------------- | 665 // ----------------------------------- |
| 666 Label slow, notin; | 666 Label slow, notin; |
| 667 Factory* factory = masm->isolate()->factory(); | 667 Factory* factory = masm->isolate()->factory(); |
| 668 Operand mapped_location = | 668 Operand mapped_location = |
| 669 GenerateMappedArgumentsLookup(masm, edx, ecx, ebx, eax, ¬in, &slow); | 669 GenerateMappedArgumentsLookup(masm, edx, ecx, ebx, eax, ¬in, &slow); |
| 670 __ mov(eax, mapped_location); | 670 __ mov(eax, mapped_location); |
| 671 __ Ret(); | 671 __ Ret(); |
| 672 __ bind(¬in); | 672 __ bind(¬in); |
| 673 // The unmapped lookup expects that the parameter map is in ebx. | 673 // The unmapped lookup expects that the parameter map is in ebx. |
| 674 Operand unmapped_location = | 674 Operand unmapped_location = |
| 675 GenerateUnmappedArgumentsLookup(masm, ecx, ebx, eax, &slow); | 675 GenerateUnmappedArgumentsLookup(masm, ecx, ebx, eax, &slow); |
| 676 __ cmp(unmapped_location, factory->the_hole_value()); | 676 __ cmp(unmapped_location, factory->the_hole_value()); |
| 677 __ j(equal, &slow); | 677 __ j(equal, &slow); |
| 678 __ mov(eax, unmapped_location); | 678 __ mov(eax, unmapped_location); |
| 679 __ Ret(); | 679 __ Ret(); |
| 680 __ bind(&slow); | 680 __ bind(&slow); |
| 681 GenerateMiss(masm); | 681 GenerateMiss(masm); |
| 682 } | 682 } |
| 683 | 683 |
| 684 | 684 |
| 685 void KeyedStoreIC::GenerateNonStrictArguments(MacroAssembler* masm) { | 685 void KeyedStoreIC::GenerateSloppyArguments(MacroAssembler* masm) { |
| 686 // ----------- S t a t e ------------- | 686 // ----------- S t a t e ------------- |
| 687 // -- eax : value | 687 // -- eax : value |
| 688 // -- ecx : key | 688 // -- ecx : key |
| 689 // -- edx : receiver | 689 // -- edx : receiver |
| 690 // -- esp[0] : return address | 690 // -- esp[0] : return address |
| 691 // ----------------------------------- | 691 // ----------------------------------- |
| 692 Label slow, notin; | 692 Label slow, notin; |
| 693 Operand mapped_location = | 693 Operand mapped_location = |
| 694 GenerateMappedArgumentsLookup(masm, edx, ecx, ebx, edi, ¬in, &slow); | 694 GenerateMappedArgumentsLookup(masm, edx, ecx, ebx, edi, ¬in, &slow); |
| 695 __ mov(mapped_location, eax); | 695 __ mov(mapped_location, eax); |
| (...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1300 Condition cc = (check == ENABLE_INLINED_SMI_CHECK) | 1300 Condition cc = (check == ENABLE_INLINED_SMI_CHECK) |
| 1301 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) | 1301 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) |
| 1302 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); | 1302 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); |
| 1303 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 1303 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
| 1304 } | 1304 } |
| 1305 | 1305 |
| 1306 | 1306 |
| 1307 } } // namespace v8::internal | 1307 } } // namespace v8::internal |
| 1308 | 1308 |
| 1309 #endif // V8_TARGET_ARCH_IA32 | 1309 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |