OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_ARM | 7 #if V8_TARGET_ARCH_ARM |
8 | 8 |
9 #include "src/arm/assembler-arm.h" | 9 #include "src/arm/assembler-arm.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 __ ldr(map, FieldMemOperand(receiver, HeapObject::kMapOffset)); | 162 __ ldr(map, FieldMemOperand(receiver, HeapObject::kMapOffset)); |
163 // Check bit field. | 163 // Check bit field. |
164 __ ldrb(scratch, FieldMemOperand(map, Map::kBitFieldOffset)); | 164 __ ldrb(scratch, FieldMemOperand(map, Map::kBitFieldOffset)); |
165 __ tst(scratch, | 165 __ tst(scratch, |
166 Operand((1 << Map::kIsAccessCheckNeeded) | (1 << interceptor_bit))); | 166 Operand((1 << Map::kIsAccessCheckNeeded) | (1 << interceptor_bit))); |
167 __ b(ne, slow); | 167 __ b(ne, slow); |
168 // Check that the object is some kind of JS object EXCEPT JS Value type. | 168 // Check that the object is some kind of JS object EXCEPT JS Value type. |
169 // In the case that the object is a value-wrapper object, | 169 // In the case that the object is a value-wrapper object, |
170 // we enter the runtime system to make sure that indexing into string | 170 // we enter the runtime system to make sure that indexing into string |
171 // objects work as intended. | 171 // objects work as intended. |
172 ASSERT(JS_OBJECT_TYPE > JS_VALUE_TYPE); | 172 DCHECK(JS_OBJECT_TYPE > JS_VALUE_TYPE); |
173 __ ldrb(scratch, FieldMemOperand(map, Map::kInstanceTypeOffset)); | 173 __ ldrb(scratch, FieldMemOperand(map, Map::kInstanceTypeOffset)); |
174 __ cmp(scratch, Operand(JS_OBJECT_TYPE)); | 174 __ cmp(scratch, Operand(JS_OBJECT_TYPE)); |
175 __ b(lt, slow); | 175 __ b(lt, slow); |
176 } | 176 } |
177 | 177 |
178 | 178 |
179 // Loads an indexed element from a fast case array. | 179 // Loads an indexed element from a fast case array. |
180 // If not_fast_array is NULL, doesn't perform the elements map check. | 180 // If not_fast_array is NULL, doesn't perform the elements map check. |
181 static void GenerateFastArrayLoad(MacroAssembler* masm, | 181 static void GenerateFastArrayLoad(MacroAssembler* masm, |
182 Register receiver, | 182 Register receiver, |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 __ b(ne, not_unique); | 265 __ b(ne, not_unique); |
266 | 266 |
267 __ bind(&unique); | 267 __ bind(&unique); |
268 } | 268 } |
269 | 269 |
270 | 270 |
271 void LoadIC::GenerateMegamorphic(MacroAssembler* masm) { | 271 void LoadIC::GenerateMegamorphic(MacroAssembler* masm) { |
272 // The return address is in lr. | 272 // The return address is in lr. |
273 Register receiver = ReceiverRegister(); | 273 Register receiver = ReceiverRegister(); |
274 Register name = NameRegister(); | 274 Register name = NameRegister(); |
275 ASSERT(receiver.is(r1)); | 275 DCHECK(receiver.is(r1)); |
276 ASSERT(name.is(r2)); | 276 DCHECK(name.is(r2)); |
277 | 277 |
278 // Probe the stub cache. | 278 // Probe the stub cache. |
279 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 279 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( |
280 Code::ComputeHandlerFlags(Code::LOAD_IC)); | 280 Code::ComputeHandlerFlags(Code::LOAD_IC)); |
281 masm->isolate()->stub_cache()->GenerateProbe( | 281 masm->isolate()->stub_cache()->GenerateProbe( |
282 masm, flags, receiver, name, r3, r4, r5, r6); | 282 masm, flags, receiver, name, r3, r4, r5, r6); |
283 | 283 |
284 // Cache miss: Jump to runtime. | 284 // Cache miss: Jump to runtime. |
285 GenerateMiss(masm); | 285 GenerateMiss(masm); |
286 } | 286 } |
287 | 287 |
288 | 288 |
289 void LoadIC::GenerateNormal(MacroAssembler* masm) { | 289 void LoadIC::GenerateNormal(MacroAssembler* masm) { |
290 Register dictionary = r0; | 290 Register dictionary = r0; |
291 ASSERT(!dictionary.is(ReceiverRegister())); | 291 DCHECK(!dictionary.is(ReceiverRegister())); |
292 ASSERT(!dictionary.is(NameRegister())); | 292 DCHECK(!dictionary.is(NameRegister())); |
293 | 293 |
294 Label slow; | 294 Label slow; |
295 | 295 |
296 __ ldr(dictionary, | 296 __ ldr(dictionary, |
297 FieldMemOperand(ReceiverRegister(), JSObject::kPropertiesOffset)); | 297 FieldMemOperand(ReceiverRegister(), JSObject::kPropertiesOffset)); |
298 GenerateDictionaryLoad(masm, &slow, dictionary, NameRegister(), r0, r3, r4); | 298 GenerateDictionaryLoad(masm, &slow, dictionary, NameRegister(), r0, r3, r4); |
299 __ Ret(); | 299 __ Ret(); |
300 | 300 |
301 // Dictionary load failed, go slow (but don't miss). | 301 // Dictionary load failed, go slow (but don't miss). |
302 __ bind(&slow); | 302 __ bind(&slow); |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 scratch, | 416 scratch, |
417 Operand(FixedArray::kHeaderSize - kHeapObjectTag)); | 417 Operand(FixedArray::kHeaderSize - kHeapObjectTag)); |
418 return MemOperand(backing_store, scratch); | 418 return MemOperand(backing_store, scratch); |
419 } | 419 } |
420 | 420 |
421 | 421 |
422 void KeyedLoadIC::GenerateSloppyArguments(MacroAssembler* masm) { | 422 void KeyedLoadIC::GenerateSloppyArguments(MacroAssembler* masm) { |
423 // The return address is in lr. | 423 // The return address is in lr. |
424 Register receiver = ReceiverRegister(); | 424 Register receiver = ReceiverRegister(); |
425 Register key = NameRegister(); | 425 Register key = NameRegister(); |
426 ASSERT(receiver.is(r1)); | 426 DCHECK(receiver.is(r1)); |
427 ASSERT(key.is(r2)); | 427 DCHECK(key.is(r2)); |
428 | 428 |
429 Label slow, notin; | 429 Label slow, notin; |
430 MemOperand mapped_location = | 430 MemOperand mapped_location = |
431 GenerateMappedArgumentsLookup( | 431 GenerateMappedArgumentsLookup( |
432 masm, receiver, key, r0, r3, r4, ¬in, &slow); | 432 masm, receiver, key, r0, r3, r4, ¬in, &slow); |
433 __ ldr(r0, mapped_location); | 433 __ ldr(r0, mapped_location); |
434 __ Ret(); | 434 __ Ret(); |
435 __ bind(¬in); | 435 __ bind(¬in); |
436 // The unmapped lookup expects that the parameter map is in r0. | 436 // The unmapped lookup expects that the parameter map is in r0. |
437 MemOperand unmapped_location = | 437 MemOperand unmapped_location = |
438 GenerateUnmappedArgumentsLookup(masm, key, r0, r3, &slow); | 438 GenerateUnmappedArgumentsLookup(masm, key, r0, r3, &slow); |
439 __ ldr(r0, unmapped_location); | 439 __ ldr(r0, unmapped_location); |
440 __ LoadRoot(r3, Heap::kTheHoleValueRootIndex); | 440 __ LoadRoot(r3, Heap::kTheHoleValueRootIndex); |
441 __ cmp(r0, r3); | 441 __ cmp(r0, r3); |
442 __ b(eq, &slow); | 442 __ b(eq, &slow); |
443 __ Ret(); | 443 __ Ret(); |
444 __ bind(&slow); | 444 __ bind(&slow); |
445 GenerateMiss(masm); | 445 GenerateMiss(masm); |
446 } | 446 } |
447 | 447 |
448 | 448 |
449 void KeyedStoreIC::GenerateSloppyArguments(MacroAssembler* masm) { | 449 void KeyedStoreIC::GenerateSloppyArguments(MacroAssembler* masm) { |
450 Register receiver = ReceiverRegister(); | 450 Register receiver = ReceiverRegister(); |
451 Register key = NameRegister(); | 451 Register key = NameRegister(); |
452 Register value = ValueRegister(); | 452 Register value = ValueRegister(); |
453 ASSERT(receiver.is(r1)); | 453 DCHECK(receiver.is(r1)); |
454 ASSERT(key.is(r2)); | 454 DCHECK(key.is(r2)); |
455 ASSERT(value.is(r0)); | 455 DCHECK(value.is(r0)); |
456 | 456 |
457 Label slow, notin; | 457 Label slow, notin; |
458 MemOperand mapped_location = GenerateMappedArgumentsLookup( | 458 MemOperand mapped_location = GenerateMappedArgumentsLookup( |
459 masm, receiver, key, r3, r4, r5, ¬in, &slow); | 459 masm, receiver, key, r3, r4, r5, ¬in, &slow); |
460 __ str(value, mapped_location); | 460 __ str(value, mapped_location); |
461 __ add(r6, r3, r5); | 461 __ add(r6, r3, r5); |
462 __ mov(r9, value); | 462 __ mov(r9, value); |
463 __ RecordWrite(r3, r6, r9, kLRHasNotBeenSaved, kDontSaveFPRegs); | 463 __ RecordWrite(r3, r6, r9, kLRHasNotBeenSaved, kDontSaveFPRegs); |
464 __ Ret(); | 464 __ Ret(); |
465 __ bind(¬in); | 465 __ bind(¬in); |
(...skipping 25 matching lines...) Expand all Loading... |
491 __ TailCallExternalReference(ref, 2, 1); | 491 __ TailCallExternalReference(ref, 2, 1); |
492 } | 492 } |
493 | 493 |
494 | 494 |
495 // IC register specifications | 495 // IC register specifications |
496 const Register LoadIC::ReceiverRegister() { return r1; } | 496 const Register LoadIC::ReceiverRegister() { return r1; } |
497 const Register LoadIC::NameRegister() { return r2; } | 497 const Register LoadIC::NameRegister() { return r2; } |
498 | 498 |
499 | 499 |
500 const Register LoadIC::SlotRegister() { | 500 const Register LoadIC::SlotRegister() { |
501 ASSERT(FLAG_vector_ics); | 501 DCHECK(FLAG_vector_ics); |
502 return r0; | 502 return r0; |
503 } | 503 } |
504 | 504 |
505 | 505 |
506 const Register LoadIC::VectorRegister() { | 506 const Register LoadIC::VectorRegister() { |
507 ASSERT(FLAG_vector_ics); | 507 DCHECK(FLAG_vector_ics); |
508 return r3; | 508 return r3; |
509 } | 509 } |
510 | 510 |
511 | 511 |
512 const Register StoreIC::ReceiverRegister() { return r1; } | 512 const Register StoreIC::ReceiverRegister() { return r1; } |
513 const Register StoreIC::NameRegister() { return r2; } | 513 const Register StoreIC::NameRegister() { return r2; } |
514 const Register StoreIC::ValueRegister() { return r0; } | 514 const Register StoreIC::ValueRegister() { return r0; } |
515 | 515 |
516 | 516 |
517 const Register KeyedStoreIC::MapRegister() { | 517 const Register KeyedStoreIC::MapRegister() { |
(...skipping 10 matching lines...) Expand all Loading... |
528 } | 528 } |
529 | 529 |
530 | 530 |
531 void KeyedLoadIC::GenerateGeneric(MacroAssembler* masm) { | 531 void KeyedLoadIC::GenerateGeneric(MacroAssembler* masm) { |
532 // The return address is in lr. | 532 // The return address is in lr. |
533 Label slow, check_name, index_smi, index_name, property_array_property; | 533 Label slow, check_name, index_smi, index_name, property_array_property; |
534 Label probe_dictionary, check_number_dictionary; | 534 Label probe_dictionary, check_number_dictionary; |
535 | 535 |
536 Register key = NameRegister(); | 536 Register key = NameRegister(); |
537 Register receiver = ReceiverRegister(); | 537 Register receiver = ReceiverRegister(); |
538 ASSERT(key.is(r2)); | 538 DCHECK(key.is(r2)); |
539 ASSERT(receiver.is(r1)); | 539 DCHECK(receiver.is(r1)); |
540 | 540 |
541 Isolate* isolate = masm->isolate(); | 541 Isolate* isolate = masm->isolate(); |
542 | 542 |
543 // Check that the key is a smi. | 543 // Check that the key is a smi. |
544 __ JumpIfNotSmi(key, &check_name); | 544 __ JumpIfNotSmi(key, &check_name); |
545 __ bind(&index_smi); | 545 __ bind(&index_smi); |
546 // Now the key is known to be a smi. This place is also jumped to from below | 546 // Now the key is known to be a smi. This place is also jumped to from below |
547 // where a numeric string is converted to a smi. | 547 // where a numeric string is converted to a smi. |
548 | 548 |
549 GenerateKeyedLoadReceiverCheck( | 549 GenerateKeyedLoadReceiverCheck( |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
693 | 693 |
694 | 694 |
695 void KeyedLoadIC::GenerateString(MacroAssembler* masm) { | 695 void KeyedLoadIC::GenerateString(MacroAssembler* masm) { |
696 // Return address is in lr. | 696 // Return address is in lr. |
697 Label miss; | 697 Label miss; |
698 | 698 |
699 Register receiver = ReceiverRegister(); | 699 Register receiver = ReceiverRegister(); |
700 Register index = NameRegister(); | 700 Register index = NameRegister(); |
701 Register scratch = r3; | 701 Register scratch = r3; |
702 Register result = r0; | 702 Register result = r0; |
703 ASSERT(!scratch.is(receiver) && !scratch.is(index)); | 703 DCHECK(!scratch.is(receiver) && !scratch.is(index)); |
704 | 704 |
705 StringCharAtGenerator char_at_generator(receiver, | 705 StringCharAtGenerator char_at_generator(receiver, |
706 index, | 706 index, |
707 scratch, | 707 scratch, |
708 result, | 708 result, |
709 &miss, // When not a string. | 709 &miss, // When not a string. |
710 &miss, // When not a number. | 710 &miss, // When not a number. |
711 &miss, // When index out of range. | 711 &miss, // When index out of range. |
712 STRING_INDEX_IS_ARRAY_INDEX); | 712 STRING_INDEX_IS_ARRAY_INDEX); |
713 char_at_generator.GenerateFast(masm); | 713 char_at_generator.GenerateFast(masm); |
714 __ Ret(); | 714 __ Ret(); |
715 | 715 |
716 StubRuntimeCallHelper call_helper; | 716 StubRuntimeCallHelper call_helper; |
717 char_at_generator.GenerateSlow(masm, call_helper); | 717 char_at_generator.GenerateSlow(masm, call_helper); |
718 | 718 |
719 __ bind(&miss); | 719 __ bind(&miss); |
720 GenerateMiss(masm); | 720 GenerateMiss(masm); |
721 } | 721 } |
722 | 722 |
723 | 723 |
724 void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) { | 724 void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) { |
725 // Return address is in lr. | 725 // Return address is in lr. |
726 Label slow; | 726 Label slow; |
727 | 727 |
728 Register receiver = ReceiverRegister(); | 728 Register receiver = ReceiverRegister(); |
729 Register key = NameRegister(); | 729 Register key = NameRegister(); |
730 Register scratch1 = r3; | 730 Register scratch1 = r3; |
731 Register scratch2 = r4; | 731 Register scratch2 = r4; |
732 ASSERT(!scratch1.is(receiver) && !scratch1.is(key)); | 732 DCHECK(!scratch1.is(receiver) && !scratch1.is(key)); |
733 ASSERT(!scratch2.is(receiver) && !scratch2.is(key)); | 733 DCHECK(!scratch2.is(receiver) && !scratch2.is(key)); |
734 | 734 |
735 // Check that the receiver isn't a smi. | 735 // Check that the receiver isn't a smi. |
736 __ JumpIfSmi(receiver, &slow); | 736 __ JumpIfSmi(receiver, &slow); |
737 | 737 |
738 // Check that the key is an array index, that is Uint32. | 738 // Check that the key is an array index, that is Uint32. |
739 __ NonNegativeSmiTst(key); | 739 __ NonNegativeSmiTst(key); |
740 __ b(ne, &slow); | 740 __ b(ne, &slow); |
741 | 741 |
742 // Get the map of the receiver. | 742 // Get the map of the receiver. |
743 __ ldr(scratch1, FieldMemOperand(receiver, HeapObject::kMapOffset)); | 743 __ ldr(scratch1, FieldMemOperand(receiver, HeapObject::kMapOffset)); |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
981 // -- lr : return address | 981 // -- lr : return address |
982 // ----------------------------------- | 982 // ----------------------------------- |
983 Label slow, fast_object, fast_object_grow; | 983 Label slow, fast_object, fast_object_grow; |
984 Label fast_double, fast_double_grow; | 984 Label fast_double, fast_double_grow; |
985 Label array, extra, check_if_double_array; | 985 Label array, extra, check_if_double_array; |
986 | 986 |
987 // Register usage. | 987 // Register usage. |
988 Register value = ValueRegister(); | 988 Register value = ValueRegister(); |
989 Register key = NameRegister(); | 989 Register key = NameRegister(); |
990 Register receiver = ReceiverRegister(); | 990 Register receiver = ReceiverRegister(); |
991 ASSERT(receiver.is(r1)); | 991 DCHECK(receiver.is(r1)); |
992 ASSERT(key.is(r2)); | 992 DCHECK(key.is(r2)); |
993 ASSERT(value.is(r0)); | 993 DCHECK(value.is(r0)); |
994 Register receiver_map = r3; | 994 Register receiver_map = r3; |
995 Register elements_map = r6; | 995 Register elements_map = r6; |
996 Register elements = r9; // Elements array of the receiver. | 996 Register elements = r9; // Elements array of the receiver. |
997 // r4 and r5 are used as general scratch registers. | 997 // r4 and r5 are used as general scratch registers. |
998 | 998 |
999 // Check that the key is a smi. | 999 // Check that the key is a smi. |
1000 __ JumpIfNotSmi(key, &slow); | 1000 __ JumpIfNotSmi(key, &slow); |
1001 // Check that the object isn't a smi. | 1001 // Check that the object isn't a smi. |
1002 __ JumpIfSmi(receiver, &slow); | 1002 __ JumpIfSmi(receiver, &slow); |
1003 // Get the map of the object. | 1003 // Get the map of the object. |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1071 KeyedStoreGenerateGenericHelper(masm, &fast_object_grow, &fast_double_grow, | 1071 KeyedStoreGenerateGenericHelper(masm, &fast_object_grow, &fast_double_grow, |
1072 &slow, kDontCheckMap, kIncrementLength, | 1072 &slow, kDontCheckMap, kIncrementLength, |
1073 value, key, receiver, receiver_map, | 1073 value, key, receiver, receiver_map, |
1074 elements_map, elements); | 1074 elements_map, elements); |
1075 } | 1075 } |
1076 | 1076 |
1077 | 1077 |
1078 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { | 1078 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { |
1079 Register receiver = ReceiverRegister(); | 1079 Register receiver = ReceiverRegister(); |
1080 Register name = NameRegister(); | 1080 Register name = NameRegister(); |
1081 ASSERT(receiver.is(r1)); | 1081 DCHECK(receiver.is(r1)); |
1082 ASSERT(name.is(r2)); | 1082 DCHECK(name.is(r2)); |
1083 ASSERT(ValueRegister().is(r0)); | 1083 DCHECK(ValueRegister().is(r0)); |
1084 | 1084 |
1085 // Get the receiver from the stack and probe the stub cache. | 1085 // Get the receiver from the stack and probe the stub cache. |
1086 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 1086 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( |
1087 Code::ComputeHandlerFlags(Code::STORE_IC)); | 1087 Code::ComputeHandlerFlags(Code::STORE_IC)); |
1088 | 1088 |
1089 masm->isolate()->stub_cache()->GenerateProbe( | 1089 masm->isolate()->stub_cache()->GenerateProbe( |
1090 masm, flags, receiver, name, r3, r4, r5, r6); | 1090 masm, flags, receiver, name, r3, r4, r5, r6); |
1091 | 1091 |
1092 // Cache miss: Jump to runtime. | 1092 // Cache miss: Jump to runtime. |
1093 GenerateMiss(masm); | 1093 GenerateMiss(masm); |
1094 } | 1094 } |
1095 | 1095 |
1096 | 1096 |
1097 void StoreIC::GenerateMiss(MacroAssembler* masm) { | 1097 void StoreIC::GenerateMiss(MacroAssembler* masm) { |
1098 __ Push(ReceiverRegister(), NameRegister(), ValueRegister()); | 1098 __ Push(ReceiverRegister(), NameRegister(), ValueRegister()); |
1099 | 1099 |
1100 // Perform tail call to the entry. | 1100 // Perform tail call to the entry. |
1101 ExternalReference ref = | 1101 ExternalReference ref = |
1102 ExternalReference(IC_Utility(kStoreIC_Miss), masm->isolate()); | 1102 ExternalReference(IC_Utility(kStoreIC_Miss), masm->isolate()); |
1103 __ TailCallExternalReference(ref, 3, 1); | 1103 __ TailCallExternalReference(ref, 3, 1); |
1104 } | 1104 } |
1105 | 1105 |
1106 | 1106 |
1107 void StoreIC::GenerateNormal(MacroAssembler* masm) { | 1107 void StoreIC::GenerateNormal(MacroAssembler* masm) { |
1108 Label miss; | 1108 Label miss; |
1109 Register receiver = ReceiverRegister(); | 1109 Register receiver = ReceiverRegister(); |
1110 Register name = NameRegister(); | 1110 Register name = NameRegister(); |
1111 Register value = ValueRegister(); | 1111 Register value = ValueRegister(); |
1112 Register dictionary = r3; | 1112 Register dictionary = r3; |
1113 ASSERT(receiver.is(r1)); | 1113 DCHECK(receiver.is(r1)); |
1114 ASSERT(name.is(r2)); | 1114 DCHECK(name.is(r2)); |
1115 ASSERT(value.is(r0)); | 1115 DCHECK(value.is(r0)); |
1116 | 1116 |
1117 __ ldr(dictionary, FieldMemOperand(receiver, JSObject::kPropertiesOffset)); | 1117 __ ldr(dictionary, FieldMemOperand(receiver, JSObject::kPropertiesOffset)); |
1118 | 1118 |
1119 GenerateDictionaryStore(masm, &miss, dictionary, name, value, r4, r5); | 1119 GenerateDictionaryStore(masm, &miss, dictionary, name, value, r4, r5); |
1120 Counters* counters = masm->isolate()->counters(); | 1120 Counters* counters = masm->isolate()->counters(); |
1121 __ IncrementCounter(counters->store_normal_hit(), | 1121 __ IncrementCounter(counters->store_normal_hit(), |
1122 1, r4, r5); | 1122 1, r4, r5); |
1123 __ Ret(); | 1123 __ Ret(); |
1124 | 1124 |
1125 __ bind(&miss); | 1125 __ bind(&miss); |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1211 // Enabling by changing from | 1211 // Enabling by changing from |
1212 // cmp rx, rx | 1212 // cmp rx, rx |
1213 // b eq/ne, <target> | 1213 // b eq/ne, <target> |
1214 // to | 1214 // to |
1215 // tst rx, #kSmiTagMask | 1215 // tst rx, #kSmiTagMask |
1216 // b ne/eq, <target> | 1216 // b ne/eq, <target> |
1217 // and vice-versa to be disabled again. | 1217 // and vice-versa to be disabled again. |
1218 CodePatcher patcher(patch_address, 2); | 1218 CodePatcher patcher(patch_address, 2); |
1219 Register reg = Assembler::GetRn(instr_at_patch); | 1219 Register reg = Assembler::GetRn(instr_at_patch); |
1220 if (check == ENABLE_INLINED_SMI_CHECK) { | 1220 if (check == ENABLE_INLINED_SMI_CHECK) { |
1221 ASSERT(Assembler::IsCmpRegister(instr_at_patch)); | 1221 DCHECK(Assembler::IsCmpRegister(instr_at_patch)); |
1222 ASSERT_EQ(Assembler::GetRn(instr_at_patch).code(), | 1222 DCHECK_EQ(Assembler::GetRn(instr_at_patch).code(), |
1223 Assembler::GetRm(instr_at_patch).code()); | 1223 Assembler::GetRm(instr_at_patch).code()); |
1224 patcher.masm()->tst(reg, Operand(kSmiTagMask)); | 1224 patcher.masm()->tst(reg, Operand(kSmiTagMask)); |
1225 } else { | 1225 } else { |
1226 ASSERT(check == DISABLE_INLINED_SMI_CHECK); | 1226 DCHECK(check == DISABLE_INLINED_SMI_CHECK); |
1227 ASSERT(Assembler::IsTstImmediate(instr_at_patch)); | 1227 DCHECK(Assembler::IsTstImmediate(instr_at_patch)); |
1228 patcher.masm()->cmp(reg, reg); | 1228 patcher.masm()->cmp(reg, reg); |
1229 } | 1229 } |
1230 ASSERT(Assembler::IsBranch(branch_instr)); | 1230 DCHECK(Assembler::IsBranch(branch_instr)); |
1231 if (Assembler::GetCondition(branch_instr) == eq) { | 1231 if (Assembler::GetCondition(branch_instr) == eq) { |
1232 patcher.EmitCondition(ne); | 1232 patcher.EmitCondition(ne); |
1233 } else { | 1233 } else { |
1234 ASSERT(Assembler::GetCondition(branch_instr) == ne); | 1234 DCHECK(Assembler::GetCondition(branch_instr) == ne); |
1235 patcher.EmitCondition(eq); | 1235 patcher.EmitCondition(eq); |
1236 } | 1236 } |
1237 } | 1237 } |
1238 | 1238 |
1239 | 1239 |
1240 } } // namespace v8::internal | 1240 } } // namespace v8::internal |
1241 | 1241 |
1242 #endif // V8_TARGET_ARCH_ARM | 1242 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |