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

Side by Side Diff: src/arm/ic-arm.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/arm/full-codegen-arm.cc ('k') | src/arm/lithium-arm.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 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 __ JumpIfSmi(object, slow_case); 420 __ JumpIfSmi(object, slow_case);
421 // Check that the object is some kind of JSObject. 421 // Check that the object is some kind of JSObject.
422 __ CompareObjectType(object, scratch1, scratch2, FIRST_JS_RECEIVER_TYPE); 422 __ CompareObjectType(object, scratch1, scratch2, FIRST_JS_RECEIVER_TYPE);
423 __ b(lt, slow_case); 423 __ b(lt, slow_case);
424 424
425 // Check that the key is a positive smi. 425 // Check that the key is a positive smi.
426 __ tst(key, Operand(0x80000001)); 426 __ tst(key, Operand(0x80000001));
427 __ b(ne, slow_case); 427 __ b(ne, slow_case);
428 428
429 // Load the elements into scratch1 and check its map. 429 // Load the elements into scratch1 and check its map.
430 Handle<Map> arguments_map(heap->non_strict_arguments_elements_map()); 430 Handle<Map> arguments_map(heap->sloppy_arguments_elements_map());
431 __ ldr(scratch1, FieldMemOperand(object, JSObject::kElementsOffset)); 431 __ ldr(scratch1, FieldMemOperand(object, JSObject::kElementsOffset));
432 __ CheckMap(scratch1, scratch2, arguments_map, slow_case, DONT_DO_SMI_CHECK); 432 __ CheckMap(scratch1, scratch2, arguments_map, slow_case, DONT_DO_SMI_CHECK);
433 433
434 // Check if element is in the range of mapped arguments. If not, jump 434 // Check if element is in the range of mapped arguments. If not, jump
435 // to the unmapped lookup with the parameter map in scratch1. 435 // to the unmapped lookup with the parameter map in scratch1.
436 __ ldr(scratch2, FieldMemOperand(scratch1, FixedArray::kLengthOffset)); 436 __ ldr(scratch2, FieldMemOperand(scratch1, FixedArray::kLengthOffset));
437 __ sub(scratch2, scratch2, Operand(Smi::FromInt(2))); 437 __ sub(scratch2, scratch2, Operand(Smi::FromInt(2)));
438 __ cmp(key, Operand(scratch2)); 438 __ cmp(key, Operand(scratch2));
439 __ b(cs, unmapped_case); 439 __ b(cs, unmapped_case);
440 440
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 __ b(cs, slow_case); 482 __ b(cs, slow_case);
483 __ mov(scratch, Operand(kPointerSize >> 1)); 483 __ mov(scratch, Operand(kPointerSize >> 1));
484 __ mul(scratch, key, scratch); 484 __ mul(scratch, key, scratch);
485 __ add(scratch, 485 __ add(scratch,
486 scratch, 486 scratch,
487 Operand(FixedArray::kHeaderSize - kHeapObjectTag)); 487 Operand(FixedArray::kHeaderSize - kHeapObjectTag));
488 return MemOperand(backing_store, scratch); 488 return MemOperand(backing_store, scratch);
489 } 489 }
490 490
491 491
492 void KeyedLoadIC::GenerateNonStrictArguments(MacroAssembler* masm) { 492 void KeyedLoadIC::GenerateSloppyArguments(MacroAssembler* masm) {
493 // ---------- S t a t e -------------- 493 // ---------- S t a t e --------------
494 // -- lr : return address 494 // -- lr : return address
495 // -- r0 : key 495 // -- r0 : key
496 // -- r1 : receiver 496 // -- r1 : receiver
497 // ----------------------------------- 497 // -----------------------------------
498 Label slow, notin; 498 Label slow, notin;
499 MemOperand mapped_location = 499 MemOperand mapped_location =
500 GenerateMappedArgumentsLookup(masm, r1, r0, r2, r3, r4, &notin, &slow); 500 GenerateMappedArgumentsLookup(masm, r1, r0, r2, r3, r4, &notin, &slow);
501 __ ldr(r0, mapped_location); 501 __ ldr(r0, mapped_location);
502 __ Ret(); 502 __ Ret();
503 __ bind(&notin); 503 __ bind(&notin);
504 // The unmapped lookup expects that the parameter map is in r2. 504 // The unmapped lookup expects that the parameter map is in r2.
505 MemOperand unmapped_location = 505 MemOperand unmapped_location =
506 GenerateUnmappedArgumentsLookup(masm, r0, r2, r3, &slow); 506 GenerateUnmappedArgumentsLookup(masm, r0, r2, r3, &slow);
507 __ ldr(r2, unmapped_location); 507 __ ldr(r2, unmapped_location);
508 __ LoadRoot(r3, Heap::kTheHoleValueRootIndex); 508 __ LoadRoot(r3, Heap::kTheHoleValueRootIndex);
509 __ cmp(r2, r3); 509 __ cmp(r2, r3);
510 __ b(eq, &slow); 510 __ b(eq, &slow);
511 __ mov(r0, r2); 511 __ mov(r0, r2);
512 __ Ret(); 512 __ Ret();
513 __ bind(&slow); 513 __ bind(&slow);
514 GenerateMiss(masm); 514 GenerateMiss(masm);
515 } 515 }
516 516
517 517
518 void KeyedStoreIC::GenerateNonStrictArguments(MacroAssembler* masm) { 518 void KeyedStoreIC::GenerateSloppyArguments(MacroAssembler* masm) {
519 // ---------- S t a t e -------------- 519 // ---------- S t a t e --------------
520 // -- r0 : value 520 // -- r0 : value
521 // -- r1 : key 521 // -- r1 : key
522 // -- r2 : receiver 522 // -- r2 : receiver
523 // -- lr : return address 523 // -- lr : return address
524 // ----------------------------------- 524 // -----------------------------------
525 Label slow, notin; 525 Label slow, notin;
526 MemOperand mapped_location = 526 MemOperand mapped_location =
527 GenerateMappedArgumentsLookup(masm, r2, r1, r3, r4, r5, &notin, &slow); 527 GenerateMappedArgumentsLookup(masm, r2, r1, r3, r4, r5, &notin, &slow);
528 __ str(r0, mapped_location); 528 __ str(r0, mapped_location);
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
869 869
870 // The slow case calls into the runtime to complete the store without causing 870 // The slow case calls into the runtime to complete the store without causing
871 // an IC miss that would otherwise cause a transition to the generic stub. 871 // an IC miss that would otherwise cause a transition to the generic stub.
872 ExternalReference ref = 872 ExternalReference ref =
873 ExternalReference(IC_Utility(kKeyedStoreIC_Slow), masm->isolate()); 873 ExternalReference(IC_Utility(kKeyedStoreIC_Slow), masm->isolate());
874 __ TailCallExternalReference(ref, 3, 1); 874 __ TailCallExternalReference(ref, 3, 1);
875 } 875 }
876 876
877 877
878 void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm, 878 void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm,
879 StrictModeFlag strict_mode) { 879 StrictMode strict_mode) {
880 // ---------- S t a t e -------------- 880 // ---------- S t a t e --------------
881 // -- r0 : value 881 // -- r0 : value
882 // -- r1 : key 882 // -- r1 : key
883 // -- r2 : receiver 883 // -- r2 : receiver
884 // -- lr : return address 884 // -- lr : return address
885 // ----------------------------------- 885 // -----------------------------------
886 886
887 // Push receiver, key and value for runtime call. 887 // Push receiver, key and value for runtime call.
888 __ Push(r2, r1, r0); 888 __ Push(r2, r1, r0);
889 889
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
1053 slow); 1053 slow);
1054 ASSERT(receiver_map.is(r3)); // Transition code expects map in r3 1054 ASSERT(receiver_map.is(r3)); // Transition code expects map in r3
1055 mode = AllocationSite::GetMode(FAST_DOUBLE_ELEMENTS, FAST_ELEMENTS); 1055 mode = AllocationSite::GetMode(FAST_DOUBLE_ELEMENTS, FAST_ELEMENTS);
1056 ElementsTransitionGenerator::GenerateDoubleToObject(masm, mode, slow); 1056 ElementsTransitionGenerator::GenerateDoubleToObject(masm, mode, slow);
1057 __ ldr(elements, FieldMemOperand(receiver, JSObject::kElementsOffset)); 1057 __ ldr(elements, FieldMemOperand(receiver, JSObject::kElementsOffset));
1058 __ jmp(&finish_object_store); 1058 __ jmp(&finish_object_store);
1059 } 1059 }
1060 1060
1061 1061
1062 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm, 1062 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm,
1063 StrictModeFlag strict_mode) { 1063 StrictMode strict_mode) {
1064 // ---------- S t a t e -------------- 1064 // ---------- S t a t e --------------
1065 // -- r0 : value 1065 // -- r0 : value
1066 // -- r1 : key 1066 // -- r1 : key
1067 // -- r2 : receiver 1067 // -- r2 : receiver
1068 // -- lr : return address 1068 // -- lr : return address
1069 // ----------------------------------- 1069 // -----------------------------------
1070 Label slow, fast_object, fast_object_grow; 1070 Label slow, fast_object, fast_object_grow;
1071 Label fast_double, fast_double_grow; 1071 Label fast_double, fast_double_grow;
1072 Label array, extra, check_if_double_array; 1072 Label array, extra, check_if_double_array;
1073 1073
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
1212 1, r4, r5); 1212 1, r4, r5);
1213 __ Ret(); 1213 __ Ret();
1214 1214
1215 __ bind(&miss); 1215 __ bind(&miss);
1216 __ IncrementCounter(counters->store_normal_miss(), 1, r4, r5); 1216 __ IncrementCounter(counters->store_normal_miss(), 1, r4, r5);
1217 GenerateMiss(masm); 1217 GenerateMiss(masm);
1218 } 1218 }
1219 1219
1220 1220
1221 void StoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm, 1221 void StoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm,
1222 StrictModeFlag strict_mode) { 1222 StrictMode strict_mode) {
1223 // ----------- S t a t e ------------- 1223 // ----------- S t a t e -------------
1224 // -- r0 : value 1224 // -- r0 : value
1225 // -- r1 : receiver 1225 // -- r1 : receiver
1226 // -- r2 : name 1226 // -- r2 : name
1227 // -- lr : return address 1227 // -- lr : return address
1228 // ----------------------------------- 1228 // -----------------------------------
1229 1229
1230 __ Push(r1, r2, r0); 1230 __ Push(r1, r2, r0);
1231 1231
1232 __ mov(r1, Operand(Smi::FromInt(NONE))); // PropertyAttributes 1232 __ mov(r1, Operand(Smi::FromInt(NONE))); // PropertyAttributes
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
1331 } else { 1331 } else {
1332 ASSERT(Assembler::GetCondition(branch_instr) == ne); 1332 ASSERT(Assembler::GetCondition(branch_instr) == ne);
1333 patcher.EmitCondition(eq); 1333 patcher.EmitCondition(eq);
1334 } 1334 }
1335 } 1335 }
1336 1336
1337 1337
1338 } } // namespace v8::internal 1338 } } // namespace v8::internal
1339 1339
1340 #endif // V8_TARGET_ARCH_ARM 1340 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/full-codegen-arm.cc ('k') | src/arm/lithium-arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698