| 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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 Register map, | 222 Register map, |
| 223 Register scratch, | 223 Register scratch, |
| 224 int interceptor_bit, | 224 int interceptor_bit, |
| 225 Label* slow) { | 225 Label* slow) { |
| 226 // Check that the object isn't a smi. | 226 // Check that the object isn't a smi. |
| 227 __ JumpIfSmi(receiver, slow); | 227 __ JumpIfSmi(receiver, slow); |
| 228 // Get the map of the receiver. | 228 // Get the map of the receiver. |
| 229 __ lw(map, FieldMemOperand(receiver, HeapObject::kMapOffset)); | 229 __ lw(map, FieldMemOperand(receiver, HeapObject::kMapOffset)); |
| 230 // Check bit field. | 230 // Check bit field. |
| 231 __ lbu(scratch, FieldMemOperand(map, Map::kBitFieldOffset)); | 231 __ lbu(scratch, FieldMemOperand(map, Map::kBitFieldOffset)); |
| 232 __ And(at, scratch, | 232 __ And(at, scratch, Operand(KeyedLoadIC::kSlowCaseBitFieldMask)); |
| 233 Operand((1 << Map::kIsAccessCheckNeeded) | (1 << interceptor_bit))); | |
| 234 __ Branch(slow, ne, at, Operand(zero_reg)); | 233 __ Branch(slow, ne, at, Operand(zero_reg)); |
| 235 // Check that the object is some kind of JS object EXCEPT JS Value type. | 234 // Check that the object is some kind of JS object EXCEPT JS Value type. |
| 236 // In the case that the object is a value-wrapper object, | 235 // In the case that the object is a value-wrapper object, |
| 237 // we enter the runtime system to make sure that indexing into string | 236 // we enter the runtime system to make sure that indexing into string |
| 238 // objects work as intended. | 237 // objects work as intended. |
| 239 ASSERT(JS_OBJECT_TYPE > JS_VALUE_TYPE); | 238 ASSERT(JS_OBJECT_TYPE > JS_VALUE_TYPE); |
| 240 __ lbu(scratch, FieldMemOperand(map, Map::kInstanceTypeOffset)); | 239 __ lbu(scratch, FieldMemOperand(map, Map::kInstanceTypeOffset)); |
| 241 __ Branch(slow, lt, scratch, Operand(JS_OBJECT_TYPE)); | 240 __ Branch(slow, lt, scratch, Operand(JS_OBJECT_TYPE)); |
| 242 } | 241 } |
| 243 | 242 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 // map: key map | 331 // map: key map |
| 333 __ lbu(hash, FieldMemOperand(map, Map::kInstanceTypeOffset)); | 332 __ lbu(hash, FieldMemOperand(map, Map::kInstanceTypeOffset)); |
| 334 STATIC_ASSERT(kInternalizedTag == 0); | 333 STATIC_ASSERT(kInternalizedTag == 0); |
| 335 __ And(at, hash, Operand(kIsNotInternalizedMask)); | 334 __ And(at, hash, Operand(kIsNotInternalizedMask)); |
| 336 __ Branch(not_unique, ne, at, Operand(zero_reg)); | 335 __ Branch(not_unique, ne, at, Operand(zero_reg)); |
| 337 | 336 |
| 338 __ bind(&unique); | 337 __ bind(&unique); |
| 339 } | 338 } |
| 340 | 339 |
| 341 | 340 |
| 342 void LoadIC::GenerateMegamorphic(MacroAssembler* masm) { | 341 void LoadIC::GenerateMegamorphic(MacroAssembler* masm, |
| 342 ExtraICState extra_state) { |
| 343 // ----------- S t a t e ------------- | 343 // ----------- S t a t e ------------- |
| 344 // -- a2 : name | 344 // -- a2 : name |
| 345 // -- ra : return address | 345 // -- ra : return address |
| 346 // -- a0 : receiver | 346 // -- a0 : receiver |
| 347 // ----------------------------------- | 347 // ----------------------------------- |
| 348 | 348 |
| 349 // Probe the stub cache. | 349 // Probe the stub cache. |
| 350 Code::Flags flags = Code::ComputeHandlerFlags(Code::LOAD_IC); | 350 Code::Flags flags = Code::ComputeFlags( |
| 351 Code::HANDLER, MONOMORPHIC, extra_state, |
| 352 Code::NORMAL, Code::LOAD_IC); |
| 351 masm->isolate()->stub_cache()->GenerateProbe( | 353 masm->isolate()->stub_cache()->GenerateProbe( |
| 352 masm, flags, a0, a2, a3, t0, t1, t2); | 354 masm, flags, a0, a2, a3, t0, t1, t2); |
| 353 | 355 |
| 354 // Cache miss: Jump to runtime. | 356 // Cache miss: Jump to runtime. |
| 355 GenerateMiss(masm); | 357 GenerateMiss(masm); |
| 356 } | 358 } |
| 357 | 359 |
| 358 | 360 |
| 359 void LoadIC::GenerateNormal(MacroAssembler* masm) { | 361 void LoadIC::GenerateNormal(MacroAssembler* masm) { |
| 360 // ----------- S t a t e ------------- | 362 // ----------- S t a t e ------------- |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 640 __ IncrementCounter(isolate->counters()->keyed_load_generic_slow(), | 642 __ IncrementCounter(isolate->counters()->keyed_load_generic_slow(), |
| 641 1, | 643 1, |
| 642 a2, | 644 a2, |
| 643 a3); | 645 a3); |
| 644 GenerateRuntimeGetProperty(masm); | 646 GenerateRuntimeGetProperty(masm); |
| 645 | 647 |
| 646 __ bind(&check_name); | 648 __ bind(&check_name); |
| 647 GenerateKeyNameCheck(masm, key, a2, a3, &index_name, &slow); | 649 GenerateKeyNameCheck(masm, key, a2, a3, &index_name, &slow); |
| 648 | 650 |
| 649 GenerateKeyedLoadReceiverCheck( | 651 GenerateKeyedLoadReceiverCheck( |
| 650 masm, receiver, a2, a3, Map::kHasNamedInterceptor, &slow); | 652 masm, receiver, a2, a3, Map::kHasIndexedInterceptor, &slow); |
| 651 | 653 |
| 652 | 654 |
| 653 // If the receiver is a fast-case object, check the keyed lookup | 655 // If the receiver is a fast-case object, check the keyed lookup |
| 654 // cache. Otherwise probe the dictionary. | 656 // cache. Otherwise probe the dictionary. |
| 655 __ lw(a3, FieldMemOperand(a1, JSObject::kPropertiesOffset)); | 657 __ lw(a3, FieldMemOperand(a1, JSObject::kPropertiesOffset)); |
| 656 __ lw(t0, FieldMemOperand(a3, HeapObject::kMapOffset)); | 658 __ lw(t0, FieldMemOperand(a3, HeapObject::kMapOffset)); |
| 657 __ LoadRoot(at, Heap::kHashTableMapRootIndex); | 659 __ LoadRoot(at, Heap::kHashTableMapRootIndex); |
| 658 __ Branch(&probe_dictionary, eq, t0, Operand(at)); | 660 __ Branch(&probe_dictionary, eq, t0, Operand(at)); |
| 659 | 661 |
| 660 // Load the map of the receiver, compute the keyed lookup cache hash | 662 // Load the map of the receiver, compute the keyed lookup cache hash |
| (...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1171 | 1173 |
| 1172 // The slow case calls into the runtime to complete the store without causing | 1174 // The slow case calls into the runtime to complete the store without causing |
| 1173 // an IC miss that would otherwise cause a transition to the generic stub. | 1175 // an IC miss that would otherwise cause a transition to the generic stub. |
| 1174 ExternalReference ref = | 1176 ExternalReference ref = |
| 1175 ExternalReference(IC_Utility(kKeyedStoreIC_Slow), masm->isolate()); | 1177 ExternalReference(IC_Utility(kKeyedStoreIC_Slow), masm->isolate()); |
| 1176 | 1178 |
| 1177 __ TailCallExternalReference(ref, 3, 1); | 1179 __ TailCallExternalReference(ref, 3, 1); |
| 1178 } | 1180 } |
| 1179 | 1181 |
| 1180 | 1182 |
| 1181 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { | 1183 void StoreIC::GenerateMegamorphic(MacroAssembler* masm, |
| 1184 ExtraICState extra_ic_state) { |
| 1182 // ----------- S t a t e ------------- | 1185 // ----------- S t a t e ------------- |
| 1183 // -- a0 : value | 1186 // -- a0 : value |
| 1184 // -- a1 : receiver | 1187 // -- a1 : receiver |
| 1185 // -- a2 : name | 1188 // -- a2 : name |
| 1186 // -- ra : return address | 1189 // -- ra : return address |
| 1187 // ----------------------------------- | 1190 // ----------------------------------- |
| 1188 | 1191 |
| 1189 // Get the receiver from the stack and probe the stub cache. | 1192 // Get the receiver from the stack and probe the stub cache. |
| 1190 Code::Flags flags = Code::ComputeHandlerFlags(Code::STORE_IC); | 1193 Code::Flags flags = Code::ComputeFlags( |
| 1194 Code::HANDLER, MONOMORPHIC, extra_ic_state, |
| 1195 Code::NORMAL, Code::STORE_IC); |
| 1191 masm->isolate()->stub_cache()->GenerateProbe( | 1196 masm->isolate()->stub_cache()->GenerateProbe( |
| 1192 masm, flags, a1, a2, a3, t0, t1, t2); | 1197 masm, flags, a1, a2, a3, t0, t1, t2); |
| 1193 | 1198 |
| 1194 // Cache miss: Jump to runtime. | 1199 // Cache miss: Jump to runtime. |
| 1195 GenerateMiss(masm); | 1200 GenerateMiss(masm); |
| 1196 } | 1201 } |
| 1197 | 1202 |
| 1198 | 1203 |
| 1199 void StoreIC::GenerateMiss(MacroAssembler* masm) { | 1204 void StoreIC::GenerateMiss(MacroAssembler* masm) { |
| 1200 // ----------- S t a t e ------------- | 1205 // ----------- S t a t e ------------- |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1347 } else { | 1352 } else { |
| 1348 ASSERT(Assembler::IsBne(branch_instr)); | 1353 ASSERT(Assembler::IsBne(branch_instr)); |
| 1349 patcher.ChangeBranchCondition(eq); | 1354 patcher.ChangeBranchCondition(eq); |
| 1350 } | 1355 } |
| 1351 } | 1356 } |
| 1352 | 1357 |
| 1353 | 1358 |
| 1354 } } // namespace v8::internal | 1359 } } // namespace v8::internal |
| 1355 | 1360 |
| 1356 #endif // V8_TARGET_ARCH_MIPS | 1361 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |