Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/ia32/ic-ia32.cc

Issue 196133017: Experimental parser: merge r19949 (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | src/ia32/lithium-codegen-ia32.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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, &notin, &slow); 669 GenerateMappedArgumentsLookup(masm, edx, ecx, ebx, eax, &notin, &slow);
670 __ mov(eax, mapped_location); 670 __ mov(eax, mapped_location);
671 __ Ret(); 671 __ Ret();
672 __ bind(&notin); 672 __ bind(&notin);
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, &notin, &slow); 694 GenerateMappedArgumentsLookup(masm, edx, ecx, ebx, edi, &notin, &slow);
695 __ mov(mapped_location, eax); 695 __ mov(mapped_location, eax);
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
852 edi, 852 edi,
853 slow); 853 slow);
854 mode = AllocationSite::GetMode(FAST_DOUBLE_ELEMENTS, FAST_ELEMENTS); 854 mode = AllocationSite::GetMode(FAST_DOUBLE_ELEMENTS, FAST_ELEMENTS);
855 ElementsTransitionGenerator::GenerateDoubleToObject(masm, mode, slow); 855 ElementsTransitionGenerator::GenerateDoubleToObject(masm, mode, slow);
856 __ mov(ebx, FieldOperand(edx, JSObject::kElementsOffset)); 856 __ mov(ebx, FieldOperand(edx, JSObject::kElementsOffset));
857 __ jmp(&finish_object_store); 857 __ jmp(&finish_object_store);
858 } 858 }
859 859
860 860
861 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm, 861 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm,
862 StrictModeFlag strict_mode) { 862 StrictMode strict_mode) {
863 // ----------- S t a t e ------------- 863 // ----------- S t a t e -------------
864 // -- eax : value 864 // -- eax : value
865 // -- ecx : key 865 // -- ecx : key
866 // -- edx : receiver 866 // -- edx : receiver
867 // -- esp[0] : return address 867 // -- esp[0] : return address
868 // ----------------------------------- 868 // -----------------------------------
869 Label slow, fast_object, fast_object_grow; 869 Label slow, fast_object, fast_object_grow;
870 Label fast_double, fast_double_grow; 870 Label fast_double, fast_double_grow;
871 Label array, extra, check_if_double_array; 871 Label array, extra, check_if_double_array;
872 872
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
1123 __ bind(&restore_miss); 1123 __ bind(&restore_miss);
1124 __ pop(edx); 1124 __ pop(edx);
1125 1125
1126 __ bind(&miss); 1126 __ bind(&miss);
1127 __ IncrementCounter(counters->store_normal_miss(), 1); 1127 __ IncrementCounter(counters->store_normal_miss(), 1);
1128 GenerateMiss(masm); 1128 GenerateMiss(masm);
1129 } 1129 }
1130 1130
1131 1131
1132 void StoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm, 1132 void StoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm,
1133 StrictModeFlag strict_mode) { 1133 StrictMode strict_mode) {
1134 // ----------- S t a t e ------------- 1134 // ----------- S t a t e -------------
1135 // -- eax : value 1135 // -- eax : value
1136 // -- ecx : name 1136 // -- ecx : name
1137 // -- edx : receiver 1137 // -- edx : receiver
1138 // -- esp[0] : return address 1138 // -- esp[0] : return address
1139 // ----------------------------------- 1139 // -----------------------------------
1140 __ pop(ebx); 1140 __ pop(ebx);
1141 __ push(edx); 1141 __ push(edx);
1142 __ push(ecx); 1142 __ push(ecx);
1143 __ push(eax); 1143 __ push(eax);
1144 __ push(Immediate(Smi::FromInt(NONE))); // PropertyAttributes 1144 __ push(Immediate(Smi::FromInt(NONE))); // PropertyAttributes
1145 __ push(Immediate(Smi::FromInt(strict_mode))); 1145 __ push(Immediate(Smi::FromInt(strict_mode)));
1146 __ push(ebx); // return address 1146 __ push(ebx); // return address
1147 1147
1148 // Do tail-call to runtime routine. 1148 // Do tail-call to runtime routine.
1149 __ TailCallRuntime(Runtime::kSetProperty, 5, 1); 1149 __ TailCallRuntime(Runtime::kSetProperty, 5, 1);
1150 } 1150 }
1151 1151
1152 1152
1153 void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm, 1153 void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm,
1154 StrictModeFlag strict_mode) { 1154 StrictMode strict_mode) {
1155 // ----------- S t a t e ------------- 1155 // ----------- S t a t e -------------
1156 // -- eax : value 1156 // -- eax : value
1157 // -- ecx : key 1157 // -- ecx : key
1158 // -- edx : receiver 1158 // -- edx : receiver
1159 // -- esp[0] : return address 1159 // -- esp[0] : return address
1160 // ----------------------------------- 1160 // -----------------------------------
1161 1161
1162 __ pop(ebx); 1162 __ pop(ebx);
1163 __ push(edx); 1163 __ push(edx);
1164 __ push(ecx); 1164 __ push(ecx);
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | src/ia32/lithium-codegen-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698