OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
954 | 954 |
955 | 955 |
956 // Clear the dirty bits for the range of elements in | 956 // Clear the dirty bits for the range of elements in |
957 // [min(stack_pointer_ + 1,begin), end]. | 957 // [min(stack_pointer_ + 1,begin), end]. |
958 void VirtualFrame::SyncRange(int begin, int end) { | 958 void VirtualFrame::SyncRange(int begin, int end) { |
959 ASSERT(begin >= 0); | 959 ASSERT(begin >= 0); |
960 ASSERT(end < element_count()); | 960 ASSERT(end < element_count()); |
961 // Sync elements below the range if they have not been materialized | 961 // Sync elements below the range if they have not been materialized |
962 // on the stack. | 962 // on the stack. |
963 int start = Min(begin, stack_pointer_ + 1); | 963 int start = Min(begin, stack_pointer_ + 1); |
| 964 int end_or_stack_pointer = Min(stack_pointer_, end); |
| 965 // Emit normal push instructions for elements above stack pointer |
| 966 // and use mov instructions if we are below stack pointer. |
| 967 int i = start; |
964 | 968 |
965 // If positive we have to adjust the stack pointer. | 969 while (i <= end_or_stack_pointer) { |
966 int delta = end - stack_pointer_; | 970 if (!elements_[i].is_synced()) SyncElementBelowStackPointer(i); |
967 if (delta > 0) { | 971 i++; |
968 stack_pointer_ = end; | |
969 __ subq(rsp, Immediate(delta * kPointerSize)); | |
970 } | 972 } |
971 | 973 while (i <= end) { |
972 for (int i = start; i <= end; i++) { | 974 SyncElementByPushing(i); |
973 if (!elements_[i].is_synced()) SyncElementBelowStackPointer(i); | 975 i++; |
974 } | 976 } |
975 } | 977 } |
976 | 978 |
977 | 979 |
978 Result VirtualFrame::InvokeBuiltin(Builtins::JavaScript id, | 980 Result VirtualFrame::InvokeBuiltin(Builtins::JavaScript id, |
979 InvokeFlag flag, | 981 InvokeFlag flag, |
980 int arg_count) { | 982 int arg_count) { |
981 PrepareForCall(arg_count, arg_count); | 983 PrepareForCall(arg_count, arg_count); |
982 ASSERT(cgen()->HasValidEntryRegisters()); | 984 ASSERT(cgen()->HasValidEntryRegisters()); |
983 __ InvokeBuiltin(id, flag); | 985 __ InvokeBuiltin(id, flag); |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1214 Adjust(kHandlerSize - 1); | 1216 Adjust(kHandlerSize - 1); |
1215 __ PushTryHandler(IN_JAVASCRIPT, type); | 1217 __ PushTryHandler(IN_JAVASCRIPT, type); |
1216 } | 1218 } |
1217 | 1219 |
1218 | 1220 |
1219 #undef __ | 1221 #undef __ |
1220 | 1222 |
1221 } } // namespace v8::internal | 1223 } } // namespace v8::internal |
1222 | 1224 |
1223 #endif // V8_TARGET_ARCH_X64 | 1225 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |