| 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 | 5 |
| 6 #include "src/v8.h" | 6 #include "src/v8.h" |
| 7 | 7 |
| 8 #if V8_TARGET_ARCH_MIPS | 8 #if V8_TARGET_ARCH_MIPS |
| 9 | 9 |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| 11 #include "src/ic/ic.h" | 11 #include "src/ic/ic.h" |
| 12 #include "src/ic/ic-compiler.h" |
| 12 #include "src/ic/stub-cache.h" | 13 #include "src/ic/stub-cache.h" |
| 13 | 14 |
| 14 namespace v8 { | 15 namespace v8 { |
| 15 namespace internal { | 16 namespace internal { |
| 16 | 17 |
| 17 | 18 |
| 18 // ---------------------------------------------------------------------------- | 19 // ---------------------------------------------------------------------------- |
| 19 // Static IC stub generators. | 20 // Static IC stub generators. |
| 20 // | 21 // |
| 21 | 22 |
| (...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 __ Ret(); | 681 __ Ret(); |
| 681 | 682 |
| 682 StubRuntimeCallHelper call_helper; | 683 StubRuntimeCallHelper call_helper; |
| 683 char_at_generator.GenerateSlow(masm, call_helper); | 684 char_at_generator.GenerateSlow(masm, call_helper); |
| 684 | 685 |
| 685 __ bind(&miss); | 686 __ bind(&miss); |
| 686 GenerateMiss(masm); | 687 GenerateMiss(masm); |
| 687 } | 688 } |
| 688 | 689 |
| 689 | 690 |
| 690 void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm, | |
| 691 StrictMode strict_mode) { | |
| 692 // Push receiver, key and value for runtime call. | |
| 693 __ Push(ReceiverRegister(), NameRegister(), ValueRegister()); | |
| 694 __ li(a0, Operand(Smi::FromInt(strict_mode))); // Strict mode. | |
| 695 __ Push(a0); | |
| 696 | |
| 697 __ TailCallRuntime(Runtime::kSetProperty, 4, 1); | |
| 698 } | |
| 699 | |
| 700 | |
| 701 static void KeyedStoreGenerateGenericHelper( | 691 static void KeyedStoreGenerateGenericHelper( |
| 702 MacroAssembler* masm, Label* fast_object, Label* fast_double, Label* slow, | 692 MacroAssembler* masm, Label* fast_object, Label* fast_double, Label* slow, |
| 703 KeyedStoreCheckMap check_map, KeyedStoreIncrementLength increment_length, | 693 KeyedStoreCheckMap check_map, KeyedStoreIncrementLength increment_length, |
| 704 Register value, Register key, Register receiver, Register receiver_map, | 694 Register value, Register key, Register receiver, Register receiver_map, |
| 705 Register elements_map, Register elements) { | 695 Register elements_map, Register elements) { |
| 706 Label transition_smi_elements; | 696 Label transition_smi_elements; |
| 707 Label finish_object_store, non_double_value, transition_double_elements; | 697 Label finish_object_store, non_double_value, transition_double_elements; |
| 708 Label fast_double_without_map_check; | 698 Label fast_double_without_map_check; |
| 709 | 699 |
| 710 // Fast case: Do the store, could be either Object or double. | 700 // Fast case: Do the store, could be either Object or double. |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 889 // Check array bounds. Both the key and the length of FixedArray are smis. | 879 // Check array bounds. Both the key and the length of FixedArray are smis. |
| 890 __ lw(t0, FieldMemOperand(elements, FixedArray::kLengthOffset)); | 880 __ lw(t0, FieldMemOperand(elements, FixedArray::kLengthOffset)); |
| 891 __ Branch(&fast_object, lo, key, Operand(t0)); | 881 __ Branch(&fast_object, lo, key, Operand(t0)); |
| 892 | 882 |
| 893 // Slow case, handle jump to runtime. | 883 // Slow case, handle jump to runtime. |
| 894 __ bind(&slow); | 884 __ bind(&slow); |
| 895 // Entry registers are intact. | 885 // Entry registers are intact. |
| 896 // a0: value. | 886 // a0: value. |
| 897 // a1: key. | 887 // a1: key. |
| 898 // a2: receiver. | 888 // a2: receiver. |
| 899 GenerateRuntimeSetProperty(masm, strict_mode); | 889 PropertyICCompiler::GenerateRuntimeSetProperty(masm, strict_mode); |
| 900 | 890 |
| 901 // Extra capacity case: Check if there is extra capacity to | 891 // Extra capacity case: Check if there is extra capacity to |
| 902 // perform the store and update the length. Used for adding one | 892 // perform the store and update the length. Used for adding one |
| 903 // element to the array by writing to array[array.length]. | 893 // element to the array by writing to array[array.length]. |
| 904 __ bind(&extra); | 894 __ bind(&extra); |
| 905 // Condition code from comparing key and array length is still available. | 895 // Condition code from comparing key and array length is still available. |
| 906 // Only support writing to array[array.length]. | 896 // Only support writing to array[array.length]. |
| 907 __ Branch(&slow, ne, key, Operand(t0)); | 897 __ Branch(&slow, ne, key, Operand(t0)); |
| 908 // Check for room in the elements backing store. | 898 // Check for room in the elements backing store. |
| 909 // Both the key and the length of FixedArray are smis. | 899 // Both the key and the length of FixedArray are smis. |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1058 Counters* counters = masm->isolate()->counters(); | 1048 Counters* counters = masm->isolate()->counters(); |
| 1059 __ IncrementCounter(counters->store_normal_hit(), 1, t0, t1); | 1049 __ IncrementCounter(counters->store_normal_hit(), 1, t0, t1); |
| 1060 __ Ret(); | 1050 __ Ret(); |
| 1061 | 1051 |
| 1062 __ bind(&miss); | 1052 __ bind(&miss); |
| 1063 __ IncrementCounter(counters->store_normal_miss(), 1, t0, t1); | 1053 __ IncrementCounter(counters->store_normal_miss(), 1, t0, t1); |
| 1064 GenerateMiss(masm); | 1054 GenerateMiss(masm); |
| 1065 } | 1055 } |
| 1066 | 1056 |
| 1067 | 1057 |
| 1068 void StoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm, | |
| 1069 StrictMode strict_mode) { | |
| 1070 __ Push(ReceiverRegister(), NameRegister(), ValueRegister()); | |
| 1071 | |
| 1072 __ li(a0, Operand(Smi::FromInt(strict_mode))); | |
| 1073 __ Push(a0); | |
| 1074 | |
| 1075 // Do tail-call to runtime routine. | |
| 1076 __ TailCallRuntime(Runtime::kSetProperty, 4, 1); | |
| 1077 } | |
| 1078 | |
| 1079 | |
| 1080 #undef __ | 1058 #undef __ |
| 1081 | 1059 |
| 1082 | 1060 |
| 1083 Condition CompareIC::ComputeCondition(Token::Value op) { | 1061 Condition CompareIC::ComputeCondition(Token::Value op) { |
| 1084 switch (op) { | 1062 switch (op) { |
| 1085 case Token::EQ_STRICT: | 1063 case Token::EQ_STRICT: |
| 1086 case Token::EQ: | 1064 case Token::EQ: |
| 1087 return eq; | 1065 return eq; |
| 1088 case Token::LT: | 1066 case Token::LT: |
| 1089 return lt; | 1067 return lt; |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1169 patcher.ChangeBranchCondition(ne); | 1147 patcher.ChangeBranchCondition(ne); |
| 1170 } else { | 1148 } else { |
| 1171 DCHECK(Assembler::IsBne(branch_instr)); | 1149 DCHECK(Assembler::IsBne(branch_instr)); |
| 1172 patcher.ChangeBranchCondition(eq); | 1150 patcher.ChangeBranchCondition(eq); |
| 1173 } | 1151 } |
| 1174 } | 1152 } |
| 1175 } | 1153 } |
| 1176 } // namespace v8::internal | 1154 } // namespace v8::internal |
| 1177 | 1155 |
| 1178 #endif // V8_TARGET_ARCH_MIPS | 1156 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |