1 /* src/vm/jit/x86_64/patcher.c - x86_64 code patching functions
3 Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
4 R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
5 C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
6 Institut f. Computersprachen - TU Wien
8 This file is part of CACAO.
10 This program is free software; you can redistribute it and/or
11 modify it under the terms of the GNU General Public License as
12 published by the Free Software Foundation; either version 2, or (at
13 your option) any later version.
15 This program is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
25 Contact: cacao@complang.tuwien.ac.at
27 Authors: Christian Thalinger
31 $Id: patcher.c 3619 2005-11-07 18:44:32Z twisti $
39 #include "mm/memory.h"
40 #include "native/native.h"
41 #include "vm/builtin.h"
42 #include "vm/exceptions.h"
44 #include "vm/initialize.h"
45 #include "vm/options.h"
46 #include "vm/resolve.h"
47 #include "vm/references.h"
48 #include "vm/jit/patcher.h"
51 /* patcher_get_putstatic *******************************************************
55 <patched call position>
56 4d 8b 15 86 fe ff ff mov -378(%rip),%r10
57 49 8b 32 mov (%r10),%rsi
59 *******************************************************************************/
61 bool patcher_get_putstatic(u1 *sp)
71 /* get stuff from the stack */
73 ra = (u1 *) *((ptrint *) (sp + 4 * 8));
74 o = (java_objectheader *) *((ptrint *) (sp + 3 * 8));
75 mcode = *((u8 *) (sp + 2 * 8));
76 uf = (unresolved_field *) *((ptrint *) (sp + 1 * 8));
77 disp = *((s4 *) (sp + 0 * 8));
79 /* calculate and set the new return address */
82 *((ptrint *) (sp + 4 * 8)) = (ptrint) ra;
86 /* get the fieldinfo */
88 if (!(fi = resolve_field_eager(uf))) {
94 /* check if the field's class is initialized */
96 if (!initialize_class(fi->class)) {
102 /* patch back original code */
104 *((u8 *) ra) = mcode;
106 /* if we show disassembly, we have to skip the nop's */
108 if (opt_showdisassemble)
111 /* get RIP offset from machine instruction */
113 offset = *((u4 *) (ra + 3));
115 /* patch the field value's address (+ 7: is the size of the RIP move) */
117 *((ptrint *) (ra + 7 + offset)) = (ptrint) &(fi->value);
119 PATCHER_MARK_PATCHED_MONITOREXIT;
125 /* patcher_get_putfield ********************************************************
129 <patched call position>
130 45 8b 8f 00 00 00 00 mov 0x0(%r15),%r9d
132 *******************************************************************************/
134 bool patcher_get_putfield(u1 *sp)
137 java_objectheader *o;
139 unresolved_field *uf;
143 /* get stuff from the stack */
145 ra = (u1 *) *((ptrint *) (sp + 4 * 8));
146 o = (java_objectheader *) *((ptrint *) (sp + 3 * 8));
147 mcode = *((u8 *) (sp + 2 * 8));
148 uf = (unresolved_field *) *((ptrint *) (sp + 1 * 8));
150 /* calculate and set the new return address */
153 *((ptrint *) (sp + 4 * 8)) = (ptrint) ra;
155 PATCHER_MONITORENTER;
157 /* get the fieldinfo */
159 if (!(fi = resolve_field_eager(uf))) {
165 /* patch back original code (instruction code is smaller than 8 bytes) */
167 *((u4 *) (ra + 0)) = (u4) mcode;
168 *((u1 *) (ra + 4)) = (u1) (mcode >> 32);
170 /* if we show disassembly, we have to skip the nop's */
172 if (opt_showdisassemble)
175 /* patch the field's offset: we check for the field type, because the */
176 /* instructions have different lengths */
178 if (IS_INT_LNG_TYPE(fi->type)) {
179 /* check for special case: %rsp or %r12 as base register */
184 *((u4 *) (ra + 4)) = (u4) (fi->offset);
186 *((u4 *) (ra + 3)) = (u4) (fi->offset);
189 /* check for special case: %rsp or %r12 as base register */
194 *((u4 *) (ra + 6)) = (u4) (fi->offset);
196 *((u4 *) (ra + 5)) = (u4) (fi->offset);
199 PATCHER_MARK_PATCHED_MONITOREXIT;
205 /* patcher_putfieldconst *******************************************************
209 <patched call position>
210 41 c7 85 00 00 00 00 7b 00 00 00 movl $0x7b,0x0(%r13)
212 *******************************************************************************/
214 bool patcher_putfieldconst(u1 *sp)
217 java_objectheader *o;
219 unresolved_field *uf;
222 /* get stuff from the stack */
224 ra = (u1 *) *((ptrint *) (sp + 4 * 8));
225 o = (java_objectheader *) *((ptrint *) (sp + 3 * 8));
226 mcode = *((u8 *) (sp + 2 * 8));
227 uf = (unresolved_field *) *((ptrint *) (sp + 1 * 8));
229 /* calculate and set the new return address */
232 *((ptrint *) (sp + 4 * 8)) = (ptrint) ra;
234 PATCHER_MONITORENTER;
236 /* get the fieldinfo */
238 if (!(fi = resolve_field_eager(uf))) {
244 /* patch back original code */
246 *((u8 *) ra) = mcode;
248 /* if we show disassembly, we have to skip the nop's */
250 if (opt_showdisassemble)
253 /* patch the field's offset */
255 if (IS_2_WORD_TYPE(fi->type) || IS_ADR_TYPE(fi->type)) {
256 /* handle special case when the base register is %r12 */
258 if (*(ra + 2) == 0x84) {
259 *((u4 *) (ra + 4)) = (u4) (fi->offset);
260 *((u4 *) (ra + 12 + 4)) = (u4) (fi->offset + 4);
263 *((u4 *) (ra + 3)) = (u4) (fi->offset);
264 *((u4 *) (ra + 11 + 3)) = (u4) (fi->offset + 4);
268 /* handle special case when the base register is %r12 */
270 if (*(ra + 2) == 0x84)
271 *((u4 *) (ra + 4)) = (u4) (fi->offset);
273 *((u4 *) (ra + 3)) = (u4) (fi->offset);
276 PATCHER_MARK_PATCHED_MONITOREXIT;
282 /* patcher_aconst **************************************************************
286 <patched call position>
287 48 bf a0 f0 92 00 00 00 00 00 mov $0x92f0a0,%rdi
289 *******************************************************************************/
291 bool patcher_aconst(u1 *sp)
294 java_objectheader *o;
296 constant_classref *cr;
299 /* get stuff from the stack */
301 ra = (u1 *) *((ptrint *) (sp + 4 * 8));
302 o = (java_objectheader *) *((ptrint *) (sp + 3 * 8));
303 mcode = *((u8 *) (sp + 2 * 8));
304 cr = (constant_classref *) *((ptrint *) (sp + 1 * 8));
306 /* calculate and set the new return address */
309 *((ptrint *) (sp + 4 * 8)) = (ptrint) ra;
311 PATCHER_MONITORENTER;
313 /* get the classinfo */
315 if (!(c = resolve_classref_eager(cr))) {
321 if (!use_class_as_object(c)) {
327 /* patch back original code */
329 *((u8 *) ra) = mcode;
331 /* if we show disassembly, we have to skip the nop's */
333 if (opt_showdisassemble)
336 /* patch the classinfo pointer */
338 *((ptrint *) (ra + 2)) = (ptrint) c;
340 PATCHER_MARK_PATCHED_MONITOREXIT;
346 /* patcher_builtin_multianewarray **********************************************
350 <patched call position>
351 48 bf 02 00 00 00 00 00 00 00 mov $0x2,%rdi
352 48 be 30 40 b2 00 00 00 00 00 mov $0xb24030,%rsi
353 48 89 e2 mov %rsp,%rdx
354 48 b8 7c 96 4b 00 00 00 00 00 mov $0x4b967c,%rax
357 *******************************************************************************/
359 bool patcher_builtin_multianewarray(u1 *sp)
362 java_objectheader *o;
364 constant_classref *cr;
367 /* get stuff from the stack */
369 ra = (u1 *) *((ptrint *) (sp + 4 * 8));
370 o = (java_objectheader *) *((ptrint *) (sp + 3 * 8));
371 mcode = *((u8 *) (sp + 2 * 8));
372 cr = (constant_classref *) *((ptrint *) (sp + 1 * 8));
374 /* calculate and set the new return address */
377 *((ptrint *) (sp + 4 * 8)) = (ptrint) ra;
379 PATCHER_MONITORENTER;
381 /* get the classinfo */
383 if (!(c = resolve_classref_eager(cr))) {
389 /* patch back original code */
391 *((u8 *) ra) = mcode;
393 /* if we show disassembly, we have to skip the nop's */
395 if (opt_showdisassemble)
398 /* patch the classinfo pointer */
400 *((ptrint *) (ra + 10 + 2)) = (ptrint) c;
402 /* patch new function address */
404 *((ptrint *) (ra + 10 + 10 + 3 + 2)) = (ptrint) BUILTIN_multianewarray;
406 PATCHER_MARK_PATCHED_MONITOREXIT;
412 /* patcher_builtin_arraycheckcast **********************************************
416 <patched call position>
417 48 be b8 3f b2 00 00 00 00 00 mov $0xb23fb8,%rsi
418 48 b8 00 00 00 00 00 00 00 00 mov $0x0,%rax
421 *******************************************************************************/
423 bool patcher_builtin_arraycheckcast(u1 *sp)
426 java_objectheader *o;
428 constant_classref *cr;
431 /* get stuff from the stack */
433 ra = (u1 *) *((ptrint *) (sp + 4 * 8));
434 o = (java_objectheader *) *((ptrint *) (sp + 3 * 8));
435 mcode = *((u8 *) (sp + 2 * 8));
436 cr = (constant_classref *) *((ptrint *) (sp + 1 * 8));
438 /* calculate and set the new return address */
441 *((ptrint *) (sp + 4 * 8)) = (ptrint) ra;
443 PATCHER_MONITORENTER;
445 /* get the classinfo */
447 if (!(c = resolve_classref_eager(cr))) {
453 /* patch back original code */
455 *((u8 *) ra) = mcode;
457 /* if we show disassembly, we have to skip the nop's */
459 if (opt_showdisassemble)
462 /* patch the classinfo pointer */
464 *((ptrint *) (ra + 2)) = (ptrint) c;
466 /* patch new function address */
468 *((ptrint *) (ra + 10 + 2)) = (ptrint) BUILTIN_arraycheckcast;
470 PATCHER_MARK_PATCHED_MONITOREXIT;
476 /* patcher_invokestatic_special ************************************************
480 <patched call position>
481 49 ba 00 00 00 00 00 00 00 00 mov $0x0,%r10
484 *******************************************************************************/
486 bool patcher_invokestatic_special(u1 *sp)
489 java_objectheader *o;
491 unresolved_method *um;
494 /* get stuff from the stack */
496 ra = (u1 *) *((ptrint *) (sp + 4 * 8));
497 o = (java_objectheader *) *((ptrint *) (sp + 3 * 8));
498 mcode = *((u8 *) (sp + 2 * 8));
499 um = (unresolved_method *) *((ptrint *) (sp + 1 * 8));
501 /* calculate and set the new return address */
504 *((ptrint *) (sp + 4 * 8)) = (ptrint) ra;
506 PATCHER_MONITORENTER;
508 /* get the fieldinfo */
510 if (!(m = resolve_method_eager(um))) {
515 /* patch back original code */
517 *((u8 *) ra) = mcode;
519 /* if we show disassembly, we have to skip the nop's */
521 if (opt_showdisassemble)
524 /* patch stubroutine */
526 *((ptrint *) (ra + 2)) = (ptrint) m->stubroutine;
528 PATCHER_MARK_PATCHED_MONITOREXIT;
534 /* patcher_invokevirtual *******************************************************
538 <patched call position>
539 4c 8b 17 mov (%rdi),%r10
540 49 8b 82 00 00 00 00 mov 0x0(%r10),%rax
543 *******************************************************************************/
545 bool patcher_invokevirtual(u1 *sp)
548 java_objectheader *o;
550 unresolved_method *um;
553 /* get stuff from the stack */
555 ra = (u1 *) *((ptrint *) (sp + 4 * 8));
556 o = (java_objectheader *) *((ptrint *) (sp + 3 * 8));
557 mcode = *((u8 *) (sp + 2 * 8));
558 um = (unresolved_method *) *((ptrint *) (sp + 1 * 8));
560 /* calculate and set the new return address */
563 *((ptrint *) (sp + 4 * 8)) = (ptrint) ra;
565 PATCHER_MONITORENTER;
567 /* get the fieldinfo */
569 if (!(m = resolve_method_eager(um))) {
575 /* patch back original code */
577 *((u8 *) ra) = mcode;
579 /* if we show disassembly, we have to skip the nop's */
581 if (opt_showdisassemble)
584 /* patch vftbl index */
586 *((s4 *) (ra + 3 + 3)) = (s4) (OFFSET(vftbl_t, table[0]) +
587 sizeof(methodptr) * m->vftblindex);
589 PATCHER_MARK_PATCHED_MONITOREXIT;
595 /* patcher_invokeinterface *****************************************************
599 <patched call position>
600 4c 8b 17 mov (%rdi),%r10
601 4d 8b 92 00 00 00 00 mov 0x0(%r10),%r10
602 49 8b 82 00 00 00 00 mov 0x0(%r10),%rax
605 *******************************************************************************/
607 bool patcher_invokeinterface(u1 *sp)
610 java_objectheader *o;
612 unresolved_method *um;
615 /* get stuff from the stack */
617 ra = (u1 *) *((ptrint *) (sp + 4 * 8));
618 o = (java_objectheader *) *((ptrint *) (sp + 3 * 8));
619 mcode = *((u8 *) (sp + 2 * 8));
620 um = (unresolved_method *) *((ptrint *) (sp + 1 * 8));
622 /* calculate and set the new return address */
625 *((ptrint *) (sp + 4 * 8)) = (ptrint) ra;
627 PATCHER_MONITORENTER;
629 /* get the fieldinfo */
631 if (!(m = resolve_method_eager(um))) {
637 /* patch back original code */
639 *((u8 *) ra) = mcode;
641 /* if we show disassembly, we have to skip the nop's */
643 if (opt_showdisassemble)
646 /* patch interfacetable index */
648 *((s4 *) (ra + 3 + 3)) = (s4) (OFFSET(vftbl_t, interfacetable[0]) -
649 sizeof(methodptr) * m->class->index);
651 /* patch method offset */
653 *((s4 *) (ra + 3 + 7 + 3)) =
654 (s4) (sizeof(methodptr) * (m - m->class->methods));
656 PATCHER_MARK_PATCHED_MONITOREXIT;
662 /* patcher_checkcast_instanceof_flags ******************************************
666 <patched call position>
667 41 ba 00 00 00 00 mov $0x0,%r10d
668 41 81 e2 00 02 00 00 and $0x200,%r10d
669 0f 84 35 00 00 00 je 0x00002aaaaab01479
671 *******************************************************************************/
673 bool patcher_checkcast_instanceof_flags(u1 *sp)
676 java_objectheader *o;
678 constant_classref *cr;
681 /* get stuff from the stack */
683 ra = (u1 *) *((ptrint *) (sp + 4 * 8));
684 o = (java_objectheader *) *((ptrint *) (sp + 3 * 8));
685 mcode = *((u8 *) (sp + 2 * 8));
686 cr = (constant_classref *) *((ptrint *) (sp + 1 * 8));
688 /* calculate and set the new return address */
691 *((ptrint *) (sp + 4 * 8)) = (ptrint) ra;
693 PATCHER_MONITORENTER;
695 /* get the fieldinfo */
697 if (!(c = resolve_classref_eager(cr))) {
703 /* patch back original code */
705 *((u8 *) ra) = mcode;
707 /* if we show disassembly, we have to skip the nop's */
709 if (opt_showdisassemble)
712 /* patch class flags */
714 *((s4 *) (ra + 2)) = (s4) c->flags;
716 PATCHER_MARK_PATCHED_MONITOREXIT;
722 /* patcher_checkcast_instanceof_interface **************************************
726 <patched call position>
727 45 8b 9a 1c 00 00 00 mov 0x1c(%r10),%r11d
728 49 81 eb 00 00 00 00 sub $0x0,%r11
729 4d 85 db test %r11,%r11
730 0f 8e 94 04 00 00 jle 0x00002aaaaab018f8
731 4d 8b 9a 00 00 00 00 mov 0x0(%r10),%r11
733 *******************************************************************************/
735 bool patcher_checkcast_instanceof_interface(u1 *sp)
738 java_objectheader *o;
740 constant_classref *cr;
743 /* get stuff from the stack */
745 ra = (u1 *) *((ptrint *) (sp + 4 * 8));
746 o = (java_objectheader *) *((ptrint *) (sp + 3 * 8));
747 mcode = *((u8 *) (sp + 2 * 8));
748 cr = (constant_classref *) *((ptrint *) (sp + 1 * 8));
750 /* calculate and set the new return address */
753 *((ptrint *) (sp + 4 * 8)) = (ptrint) ra;
755 PATCHER_MONITORENTER;
757 /* get the fieldinfo */
759 if (!(c = resolve_classref_eager(cr))) {
765 /* patch back original code */
767 *((u8 *) ra) = mcode;
769 /* if we show disassembly, we have to skip the nop's */
771 if (opt_showdisassemble)
774 /* patch super class index */
776 *((s4 *) (ra + 7 + 3)) = (s4) c->index;
778 *((s4 *) (ra + 7 + 7 + 3 + 6 + 3)) =
779 (s4) (OFFSET(vftbl_t, interfacetable[0]) -
780 c->index * sizeof(methodptr*));
782 PATCHER_MARK_PATCHED_MONITOREXIT;
788 /* patcher_checkcast_class *****************************************************
792 <patched call position>
793 49 bb 00 00 00 00 00 00 00 00 mov $0x0,%r11
794 45 8b 92 20 00 00 00 mov 0x20(%r10),%r10d
795 45 8b 9b 20 00 00 00 mov 0x20(%r11),%r11d
796 4d 29 da sub %r11,%r10
797 49 bb 00 00 00 00 00 00 00 00 mov $0x0,%r11
799 *******************************************************************************/
801 bool patcher_checkcast_class(u1 *sp)
804 java_objectheader *o;
806 constant_classref *cr;
809 /* get stuff from the stack */
811 ra = (u1 *) *((ptrint *) (sp + 4 * 8));
812 o = (java_objectheader *) *((ptrint *) (sp + 3 * 8));
813 mcode = *((u8 *) (sp + 2 * 8));
814 cr = (constant_classref *) *((ptrint *) (sp + 1 * 8));
816 /* calculate and set the new return address */
819 *((ptrint *) (sp + 4 * 8)) = (ptrint) ra;
821 PATCHER_MONITORENTER;
823 /* get the fieldinfo */
825 if (!(c = resolve_classref_eager(cr))) {
831 /* patch back original code */
833 *((u8 *) ra) = mcode;
835 /* if we show disassembly, we have to skip the nop's */
837 if (opt_showdisassemble)
840 /* patch super class' vftbl */
842 *((ptrint *) (ra + 2)) = (ptrint) c->vftbl;
843 *((ptrint *) (ra + 10 + 7 + 7 + 3 + 2)) = (ptrint) c->vftbl;
845 PATCHER_MARK_PATCHED_MONITOREXIT;
851 /* patcher_instanceof_class ****************************************************
855 <patched call position>
856 49 ba 00 00 00 00 00 00 00 00 mov $0x0,%r10
858 *******************************************************************************/
860 bool patcher_instanceof_class(u1 *sp)
863 java_objectheader *o;
865 constant_classref *cr;
868 /* get stuff from the stack */
870 ra = (u1 *) *((ptrint *) (sp + 4 * 8));
871 o = (java_objectheader *) *((ptrint *) (sp + 3 * 8));
872 mcode = *((u8 *) (sp + 2 * 8));
873 cr = (constant_classref *) *((ptrint *) (sp + 1 * 8));
875 /* calculate and set the new return address */
878 *((ptrint *) (sp + 4 * 8)) = (ptrint) ra;
880 PATCHER_MONITORENTER;
882 /* get the fieldinfo */
884 if (!(c = resolve_classref_eager(cr))) {
890 /* patch back original code */
892 *((u8 *) ra) = mcode;
894 /* if we show disassembly, we have to skip the nop's */
896 if (opt_showdisassemble)
899 /* patch super class' vftbl */
901 *((ptrint *) (ra + 2)) = (ptrint) c->vftbl;
903 PATCHER_MARK_PATCHED_MONITOREXIT;
909 /* patcher_clinit **************************************************************
911 May be used for GET/PUTSTATIC and in native stub.
915 <patched call position>
916 4d 8b 15 92 ff ff ff mov -110(%rip),%r10
917 49 89 1a mov %rbx,(%r10)
919 *******************************************************************************/
921 bool patcher_clinit(u1 *sp)
924 java_objectheader *o;
928 /* get stuff from the stack */
930 ra = (u1 *) *((ptrint *) (sp + 4 * 8));
931 o = (java_objectheader *) *((ptrint *) (sp + 3 * 8));
932 mcode = *((u8 *) (sp + 2 * 8));
933 c = (classinfo *) *((ptrint *) (sp + 1 * 8));
935 /* calculate and set the new return address */
938 *((ptrint *) (sp + 4 * 8)) = (ptrint) ra;
940 PATCHER_MONITORENTER;
942 /* check if the class is initialized */
944 if (!initialize_class(c)) {
950 /* patch back original code */
952 *((u8 *) ra) = mcode;
954 PATCHER_MARK_PATCHED_MONITOREXIT;
960 /* patcher_athrow_areturn ******************************************************
964 <patched call position>
966 *******************************************************************************/
968 bool patcher_athrow_areturn(u1 *sp)
971 java_objectheader *o;
973 unresolved_class *uc;
976 /* get stuff from the stack */
978 ra = (u1 *) *((ptrint *) (sp + 4 * 8));
979 o = (java_objectheader *) *((ptrint *) (sp + 3 * 8));
980 mcode = *((u8 *) (sp + 2 * 8));
981 uc = (unresolved_class *) *((ptrint *) (sp + 1 * 8));
983 /* calculate and set the new return address */
986 *((ptrint *) (sp + 4 * 8)) = (ptrint) ra;
988 PATCHER_MONITORENTER;
990 /* resolve the class */
992 if (!resolve_class(uc, resolveEager, false, &c)) {
998 /* patch back original code */
1000 *((u8 *) ra) = mcode;
1002 PATCHER_MARK_PATCHED_MONITOREXIT;
1008 /* patcher_resolve_native ******************************************************
1012 <patched call position>
1013 48 b8 00 00 00 00 00 00 00 00 mov $0x0,%rax
1014 48 ff d0 callq *%rax
1016 *******************************************************************************/
1018 #if !defined(ENABLE_STATICVM)
1019 bool patcher_resolve_native(u1 *sp)
1022 java_objectheader *o;
1027 /* get stuff from the stack */
1029 ra = (u1 *) *((ptrint *) (sp + 4 * 8));
1030 o = (java_objectheader *) *((ptrint *) (sp + 3 * 8));
1031 mcode = *((u8 *) (sp + 2 * 8));
1032 m = (methodinfo *) *((ptrint *) (sp + 1 * 8));
1034 /* calculate and set the new return address */
1037 *((ptrint *) (sp + 4 * 8)) = (ptrint) ra;
1039 PATCHER_MONITORENTER;
1041 /* resolve native function */
1043 if (!(f = native_resolve_function(m))) {
1044 PATCHER_MONITOREXIT;
1049 /* patch back original code */
1051 *((u8 *) ra) = mcode;
1053 /* if we show disassembly, we have to skip the nop's */
1055 if (opt_showdisassemble)
1058 /* patch native function pointer */
1060 *((ptrint *) (ra + 2)) = (ptrint) f;
1062 PATCHER_MARK_PATCHED_MONITOREXIT;
1066 #endif /* !defined(ENABLE_STATICVM) */
1070 * These are local overrides for various environment variables in Emacs.
1071 * Please do not remove this and leave it at the end of the file, where
1072 * Emacs will automagically detect them.
1073 * ---------------------------------------------------------------------
1076 * indent-tabs-mode: t
1080 * vim:noexpandtab:sw=4:ts=4: