Chromium Code Reviews| 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 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 453 __ str(r6, MemOperand(r5, kPointerSize, PostIndex)); | 453 __ str(r6, MemOperand(r5, kPointerSize, PostIndex)); |
| 454 ASSERT_EQ(2 * kPointerSize, JSObject::kElementsOffset); | 454 ASSERT_EQ(2 * kPointerSize, JSObject::kElementsOffset); |
| 455 __ str(r6, MemOperand(r5, kPointerSize, PostIndex)); | 455 __ str(r6, MemOperand(r5, kPointerSize, PostIndex)); |
| 456 | 456 |
| 457 // Fill all the in-object properties with the appropriate filler. | 457 // Fill all the in-object properties with the appropriate filler. |
| 458 // r1: constructor function | 458 // r1: constructor function |
| 459 // r2: initial map | 459 // r2: initial map |
| 460 // r3: object size (in words) | 460 // r3: object size (in words) |
| 461 // r4: JSObject (not tagged) | 461 // r4: JSObject (not tagged) |
| 462 // r5: First in-object property of JSObject (not tagged) | 462 // r5: First in-object property of JSObject (not tagged) |
| 463 __ add(r6, r4, Operand(r3, LSL, kPointerSizeLog2)); // End of object. | |
| 464 ASSERT_EQ(3 * kPointerSize, JSObject::kHeaderSize); | 463 ASSERT_EQ(3 * kPointerSize, JSObject::kHeaderSize); |
| 465 __ LoadRoot(r7, Heap::kUndefinedValueRootIndex); | 464 __ LoadRoot(r6, Heap::kUndefinedValueRootIndex); |
| 466 if (count_constructions) { | 465 if (count_constructions) { |
| 467 __ ldr(r0, FieldMemOperand(r2, Map::kInstanceSizesOffset)); | 466 __ ldr(r0, FieldMemOperand(r2, Map::kInstanceSizesOffset)); |
| 468 __ Ubfx(r0, r0, Map::kPreAllocatedPropertyFieldsByte * kBitsPerByte, | 467 __ Ubfx(r0, r0, Map::kPreAllocatedPropertyFieldsByte * kBitsPerByte, |
| 469 kBitsPerByte); | 468 kBitsPerByte); |
| 470 __ add(r0, r5, Operand(r0, LSL, kPointerSizeLog2)); | 469 __ add(r0, r5, Operand(r0, LSL, kPointerSizeLog2)); |
| 471 // r0: offset of first field after pre-allocated fields | 470 // r0: offset of first field after pre-allocated fields |
| 472 if (FLAG_debug_code) { | 471 if (FLAG_debug_code) { |
| 473 __ cmp(r0, r6); | 472 __ add(ip, r4, Operand(r3, LSL, kPointerSizeLog2)); // End of object. |
| 473 __ cmp(r0, ip); | |
| 474 __ Assert(le, "Unexpected number of pre-allocated property fields."); | 474 __ Assert(le, "Unexpected number of pre-allocated property fields."); |
| 475 } | 475 } |
| 476 __ InitializeFieldsWithFiller(r5, r0, r7); | 476 __ InitializeFieldsWithFiller(r5, r0, r6); |
| 477 // To allow for truncation. | 477 // To allow for truncation. |
| 478 __ LoadRoot(r7, Heap::kOnePointerFillerMapRootIndex); | 478 __ LoadRoot(r6, Heap::kOnePointerFillerMapRootIndex); |
| 479 } | 479 } |
| 480 __ InitializeFieldsWithFiller(r5, r6, r7); | 480 __ add(r0, r4, Operand(r3, LSL, kPointerSizeLog2)); // End of object. |
| 481 __ InitializeFieldsWithFiller(r5, r0, r6); | |
| 481 | 482 |
| 482 // Add the object tag to make the JSObject real, so that we can continue | 483 // Add the object tag to make the JSObject real, so that we can continue |
| 483 // and jump into the continuation code at any time from now on. Any | 484 // and jump into the continuation code at any time from now on. Any |
| 484 // failures need to undo the allocation, so that the heap is in a | 485 // failures need to undo the allocation, so that the heap is in a |
| 485 // consistent state and verifiable. | 486 // consistent state and verifiable. |
| 486 __ add(r4, r4, Operand(kHeapObjectTag)); | 487 __ add(r4, r4, Operand(kHeapObjectTag)); |
| 487 | 488 |
| 488 // Check if a non-empty properties array is needed. Continue with | 489 // Check if a non-empty properties array is needed. Continue with |
| 489 // allocated object if not fall through to runtime call if it is. | 490 // allocated object if not fall through to runtime call if it is. |
| 490 // r1: constructor function | 491 // r1: constructor function |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 535 | 536 |
| 536 // Initialize the fields to undefined. | 537 // Initialize the fields to undefined. |
| 537 // r1: constructor function | 538 // r1: constructor function |
| 538 // r2: First element of FixedArray (not tagged) | 539 // r2: First element of FixedArray (not tagged) |
| 539 // r3: number of elements in properties array | 540 // r3: number of elements in properties array |
| 540 // r4: JSObject | 541 // r4: JSObject |
| 541 // r5: FixedArray (not tagged) | 542 // r5: FixedArray (not tagged) |
| 542 __ add(r6, r2, Operand(r3, LSL, kPointerSizeLog2)); // End of object. | 543 __ add(r6, r2, Operand(r3, LSL, kPointerSizeLog2)); // End of object. |
| 543 ASSERT_EQ(2 * kPointerSize, FixedArray::kHeaderSize); | 544 ASSERT_EQ(2 * kPointerSize, FixedArray::kHeaderSize); |
| 544 { Label loop, entry; | 545 { Label loop, entry; |
| 545 if (count_constructions) { | 546 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); |
| 546 __ LoadRoot(r7, Heap::kUndefinedValueRootIndex); | |
| 547 } else if (FLAG_debug_code) { | |
| 548 __ LoadRoot(r8, Heap::kUndefinedValueRootIndex); | |
| 549 __ cmp(r7, r8); | |
| 550 __ Assert(eq, "Undefined value not loaded."); | |
| 551 } | |
|
JF
2013/07/29 17:20:09
I'm not sure I understand this change.
rmcilroy
2013/07/30 11:39:44
Beforehand, the code would only reloaded r7 with H
| |
| 552 __ b(&entry); | 547 __ b(&entry); |
| 553 __ bind(&loop); | 548 __ bind(&loop); |
| 554 __ str(r7, MemOperand(r2, kPointerSize, PostIndex)); | 549 __ str(r0, MemOperand(r2, kPointerSize, PostIndex)); |
| 555 __ bind(&entry); | 550 __ bind(&entry); |
| 556 __ cmp(r2, r6); | 551 __ cmp(r2, r6); |
| 557 __ b(lt, &loop); | 552 __ b(lt, &loop); |
| 558 } | 553 } |
| 559 | 554 |
| 560 // Store the initialized FixedArray into the properties field of | 555 // Store the initialized FixedArray into the properties field of |
| 561 // the JSObject | 556 // the JSObject |
| 562 // r1: constructor function | 557 // r1: constructor function |
| 563 // r4: JSObject | 558 // r4: JSObject |
| 564 // r5: FixedArray (not tagged) | 559 // r5: FixedArray (not tagged) |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 708 | 703 |
| 709 | 704 |
| 710 static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm, | 705 static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm, |
| 711 bool is_construct) { | 706 bool is_construct) { |
| 712 // Called from Generate_JS_Entry | 707 // Called from Generate_JS_Entry |
| 713 // r0: code entry | 708 // r0: code entry |
| 714 // r1: function | 709 // r1: function |
| 715 // r2: receiver | 710 // r2: receiver |
| 716 // r3: argc | 711 // r3: argc |
| 717 // r4: argv | 712 // r4: argv |
| 718 // r5-r7, cp may be clobbered | 713 // r5-r6, cp may be clobbered |
|
JF
2013/07/29 17:20:09
r7 can still be clobbered if the flag doesn't sequ
rmcilroy
2013/07/30 11:39:44
Done.
| |
| 719 ProfileEntryHookStub::MaybeCallEntryHook(masm); | 714 ProfileEntryHookStub::MaybeCallEntryHook(masm); |
| 720 | 715 |
| 721 // Clear the context before we push it when entering the internal frame. | 716 // Clear the context before we push it when entering the internal frame. |
| 722 __ mov(cp, Operand::Zero()); | 717 __ mov(cp, Operand::Zero()); |
| 723 | 718 |
| 724 // Enter an internal frame. | 719 // Enter an internal frame. |
| 725 { | 720 { |
| 726 FrameScope scope(masm, StackFrame::INTERNAL); | 721 FrameScope scope(masm, StackFrame::INTERNAL); |
| 727 | 722 |
| 728 // Set up the context from the function argument. | 723 // Set up the context from the function argument. |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 748 __ push(r0); // push parameter | 743 __ push(r0); // push parameter |
| 749 __ bind(&entry); | 744 __ bind(&entry); |
| 750 __ cmp(r4, r2); | 745 __ cmp(r4, r2); |
| 751 __ b(ne, &loop); | 746 __ b(ne, &loop); |
| 752 | 747 |
| 753 // Initialize all JavaScript callee-saved registers, since they will be seen | 748 // Initialize all JavaScript callee-saved registers, since they will be seen |
| 754 // by the garbage collector as part of handlers. | 749 // by the garbage collector as part of handlers. |
| 755 __ LoadRoot(r4, Heap::kUndefinedValueRootIndex); | 750 __ LoadRoot(r4, Heap::kUndefinedValueRootIndex); |
| 756 __ mov(r5, Operand(r4)); | 751 __ mov(r5, Operand(r4)); |
| 757 __ mov(r6, Operand(r4)); | 752 __ mov(r6, Operand(r4)); |
| 758 __ mov(r7, Operand(r4)); | |
|
JF
2013/07/29 17:20:09
This should be conditional on the flag being enabl
rmcilroy
2013/07/30 11:39:44
Done.
| |
| 759 if (kR9Available == 1) { | 753 if (kR9Available == 1) { |
| 760 __ mov(r9, Operand(r4)); | 754 __ mov(r9, Operand(r4)); |
| 761 } | 755 } |
| 762 | 756 |
| 763 // Invoke the code and pass argc as r0. | 757 // Invoke the code and pass argc as r0. |
| 764 __ mov(r0, Operand(r3)); | 758 __ mov(r0, Operand(r3)); |
| 765 if (is_construct) { | 759 if (is_construct) { |
| 766 // No type feedback cell is available | 760 // No type feedback cell is available |
| 767 Handle<Object> undefined_sentinel( | 761 Handle<Object> undefined_sentinel( |
| 768 masm->isolate()->heap()->undefined_value(), masm->isolate()); | 762 masm->isolate()->heap()->undefined_value(), masm->isolate()); |
| (...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1475 __ bind(&dont_adapt_arguments); | 1469 __ bind(&dont_adapt_arguments); |
| 1476 __ Jump(r3); | 1470 __ Jump(r3); |
| 1477 } | 1471 } |
| 1478 | 1472 |
| 1479 | 1473 |
| 1480 #undef __ | 1474 #undef __ |
| 1481 | 1475 |
| 1482 } } // namespace v8::internal | 1476 } } // namespace v8::internal |
| 1483 | 1477 |
| 1484 #endif // V8_TARGET_ARCH_ARM | 1478 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |