| 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_X87 | 7 #if V8_TARGET_ARCH_X87 |
| 8 | 8 |
| 9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
| 10 #include "src/ic/ic.h" | 10 #include "src/ic/ic.h" |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 GenerateKeyedLoadReceiverCheck(masm, receiver, eax, Map::kHasNamedInterceptor, | 392 GenerateKeyedLoadReceiverCheck(masm, receiver, eax, Map::kHasNamedInterceptor, |
| 393 &slow); | 393 &slow); |
| 394 | 394 |
| 395 // If the receiver is a fast-case object, check the stub cache. Otherwise | 395 // If the receiver is a fast-case object, check the stub cache. Otherwise |
| 396 // probe the dictionary. | 396 // probe the dictionary. |
| 397 __ mov(ebx, FieldOperand(receiver, JSObject::kPropertiesOffset)); | 397 __ mov(ebx, FieldOperand(receiver, JSObject::kPropertiesOffset)); |
| 398 __ cmp(FieldOperand(ebx, HeapObject::kMapOffset), | 398 __ cmp(FieldOperand(ebx, HeapObject::kMapOffset), |
| 399 Immediate(isolate->factory()->hash_table_map())); | 399 Immediate(isolate->factory()->hash_table_map())); |
| 400 __ j(equal, &probe_dictionary); | 400 __ j(equal, &probe_dictionary); |
| 401 | 401 |
| 402 if (FLAG_vector_ics) { |
| 403 // When vector ics are in use, the handlers in the stub cache expect a |
| 404 // vector and slot. Since we won't change the IC from any downstream |
| 405 // misses, a dummy vector can be used. |
| 406 Handle<TypeFeedbackVector> dummy_vector = Handle<TypeFeedbackVector>::cast( |
| 407 isolate->factory()->keyed_load_dummy_vector()); |
| 408 int slot = dummy_vector->GetIndex(FeedbackVectorICSlot(0)); |
| 409 __ push(Immediate(Smi::FromInt(slot))); |
| 410 __ push(Immediate(dummy_vector)); |
| 411 } |
| 412 |
| 402 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 413 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( |
| 403 Code::ComputeHandlerFlags(Code::LOAD_IC)); | 414 Code::ComputeHandlerFlags(Code::LOAD_IC)); |
| 404 masm->isolate()->stub_cache()->GenerateProbe( | 415 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::KEYED_LOAD_IC, flags, |
| 405 masm, Code::LOAD_IC, flags, false, receiver, key, ebx, no_reg); | 416 false, receiver, key, ebx, edi); |
| 417 |
| 418 if (FLAG_vector_ics) { |
| 419 __ pop(VectorLoadICDescriptor::VectorRegister()); |
| 420 __ pop(VectorLoadICDescriptor::SlotRegister()); |
| 421 } |
| 422 |
| 406 // Cache miss. | 423 // Cache miss. |
| 407 GenerateMiss(masm); | 424 GenerateMiss(masm); |
| 408 | 425 |
| 409 // Do a quick inline probe of the receiver's dictionary, if it | 426 // Do a quick inline probe of the receiver's dictionary, if it |
| 410 // exists. | 427 // exists. |
| 411 __ bind(&probe_dictionary); | 428 __ bind(&probe_dictionary); |
| 412 | 429 |
| 413 __ mov(eax, FieldOperand(receiver, JSObject::kMapOffset)); | 430 __ mov(eax, FieldOperand(receiver, JSObject::kMapOffset)); |
| 414 __ movzx_b(eax, FieldOperand(eax, Map::kInstanceTypeOffset)); | 431 __ movzx_b(eax, FieldOperand(eax, Map::kInstanceTypeOffset)); |
| 415 GenerateGlobalInstanceTypeCheck(masm, eax, &slow); | 432 GenerateGlobalInstanceTypeCheck(masm, eax, &slow); |
| (...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 942 Condition cc = | 959 Condition cc = |
| 943 (check == ENABLE_INLINED_SMI_CHECK) | 960 (check == ENABLE_INLINED_SMI_CHECK) |
| 944 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) | 961 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) |
| 945 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); | 962 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); |
| 946 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 963 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
| 947 } | 964 } |
| 948 } | 965 } |
| 949 } // namespace v8::internal | 966 } // namespace v8::internal |
| 950 | 967 |
| 951 #endif // V8_TARGET_ARCH_X87 | 968 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |