OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-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 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 // r4: JSObject (not tagged) | 586 // r4: JSObject (not tagged) |
587 // r5: First in-object property of JSObject (not tagged) | 587 // r5: First in-object property of JSObject (not tagged) |
588 // r7: undefined | 588 // r7: undefined |
589 __ add(r6, r4, Operand(r3, LSL, kPointerSizeLog2)); // End of object. | 589 __ add(r6, r4, Operand(r3, LSL, kPointerSizeLog2)); // End of object. |
590 ASSERT_EQ(3 * kPointerSize, JSObject::kHeaderSize); | 590 ASSERT_EQ(3 * kPointerSize, JSObject::kHeaderSize); |
591 { Label loop, entry; | 591 { Label loop, entry; |
592 __ b(&entry); | 592 __ b(&entry); |
593 __ bind(&loop); | 593 __ bind(&loop); |
594 __ str(r7, MemOperand(r5, kPointerSize, PostIndex)); | 594 __ str(r7, MemOperand(r5, kPointerSize, PostIndex)); |
595 __ bind(&entry); | 595 __ bind(&entry); |
596 __ cmp(r5, Operand(r6)); | 596 __ cmp(r5, r6); |
597 __ b(lt, &loop); | 597 __ b(lt, &loop); |
598 } | 598 } |
599 | 599 |
600 // Add the object tag to make the JSObject real, so that we can continue and | 600 // Add the object tag to make the JSObject real, so that we can continue and |
601 // jump into the continuation code at any time from now on. Any failures | 601 // jump into the continuation code at any time from now on. Any failures |
602 // need to undo the allocation, so that the heap is in a consistent state | 602 // need to undo the allocation, so that the heap is in a consistent state |
603 // and verifiable. | 603 // and verifiable. |
604 __ add(r4, r4, Operand(kHeapObjectTag)); | 604 __ add(r4, r4, Operand(kHeapObjectTag)); |
605 | 605 |
606 // Check if a non-empty properties array is needed. Continue with allocated | 606 // Check if a non-empty properties array is needed. Continue with allocated |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
659 // r4: JSObject | 659 // r4: JSObject |
660 // r5: FixedArray (not tagged) | 660 // r5: FixedArray (not tagged) |
661 // r7: undefined | 661 // r7: undefined |
662 __ add(r6, r2, Operand(r3, LSL, kPointerSizeLog2)); // End of object. | 662 __ add(r6, r2, Operand(r3, LSL, kPointerSizeLog2)); // End of object. |
663 ASSERT_EQ(2 * kPointerSize, FixedArray::kHeaderSize); | 663 ASSERT_EQ(2 * kPointerSize, FixedArray::kHeaderSize); |
664 { Label loop, entry; | 664 { Label loop, entry; |
665 __ b(&entry); | 665 __ b(&entry); |
666 __ bind(&loop); | 666 __ bind(&loop); |
667 __ str(r7, MemOperand(r2, kPointerSize, PostIndex)); | 667 __ str(r7, MemOperand(r2, kPointerSize, PostIndex)); |
668 __ bind(&entry); | 668 __ bind(&entry); |
669 __ cmp(r2, Operand(r6)); | 669 __ cmp(r2, r6); |
670 __ b(lt, &loop); | 670 __ b(lt, &loop); |
671 } | 671 } |
672 | 672 |
673 // Store the initialized FixedArray into the properties field of | 673 // Store the initialized FixedArray into the properties field of |
674 // the JSObject | 674 // the JSObject |
675 // r1: constructor function | 675 // r1: constructor function |
676 // r4: JSObject | 676 // r4: JSObject |
677 // r5: FixedArray (not tagged) | 677 // r5: FixedArray (not tagged) |
678 __ add(r5, r5, Operand(kHeapObjectTag)); // Add the heap tag. | 678 __ add(r5, r5, Operand(kHeapObjectTag)); // Add the heap tag. |
679 __ str(r5, FieldMemOperand(r4, JSObject::kPropertiesOffset)); | 679 __ str(r5, FieldMemOperand(r4, JSObject::kPropertiesOffset)); |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
856 // r4: argv, i.e. points to first arg | 856 // r4: argv, i.e. points to first arg |
857 Label loop, entry; | 857 Label loop, entry; |
858 __ add(r2, r4, Operand(r3, LSL, kPointerSizeLog2)); | 858 __ add(r2, r4, Operand(r3, LSL, kPointerSizeLog2)); |
859 // r2 points past last arg. | 859 // r2 points past last arg. |
860 __ b(&entry); | 860 __ b(&entry); |
861 __ bind(&loop); | 861 __ bind(&loop); |
862 __ ldr(r0, MemOperand(r4, kPointerSize, PostIndex)); // read next parameter | 862 __ ldr(r0, MemOperand(r4, kPointerSize, PostIndex)); // read next parameter |
863 __ ldr(r0, MemOperand(r0)); // dereference handle | 863 __ ldr(r0, MemOperand(r0)); // dereference handle |
864 __ push(r0); // push parameter | 864 __ push(r0); // push parameter |
865 __ bind(&entry); | 865 __ bind(&entry); |
866 __ cmp(r4, Operand(r2)); | 866 __ cmp(r4, r2); |
867 __ b(ne, &loop); | 867 __ b(ne, &loop); |
868 | 868 |
869 // Initialize all JavaScript callee-saved registers, since they will be seen | 869 // Initialize all JavaScript callee-saved registers, since they will be seen |
870 // by the garbage collector as part of handlers. | 870 // by the garbage collector as part of handlers. |
871 __ LoadRoot(r4, Heap::kUndefinedValueRootIndex); | 871 __ LoadRoot(r4, Heap::kUndefinedValueRootIndex); |
872 __ mov(r5, Operand(r4)); | 872 __ mov(r5, Operand(r4)); |
873 __ mov(r6, Operand(r4)); | 873 __ mov(r6, Operand(r4)); |
874 __ mov(r7, Operand(r4)); | 874 __ mov(r7, Operand(r4)); |
875 if (kR9Available == 1) { | 875 if (kR9Available == 1) { |
876 __ mov(r9, Operand(r4)); | 876 __ mov(r9, Operand(r4)); |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1206 // ----------- S t a t e ------------- | 1206 // ----------- S t a t e ------------- |
1207 // -- r0 : actual number of arguments | 1207 // -- r0 : actual number of arguments |
1208 // -- r1 : function (passed through to callee) | 1208 // -- r1 : function (passed through to callee) |
1209 // -- r2 : expected number of arguments | 1209 // -- r2 : expected number of arguments |
1210 // -- r3 : code entry to call | 1210 // -- r3 : code entry to call |
1211 // ----------------------------------- | 1211 // ----------------------------------- |
1212 | 1212 |
1213 Label invoke, dont_adapt_arguments; | 1213 Label invoke, dont_adapt_arguments; |
1214 | 1214 |
1215 Label enough, too_few; | 1215 Label enough, too_few; |
1216 __ cmp(r0, Operand(r2)); | 1216 __ cmp(r0, r2); |
1217 __ b(lt, &too_few); | 1217 __ b(lt, &too_few); |
1218 __ cmp(r2, Operand(SharedFunctionInfo::kDontAdaptArgumentsSentinel)); | 1218 __ cmp(r2, Operand(SharedFunctionInfo::kDontAdaptArgumentsSentinel)); |
1219 __ b(eq, &dont_adapt_arguments); | 1219 __ b(eq, &dont_adapt_arguments); |
1220 | 1220 |
1221 { // Enough parameters: actual >= expected | 1221 { // Enough parameters: actual >= expected |
1222 __ bind(&enough); | 1222 __ bind(&enough); |
1223 EnterArgumentsAdaptorFrame(masm); | 1223 EnterArgumentsAdaptorFrame(masm); |
1224 | 1224 |
1225 // Calculate copy start address into r0 and copy end address into r2. | 1225 // Calculate copy start address into r0 and copy end address into r2. |
1226 // r0: actual number of arguments as a smi | 1226 // r0: actual number of arguments as a smi |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1302 // Dont adapt arguments. | 1302 // Dont adapt arguments. |
1303 // ------------------------------------------- | 1303 // ------------------------------------------- |
1304 __ bind(&dont_adapt_arguments); | 1304 __ bind(&dont_adapt_arguments); |
1305 __ Jump(r3); | 1305 __ Jump(r3); |
1306 } | 1306 } |
1307 | 1307 |
1308 | 1308 |
1309 #undef __ | 1309 #undef __ |
1310 | 1310 |
1311 } } // namespace v8::internal | 1311 } } // namespace v8::internal |
OLD | NEW |