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/ic/call-optimization.h" | 9 #include "src/ic/call-optimization.h" |
10 #include "src/ic/handler-compiler.h" | 10 #include "src/ic/handler-compiler.h" |
11 #include "src/ic/ic.h" | 11 #include "src/ic/ic.h" |
12 | 12 |
13 namespace v8 { | 13 namespace v8 { |
14 namespace internal { | 14 namespace internal { |
15 | 15 |
16 #define __ ACCESS_MASM(masm) | 16 #define __ ACCESS_MASM(masm) |
17 | 17 |
18 | 18 |
19 static void LoadIC_PushArgs(MacroAssembler* masm) { | |
20 Register receiver = LoadDescriptor::ReceiverRegister(); | |
21 Register name = LoadDescriptor::NameRegister(); | |
22 | |
23 DCHECK(!ebx.is(receiver) && !ebx.is(name)); | |
24 | |
25 __ pop(ebx); | |
26 __ push(receiver); | |
27 __ push(name); | |
28 __ push(ebx); | |
29 } | |
30 | |
31 | |
32 void NamedLoadHandlerCompiler::GenerateSlow(MacroAssembler* masm) { | |
33 // Return address is on the stack. | |
34 LoadIC_PushArgs(masm); | |
35 | |
36 // Do tail-call to runtime routine. | |
37 ExternalReference ref(IC_Utility(IC::kLoadIC_Slow), masm->isolate()); | |
38 __ TailCallExternalReference(ref, 2, 1); | |
39 } | |
40 | |
41 | |
42 void ElementHandlerCompiler::GenerateLoadSlow(MacroAssembler* masm) { | |
43 // Return address is on the stack. | |
44 LoadIC_PushArgs(masm); | |
45 | |
46 // Do tail-call to runtime routine. | |
47 ExternalReference ref(IC_Utility(IC::kKeyedLoadIC_Slow), masm->isolate()); | |
48 __ TailCallExternalReference(ref, 2, 1); | |
49 } | |
50 | |
51 | |
52 void NamedLoadHandlerCompiler::GenerateLoadViaGetter( | 19 void NamedLoadHandlerCompiler::GenerateLoadViaGetter( |
53 MacroAssembler* masm, Handle<Map> map, Register receiver, Register holder, | 20 MacroAssembler* masm, Handle<Map> map, Register receiver, Register holder, |
54 int accessor_index, int expected_arguments, Register scratch) { | 21 int accessor_index, int expected_arguments, Register scratch) { |
55 { | 22 { |
56 FrameScope scope(masm, StackFrame::INTERNAL); | 23 FrameScope scope(masm, StackFrame::INTERNAL); |
57 | 24 |
58 if (accessor_index >= 0) { | 25 if (accessor_index >= 0) { |
59 DCHECK(!holder.is(scratch)); | 26 DCHECK(!holder.is(scratch)); |
60 DCHECK(!receiver.is(scratch)); | 27 DCHECK(!receiver.is(scratch)); |
61 // Call the JavaScript getter with the receiver on the stack. | 28 // Call the JavaScript getter with the receiver on the stack. |
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
838 // Return the generated code. | 805 // Return the generated code. |
839 return GetCode(kind(), Code::NORMAL, name); | 806 return GetCode(kind(), Code::NORMAL, name); |
840 } | 807 } |
841 | 808 |
842 | 809 |
843 #undef __ | 810 #undef __ |
844 } // namespace internal | 811 } // namespace internal |
845 } // namespace v8 | 812 } // namespace v8 |
846 | 813 |
847 #endif // V8_TARGET_ARCH_X87 | 814 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |