OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 __ str(r6, MemOperand(r5, kPointerSize, PostIndex)); | 438 __ str(r6, MemOperand(r5, kPointerSize, PostIndex)); |
439 ASSERT_EQ(2 * kPointerSize, JSObject::kElementsOffset); | 439 ASSERT_EQ(2 * kPointerSize, JSObject::kElementsOffset); |
440 __ str(r6, MemOperand(r5, kPointerSize, PostIndex)); | 440 __ str(r6, MemOperand(r5, kPointerSize, PostIndex)); |
441 | 441 |
442 // Fill all the in-object properties with the appropriate filler. | 442 // Fill all the in-object properties with the appropriate filler. |
443 // r1: constructor function | 443 // r1: constructor function |
444 // r2: initial map | 444 // r2: initial map |
445 // r3: object size (in words) | 445 // r3: object size (in words) |
446 // r4: JSObject (not tagged) | 446 // r4: JSObject (not tagged) |
447 // r5: First in-object property of JSObject (not tagged) | 447 // r5: First in-object property of JSObject (not tagged) |
448 __ add(r6, r4, Operand(r3, LSL, kPointerSizeLog2)); // End of object. | |
449 ASSERT_EQ(3 * kPointerSize, JSObject::kHeaderSize); | 448 ASSERT_EQ(3 * kPointerSize, JSObject::kHeaderSize); |
450 __ LoadRoot(r7, Heap::kUndefinedValueRootIndex); | 449 __ LoadRoot(r6, Heap::kUndefinedValueRootIndex); |
451 if (count_constructions) { | 450 if (count_constructions) { |
452 __ ldr(r0, FieldMemOperand(r2, Map::kInstanceSizesOffset)); | 451 __ ldr(r0, FieldMemOperand(r2, Map::kInstanceSizesOffset)); |
453 __ Ubfx(r0, r0, Map::kPreAllocatedPropertyFieldsByte * kBitsPerByte, | 452 __ Ubfx(r0, r0, Map::kPreAllocatedPropertyFieldsByte * kBitsPerByte, |
454 kBitsPerByte); | 453 kBitsPerByte); |
455 __ add(r0, r5, Operand(r0, LSL, kPointerSizeLog2)); | 454 __ add(r0, r5, Operand(r0, LSL, kPointerSizeLog2)); |
456 // r0: offset of first field after pre-allocated fields | 455 // r0: offset of first field after pre-allocated fields |
457 if (FLAG_debug_code) { | 456 if (FLAG_debug_code) { |
458 __ cmp(r0, r6); | 457 __ add(ip, r4, Operand(r3, LSL, kPointerSizeLog2)); // End of object. |
| 458 __ cmp(r0, ip); |
459 __ Assert(le, kUnexpectedNumberOfPreAllocatedPropertyFields); | 459 __ Assert(le, kUnexpectedNumberOfPreAllocatedPropertyFields); |
460 } | 460 } |
461 __ InitializeFieldsWithFiller(r5, r0, r7); | 461 __ InitializeFieldsWithFiller(r5, r0, r6); |
462 // To allow for truncation. | 462 // To allow for truncation. |
463 __ LoadRoot(r7, Heap::kOnePointerFillerMapRootIndex); | 463 __ LoadRoot(r6, Heap::kOnePointerFillerMapRootIndex); |
464 } | 464 } |
465 __ InitializeFieldsWithFiller(r5, r6, r7); | 465 __ add(r0, r4, Operand(r3, LSL, kPointerSizeLog2)); // End of object. |
| 466 __ InitializeFieldsWithFiller(r5, r0, r6); |
466 | 467 |
467 // Add the object tag to make the JSObject real, so that we can continue | 468 // Add the object tag to make the JSObject real, so that we can continue |
468 // and jump into the continuation code at any time from now on. Any | 469 // and jump into the continuation code at any time from now on. Any |
469 // failures need to undo the allocation, so that the heap is in a | 470 // failures need to undo the allocation, so that the heap is in a |
470 // consistent state and verifiable. | 471 // consistent state and verifiable. |
471 __ add(r4, r4, Operand(kHeapObjectTag)); | 472 __ add(r4, r4, Operand(kHeapObjectTag)); |
472 | 473 |
473 // Check if a non-empty properties array is needed. Continue with | 474 // Check if a non-empty properties array is needed. Continue with |
474 // allocated object if not fall through to runtime call if it is. | 475 // allocated object if not fall through to runtime call if it is. |
475 // r1: constructor function | 476 // r1: constructor function |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 | 521 |
521 // Initialize the fields to undefined. | 522 // Initialize the fields to undefined. |
522 // r1: constructor function | 523 // r1: constructor function |
523 // r2: First element of FixedArray (not tagged) | 524 // r2: First element of FixedArray (not tagged) |
524 // r3: number of elements in properties array | 525 // r3: number of elements in properties array |
525 // r4: JSObject | 526 // r4: JSObject |
526 // r5: FixedArray (not tagged) | 527 // r5: FixedArray (not tagged) |
527 __ add(r6, r2, Operand(r3, LSL, kPointerSizeLog2)); // End of object. | 528 __ add(r6, r2, Operand(r3, LSL, kPointerSizeLog2)); // End of object. |
528 ASSERT_EQ(2 * kPointerSize, FixedArray::kHeaderSize); | 529 ASSERT_EQ(2 * kPointerSize, FixedArray::kHeaderSize); |
529 { Label loop, entry; | 530 { Label loop, entry; |
530 if (count_constructions) { | 531 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); |
531 __ LoadRoot(r7, Heap::kUndefinedValueRootIndex); | |
532 } else if (FLAG_debug_code) { | |
533 __ LoadRoot(r8, Heap::kUndefinedValueRootIndex); | |
534 __ cmp(r7, r8); | |
535 __ Assert(eq, kUndefinedValueNotLoaded); | |
536 } | |
537 __ b(&entry); | 532 __ b(&entry); |
538 __ bind(&loop); | 533 __ bind(&loop); |
539 __ str(r7, MemOperand(r2, kPointerSize, PostIndex)); | 534 __ str(r0, MemOperand(r2, kPointerSize, PostIndex)); |
540 __ bind(&entry); | 535 __ bind(&entry); |
541 __ cmp(r2, r6); | 536 __ cmp(r2, r6); |
542 __ b(lt, &loop); | 537 __ b(lt, &loop); |
543 } | 538 } |
544 | 539 |
545 // Store the initialized FixedArray into the properties field of | 540 // Store the initialized FixedArray into the properties field of |
546 // the JSObject | 541 // the JSObject |
547 // r1: constructor function | 542 // r1: constructor function |
548 // r4: JSObject | 543 // r4: JSObject |
549 // r5: FixedArray (not tagged) | 544 // r5: FixedArray (not tagged) |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
693 | 688 |
694 | 689 |
695 static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm, | 690 static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm, |
696 bool is_construct) { | 691 bool is_construct) { |
697 // Called from Generate_JS_Entry | 692 // Called from Generate_JS_Entry |
698 // r0: code entry | 693 // r0: code entry |
699 // r1: function | 694 // r1: function |
700 // r2: receiver | 695 // r2: receiver |
701 // r3: argc | 696 // r3: argc |
702 // r4: argv | 697 // r4: argv |
703 // r5-r7, cp may be clobbered | 698 // r5-r6, r7 (if not FLAG_enable_ool_constant_pool) and cp may be clobbered |
704 ProfileEntryHookStub::MaybeCallEntryHook(masm); | 699 ProfileEntryHookStub::MaybeCallEntryHook(masm); |
705 | 700 |
706 // Clear the context before we push it when entering the internal frame. | 701 // Clear the context before we push it when entering the internal frame. |
707 __ mov(cp, Operand::Zero()); | 702 __ mov(cp, Operand::Zero()); |
708 | 703 |
709 // Enter an internal frame. | 704 // Enter an internal frame. |
710 { | 705 { |
711 FrameScope scope(masm, StackFrame::INTERNAL); | 706 FrameScope scope(masm, StackFrame::INTERNAL); |
712 | 707 |
713 // Set up the context from the function argument. | 708 // Set up the context from the function argument. |
(...skipping 19 matching lines...) Expand all Loading... |
733 __ push(r0); // push parameter | 728 __ push(r0); // push parameter |
734 __ bind(&entry); | 729 __ bind(&entry); |
735 __ cmp(r4, r2); | 730 __ cmp(r4, r2); |
736 __ b(ne, &loop); | 731 __ b(ne, &loop); |
737 | 732 |
738 // Initialize all JavaScript callee-saved registers, since they will be seen | 733 // Initialize all JavaScript callee-saved registers, since they will be seen |
739 // by the garbage collector as part of handlers. | 734 // by the garbage collector as part of handlers. |
740 __ LoadRoot(r4, Heap::kUndefinedValueRootIndex); | 735 __ LoadRoot(r4, Heap::kUndefinedValueRootIndex); |
741 __ mov(r5, Operand(r4)); | 736 __ mov(r5, Operand(r4)); |
742 __ mov(r6, Operand(r4)); | 737 __ mov(r6, Operand(r4)); |
743 __ mov(r7, Operand(r4)); | 738 if (!FLAG_enable_ool_constant_pool) { |
| 739 __ mov(r7, Operand(r4)); |
| 740 } |
744 if (kR9Available == 1) { | 741 if (kR9Available == 1) { |
745 __ mov(r9, Operand(r4)); | 742 __ mov(r9, Operand(r4)); |
746 } | 743 } |
747 | 744 |
748 // Invoke the code and pass argc as r0. | 745 // Invoke the code and pass argc as r0. |
749 __ mov(r0, Operand(r3)); | 746 __ mov(r0, Operand(r3)); |
750 if (is_construct) { | 747 if (is_construct) { |
751 // No type feedback cell is available | 748 // No type feedback cell is available |
752 Handle<Object> undefined_sentinel( | 749 Handle<Object> undefined_sentinel( |
753 masm->isolate()->heap()->undefined_value(), masm->isolate()); | 750 masm->isolate()->heap()->undefined_value(), masm->isolate()); |
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1436 __ bind(&dont_adapt_arguments); | 1433 __ bind(&dont_adapt_arguments); |
1437 __ Jump(r3); | 1434 __ Jump(r3); |
1438 } | 1435 } |
1439 | 1436 |
1440 | 1437 |
1441 #undef __ | 1438 #undef __ |
1442 | 1439 |
1443 } } // namespace v8::internal | 1440 } } // namespace v8::internal |
1444 | 1441 |
1445 #endif // V8_TARGET_ARCH_ARM | 1442 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |