| 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 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 __ ret(0); | 498 __ ret(0); |
| 499 | 499 |
| 500 StubRuntimeCallHelper call_helper; | 500 StubRuntimeCallHelper call_helper; |
| 501 char_at_generator.GenerateSlow(masm, call_helper); | 501 char_at_generator.GenerateSlow(masm, call_helper); |
| 502 | 502 |
| 503 __ bind(&miss); | 503 __ bind(&miss); |
| 504 GenerateMiss(masm); | 504 GenerateMiss(masm); |
| 505 } | 505 } |
| 506 | 506 |
| 507 | 507 |
| 508 void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) { | |
| 509 // Return address is on the stack. | |
| 510 Label slow; | |
| 511 | |
| 512 Register receiver = LoadDescriptor::ReceiverRegister(); | |
| 513 Register key = LoadDescriptor::NameRegister(); | |
| 514 Register scratch = eax; | |
| 515 DCHECK(!scratch.is(receiver) && !scratch.is(key)); | |
| 516 | |
| 517 // Check that the receiver isn't a smi. | |
| 518 __ JumpIfSmi(receiver, &slow); | |
| 519 | |
| 520 // Check that the key is an array index, that is Uint32. | |
| 521 __ test(key, Immediate(kSmiTagMask | kSmiSignMask)); | |
| 522 __ j(not_zero, &slow); | |
| 523 | |
| 524 // Get the map of the receiver. | |
| 525 __ mov(scratch, FieldOperand(receiver, HeapObject::kMapOffset)); | |
| 526 | |
| 527 // Check that it has indexed interceptor and access checks | |
| 528 // are not enabled for this object. | |
| 529 __ movzx_b(scratch, FieldOperand(scratch, Map::kBitFieldOffset)); | |
| 530 __ and_(scratch, Immediate(kSlowCaseBitFieldMask)); | |
| 531 __ cmp(scratch, Immediate(1 << Map::kHasIndexedInterceptor)); | |
| 532 __ j(not_zero, &slow); | |
| 533 | |
| 534 // Everything is fine, call runtime. | |
| 535 __ pop(scratch); | |
| 536 __ push(receiver); // receiver | |
| 537 __ push(key); // key | |
| 538 __ push(scratch); // return address | |
| 539 | |
| 540 // Perform tail call to the entry. | |
| 541 ExternalReference ref = ExternalReference( | |
| 542 IC_Utility(kLoadElementWithInterceptor), masm->isolate()); | |
| 543 __ TailCallExternalReference(ref, 2, 1); | |
| 544 | |
| 545 __ bind(&slow); | |
| 546 GenerateMiss(masm); | |
| 547 } | |
| 548 | |
| 549 | |
| 550 void KeyedLoadIC::GenerateSloppyArguments(MacroAssembler* masm) { | 508 void KeyedLoadIC::GenerateSloppyArguments(MacroAssembler* masm) { |
| 551 // The return address is on the stack. | 509 // The return address is on the stack. |
| 552 Register receiver = LoadDescriptor::ReceiverRegister(); | 510 Register receiver = LoadDescriptor::ReceiverRegister(); |
| 553 Register key = LoadDescriptor::NameRegister(); | 511 Register key = LoadDescriptor::NameRegister(); |
| 554 DCHECK(receiver.is(edx)); | 512 DCHECK(receiver.is(edx)); |
| 555 DCHECK(key.is(ecx)); | 513 DCHECK(key.is(ecx)); |
| 556 | 514 |
| 557 Label slow, notin; | 515 Label slow, notin; |
| 558 Factory* factory = masm->isolate()->factory(); | 516 Factory* factory = masm->isolate()->factory(); |
| 559 Operand mapped_location = GenerateMappedArgumentsLookup( | 517 Operand mapped_location = GenerateMappedArgumentsLookup( |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1044 Condition cc = | 1002 Condition cc = |
| 1045 (check == ENABLE_INLINED_SMI_CHECK) | 1003 (check == ENABLE_INLINED_SMI_CHECK) |
| 1046 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) | 1004 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) |
| 1047 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); | 1005 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); |
| 1048 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 1006 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
| 1049 } | 1007 } |
| 1050 } | 1008 } |
| 1051 } // namespace v8::internal | 1009 } // namespace v8::internal |
| 1052 | 1010 |
| 1053 #endif // V8_TARGET_ARCH_X87 | 1011 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |