diff options
Diffstat (limited to 'V8Binding/v8/src/ia32/ic-ia32.cc')
-rw-r--r-- | V8Binding/v8/src/ia32/ic-ia32.cc | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/V8Binding/v8/src/ia32/ic-ia32.cc b/V8Binding/v8/src/ia32/ic-ia32.cc index e39808b..f7369a8 100644 --- a/V8Binding/v8/src/ia32/ic-ia32.cc +++ b/V8Binding/v8/src/ia32/ic-ia32.cc @@ -404,7 +404,7 @@ void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm) { __ push(eax); __ push(ecx); // Do tail-call to runtime routine. - __ TailCallRuntime(ExternalReference(Runtime::kSetProperty), 3); + __ TailCallRuntime(ExternalReference(Runtime::kSetProperty), 3, 1); // Check whether the elements is a pixel array. // eax: value @@ -421,21 +421,22 @@ void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm) { __ sar(ebx, kSmiTagSize); // Untag the index. __ cmp(ebx, FieldOperand(ecx, PixelArray::kLengthOffset)); __ j(above_equal, &slow); + __ mov(edx, eax); // Save the value. __ sar(eax, kSmiTagSize); // Untag the value. { // Clamp the value to [0..255]. - Label done, check_255; - __ cmp(eax, 0); - __ j(greater_equal, &check_255); - __ mov(eax, Immediate(0)); - __ jmp(&done); - __ bind(&check_255); - __ cmp(eax, 255); - __ j(less_equal, &done); + Label done, is_negative; + __ test(eax, Immediate(0xFFFFFF00)); + __ j(zero, &done); + __ j(negative, &is_negative); __ mov(eax, Immediate(255)); + __ jmp(&done); + __ bind(&is_negative); + __ xor_(eax, Operand(eax)); // Clear eax. __ bind(&done); } __ mov(ecx, FieldOperand(ecx, PixelArray::kExternalPointerOffset)); __ mov_b(Operand(ecx, ebx, times_1, 0), eax); + __ mov(eax, edx); // Return the original value. __ ret(0); // Extra capacity case: Check if there is extra capacity to @@ -667,7 +668,7 @@ void CallIC::Generate(MacroAssembler* masm, __ push(ebx); // Call the entry. - CEntryStub stub; + CEntryStub stub(1); __ mov(eax, Immediate(2)); __ mov(ebx, Immediate(f)); __ CallStub(&stub); @@ -799,7 +800,7 @@ void LoadIC::Generate(MacroAssembler* masm, const ExternalReference& f) { __ push(ebx); // return address // Perform tail call to the entry. - __ TailCallRuntime(f, 2); + __ TailCallRuntime(f, 2, 1); } @@ -840,7 +841,7 @@ void KeyedStoreIC::RestoreInlinedVersion(Address address) { bool LoadIC::PatchInlinedLoad(Address address, Object* map, int offset) { // The address of the instruction following the call. Address test_instruction_address = - address + Assembler::kPatchReturnSequenceLength; + address + Assembler::kCallTargetAddressOffset; // If the instruction following the call is not a test eax, nothing // was inlined. if (*test_instruction_address != kTestEaxByte) return false; @@ -867,7 +868,7 @@ bool LoadIC::PatchInlinedLoad(Address address, Object* map, int offset) { static bool PatchInlinedMapCheck(Address address, Object* map) { Address test_instruction_address = - address + Assembler::kPatchReturnSequenceLength; + address + Assembler::kCallTargetAddressOffset; // The keyed load has a fast inlined case if the IC call instruction // is immediately followed by a test instruction. if (*test_instruction_address != kTestEaxByte) return false; @@ -927,7 +928,7 @@ void KeyedLoadIC::Generate(MacroAssembler* masm, const ExternalReference& f) { __ push(ebx); // return address // Perform tail call to the entry. - __ TailCallRuntime(f, 2); + __ TailCallRuntime(f, 2, 1); } @@ -967,7 +968,7 @@ void StoreIC::GenerateExtendStorage(MacroAssembler* masm) { // Perform tail call to the entry. __ TailCallRuntime( - ExternalReference(IC_Utility(kSharedStoreIC_ExtendStorage)), 3); + ExternalReference(IC_Utility(kSharedStoreIC_ExtendStorage)), 3, 1); } @@ -987,7 +988,7 @@ void StoreIC::Generate(MacroAssembler* masm, const ExternalReference& f) { __ push(ebx); // Perform tail call to the entry. - __ TailCallRuntime(f, 3); + __ TailCallRuntime(f, 3, 1); } @@ -1010,7 +1011,7 @@ void KeyedStoreIC::Generate(MacroAssembler* masm, const ExternalReference& f) { __ push(ecx); // Do tail-call to runtime routine. - __ TailCallRuntime(f, 3); + __ TailCallRuntime(f, 3, 1); } @@ -1032,7 +1033,7 @@ void KeyedStoreIC::GenerateExtendStorage(MacroAssembler* masm) { // Do tail-call to runtime routine. __ TailCallRuntime( - ExternalReference(IC_Utility(kSharedStoreIC_ExtendStorage)), 3); + ExternalReference(IC_Utility(kSharedStoreIC_ExtendStorage)), 3, 1); } #undef __ |