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/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 __ test(key, Immediate(kSmiTagMask | kSmiSignMask)); | 361 __ test(key, Immediate(kSmiTagMask | kSmiSignMask)); |
362 __ j(not_zero, &slow); | 362 __ j(not_zero, &slow); |
363 | 363 |
364 // Everything is fine, call runtime. | 364 // Everything is fine, call runtime. |
365 __ pop(scratch); | 365 __ pop(scratch); |
366 __ push(receiver); // receiver | 366 __ push(receiver); // receiver |
367 __ push(key); // key | 367 __ push(key); // key |
368 __ push(scratch); // return address | 368 __ push(scratch); // return address |
369 | 369 |
370 // Perform tail call to the entry. | 370 // Perform tail call to the entry. |
371 ExternalReference ref = ExternalReference( | 371 __ TailCallRuntime(Runtime::kLoadElementWithInterceptor, 2, 1); |
372 IC_Utility(IC::kLoadElementWithInterceptor), masm->isolate()); | |
373 __ TailCallExternalReference(ref, 2, 1); | |
374 | 372 |
375 __ bind(&slow); | 373 __ bind(&slow); |
376 PropertyAccessCompiler::TailCallBuiltin( | 374 PropertyAccessCompiler::TailCallBuiltin( |
377 masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC)); | 375 masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC)); |
378 } | 376 } |
379 | 377 |
380 | 378 |
381 void LoadIndexedStringStub::Generate(MacroAssembler* masm) { | 379 void LoadIndexedStringStub::Generate(MacroAssembler* masm) { |
382 // Return address is on the stack. | 380 // Return address is on the stack. |
383 Label miss; | 381 Label miss; |
(...skipping 1761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2145 | 2143 |
2146 void CallICStub::GenerateMiss(MacroAssembler* masm) { | 2144 void CallICStub::GenerateMiss(MacroAssembler* masm) { |
2147 FrameScope scope(masm, StackFrame::INTERNAL); | 2145 FrameScope scope(masm, StackFrame::INTERNAL); |
2148 | 2146 |
2149 // Push the receiver and the function and feedback info. | 2147 // Push the receiver and the function and feedback info. |
2150 __ push(edi); | 2148 __ push(edi); |
2151 __ push(ebx); | 2149 __ push(ebx); |
2152 __ push(edx); | 2150 __ push(edx); |
2153 | 2151 |
2154 // Call the entry. | 2152 // Call the entry. |
2155 IC::UtilityId id = GetICState() == DEFAULT ? IC::kCallIC_Miss | 2153 Runtime::FunctionId id = GetICState() == DEFAULT |
2156 : IC::kCallIC_Customization_Miss; | 2154 ? Runtime::kCallIC_Miss |
2157 | 2155 : Runtime::kCallIC_Customization_Miss; |
2158 ExternalReference miss = ExternalReference(IC_Utility(id), masm->isolate()); | 2156 __ CallRuntime(id, 3); |
2159 __ CallExternalReference(miss, 3); | |
2160 | 2157 |
2161 // Move result to edi and exit the internal frame. | 2158 // Move result to edi and exit the internal frame. |
2162 __ mov(edi, eax); | 2159 __ mov(edi, eax); |
2163 } | 2160 } |
2164 | 2161 |
2165 | 2162 |
2166 bool CEntryStub::NeedsImmovableCode() { | 2163 bool CEntryStub::NeedsImmovableCode() { |
2167 return false; | 2164 return false; |
2168 } | 2165 } |
2169 | 2166 |
(...skipping 1409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3579 __ ret(0); | 3576 __ ret(0); |
3580 | 3577 |
3581 __ bind(&miss); | 3578 __ bind(&miss); |
3582 GenerateMiss(masm); | 3579 GenerateMiss(masm); |
3583 } | 3580 } |
3584 | 3581 |
3585 | 3582 |
3586 void CompareICStub::GenerateMiss(MacroAssembler* masm) { | 3583 void CompareICStub::GenerateMiss(MacroAssembler* masm) { |
3587 { | 3584 { |
3588 // Call the runtime system in a fresh internal frame. | 3585 // Call the runtime system in a fresh internal frame. |
3589 ExternalReference miss = ExternalReference(IC_Utility(IC::kCompareIC_Miss), | |
3590 isolate()); | |
3591 FrameScope scope(masm, StackFrame::INTERNAL); | 3586 FrameScope scope(masm, StackFrame::INTERNAL); |
3592 __ push(edx); // Preserve edx and eax. | 3587 __ push(edx); // Preserve edx and eax. |
3593 __ push(eax); | 3588 __ push(eax); |
3594 __ push(edx); // And also use them as the arguments. | 3589 __ push(edx); // And also use them as the arguments. |
3595 __ push(eax); | 3590 __ push(eax); |
3596 __ push(Immediate(Smi::FromInt(op()))); | 3591 __ push(Immediate(Smi::FromInt(op()))); |
3597 __ CallExternalReference(miss, 3); | 3592 __ CallRuntime(Runtime::kCompareIC_Miss, 3); |
3598 // Compute the entry point of the rewritten stub. | 3593 // Compute the entry point of the rewritten stub. |
3599 __ lea(edi, FieldOperand(eax, Code::kHeaderSize)); | 3594 __ lea(edi, FieldOperand(eax, Code::kHeaderSize)); |
3600 __ pop(eax); | 3595 __ pop(eax); |
3601 __ pop(edx); | 3596 __ pop(edx); |
3602 } | 3597 } |
3603 | 3598 |
3604 // Do a tail call to the rewritten stub. | 3599 // Do a tail call to the rewritten stub. |
3605 __ jmp(edi); | 3600 __ jmp(edi); |
3606 } | 3601 } |
3607 | 3602 |
(...skipping 1556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5164 Operand(ebp, 7 * kPointerSize), NULL); | 5159 Operand(ebp, 7 * kPointerSize), NULL); |
5165 } | 5160 } |
5166 | 5161 |
5167 | 5162 |
5168 #undef __ | 5163 #undef __ |
5169 | 5164 |
5170 } // namespace internal | 5165 } // namespace internal |
5171 } // namespace v8 | 5166 } // namespace v8 |
5172 | 5167 |
5173 #endif // V8_TARGET_ARCH_X87 | 5168 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |