OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 15 matching lines...) Expand all Loading... |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 #include "v8.h" | 28 #include "v8.h" |
29 | 29 |
30 #if defined(V8_TARGET_ARCH_IA32) | 30 #if defined(V8_TARGET_ARCH_IA32) |
31 | 31 |
32 #include "codegen-inl.h" | 32 #include "codegen-inl.h" |
33 #include "register-allocator-inl.h" | 33 #include "register-allocator-inl.h" |
34 #include "scopes.h" | 34 #include "scopes.h" |
35 #include "virtual-frame-inl.h" | 35 #include "virtual-frame-inl.h" |
| 36 #include "stub-cache.h" |
36 | 37 |
37 namespace v8 { | 38 namespace v8 { |
38 namespace internal { | 39 namespace internal { |
39 | 40 |
40 #define __ ACCESS_MASM(masm()) | 41 #define __ ACCESS_MASM(masm()) |
41 | 42 |
42 void VirtualFrame::SyncElementBelowStackPointer(int index) { | 43 void VirtualFrame::SyncElementBelowStackPointer(int index) { |
43 // Emit code to write elements below the stack pointer to their | 44 // Emit code to write elements below the stack pointer to their |
44 // (already allocated) stack address. | 45 // (already allocated) stack address. |
45 ASSERT(index <= stack_pointer_); | 46 ASSERT(index <= stack_pointer_); |
(...skipping 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1101 } | 1102 } |
1102 | 1103 |
1103 | 1104 |
1104 Result VirtualFrame::CallCallIC(RelocInfo::Mode mode, | 1105 Result VirtualFrame::CallCallIC(RelocInfo::Mode mode, |
1105 int arg_count, | 1106 int arg_count, |
1106 int loop_nesting) { | 1107 int loop_nesting) { |
1107 // Function name, arguments, and receiver are on top of the frame. | 1108 // Function name, arguments, and receiver are on top of the frame. |
1108 // The IC expects the name in ecx and the rest on the stack and | 1109 // The IC expects the name in ecx and the rest on the stack and |
1109 // drops them all. | 1110 // drops them all. |
1110 InLoopFlag in_loop = loop_nesting > 0 ? IN_LOOP : NOT_IN_LOOP; | 1111 InLoopFlag in_loop = loop_nesting > 0 ? IN_LOOP : NOT_IN_LOOP; |
1111 Handle<Code> ic = cgen()->ComputeCallInitialize(arg_count, in_loop); | 1112 Handle<Code> ic = StubCache::ComputeCallInitialize(arg_count, in_loop); |
1112 // Spill args, receiver, and function. The call will drop args and | 1113 // Spill args, receiver, and function. The call will drop args and |
1113 // receiver. | 1114 // receiver. |
1114 Result name = Pop(); | 1115 Result name = Pop(); |
1115 PrepareForCall(arg_count + 1, arg_count + 1); // Arguments + receiver. | 1116 PrepareForCall(arg_count + 1, arg_count + 1); // Arguments + receiver. |
1116 name.ToRegister(ecx); | 1117 name.ToRegister(ecx); |
1117 name.Unuse(); | 1118 name.Unuse(); |
1118 return RawCallCodeObject(ic, mode); | 1119 return RawCallCodeObject(ic, mode); |
1119 } | 1120 } |
1120 | 1121 |
1121 | 1122 |
1122 Result VirtualFrame::CallKeyedCallIC(RelocInfo::Mode mode, | 1123 Result VirtualFrame::CallKeyedCallIC(RelocInfo::Mode mode, |
1123 int arg_count, | 1124 int arg_count, |
1124 int loop_nesting) { | 1125 int loop_nesting) { |
1125 // Function name, arguments, and receiver are on top of the frame. | 1126 // Function name, arguments, and receiver are on top of the frame. |
1126 // The IC expects the name in ecx and the rest on the stack and | 1127 // The IC expects the name in ecx and the rest on the stack and |
1127 // drops them all. | 1128 // drops them all. |
1128 InLoopFlag in_loop = loop_nesting > 0 ? IN_LOOP : NOT_IN_LOOP; | 1129 InLoopFlag in_loop = loop_nesting > 0 ? IN_LOOP : NOT_IN_LOOP; |
1129 Handle<Code> ic = cgen()->ComputeKeyedCallInitialize(arg_count, in_loop); | 1130 Handle<Code> ic = StubCache::ComputeKeyedCallInitialize(arg_count, in_loop); |
1130 // Spill args, receiver, and function. The call will drop args and | 1131 // Spill args, receiver, and function. The call will drop args and |
1131 // receiver. | 1132 // receiver. |
1132 Result name = Pop(); | 1133 Result name = Pop(); |
1133 PrepareForCall(arg_count + 1, arg_count + 1); // Arguments + receiver. | 1134 PrepareForCall(arg_count + 1, arg_count + 1); // Arguments + receiver. |
1134 name.ToRegister(ecx); | 1135 name.ToRegister(ecx); |
1135 name.Unuse(); | 1136 name.Unuse(); |
1136 return RawCallCodeObject(ic, mode); | 1137 return RawCallCodeObject(ic, mode); |
1137 } | 1138 } |
1138 | 1139 |
1139 | 1140 |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1325 } | 1326 } |
1326 UNREACHABLE(); | 1327 UNREACHABLE(); |
1327 } | 1328 } |
1328 | 1329 |
1329 | 1330 |
1330 #undef __ | 1331 #undef __ |
1331 | 1332 |
1332 } } // namespace v8::internal | 1333 } } // namespace v8::internal |
1333 | 1334 |
1334 #endif // V8_TARGET_ARCH_IA32 | 1335 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |