| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_PPC | 7 #if V8_TARGET_ARCH_PPC |
| 8 | 8 |
| 9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
| 10 #include "src/debug.h" | 10 #include "src/debug.h" |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 if (create_memento) { | 432 if (create_memento) { |
| 433 __ addi(r6, r6, Operand(AllocationMemento::kSize / kPointerSize)); | 433 __ addi(r6, r6, Operand(AllocationMemento::kSize / kPointerSize)); |
| 434 } | 434 } |
| 435 | 435 |
| 436 __ Allocate(r6, r7, r8, r9, &rt_call, SIZE_IN_WORDS); | 436 __ Allocate(r6, r7, r8, r9, &rt_call, SIZE_IN_WORDS); |
| 437 | 437 |
| 438 // Allocated the JSObject, now initialize the fields. Map is set to | 438 // Allocated the JSObject, now initialize the fields. Map is set to |
| 439 // initial map and properties and elements are set to empty fixed array. | 439 // initial map and properties and elements are set to empty fixed array. |
| 440 // r4: constructor function | 440 // r4: constructor function |
| 441 // r5: initial map | 441 // r5: initial map |
| 442 // r6: object size (not including memento if create_memento) | 442 // r6: object size (including memento if create_memento) |
| 443 // r7: JSObject (not tagged) | 443 // r7: JSObject (not tagged) |
| 444 __ LoadRoot(r9, Heap::kEmptyFixedArrayRootIndex); | 444 __ LoadRoot(r9, Heap::kEmptyFixedArrayRootIndex); |
| 445 __ mr(r8, r7); | 445 __ mr(r8, r7); |
| 446 __ StoreP(r5, MemOperand(r8, JSObject::kMapOffset)); | 446 __ StoreP(r5, MemOperand(r8, JSObject::kMapOffset)); |
| 447 __ StoreP(r9, MemOperand(r8, JSObject::kPropertiesOffset)); | 447 __ StoreP(r9, MemOperand(r8, JSObject::kPropertiesOffset)); |
| 448 __ StoreP(r9, MemOperand(r8, JSObject::kElementsOffset)); | 448 __ StoreP(r9, MemOperand(r8, JSObject::kElementsOffset)); |
| 449 __ addi(r8, r8, Operand(JSObject::kElementsOffset + kPointerSize)); | 449 __ addi(r8, r8, Operand(JSObject::kElementsOffset + kPointerSize)); |
| 450 | 450 |
| 451 __ ShiftLeftImm(r9, r6, Operand(kPointerSizeLog2)); | 451 __ ShiftLeftImm(r9, r6, Operand(kPointerSizeLog2)); |
| 452 __ add(r9, r7, r9); // End of object. | 452 __ add(r9, r7, r9); // End of object. |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 __ InitializeFieldsWithFiller(r8, r9, r10); | 509 __ InitializeFieldsWithFiller(r8, r9, r10); |
| 510 } | 510 } |
| 511 | 511 |
| 512 // Add the object tag to make the JSObject real, so that we can continue | 512 // Add the object tag to make the JSObject real, so that we can continue |
| 513 // and jump into the continuation code at any time from now on. Any | 513 // and jump into the continuation code at any time from now on. Any |
| 514 // failures need to undo the allocation, so that the heap is in a | 514 // failures need to undo the allocation, so that the heap is in a |
| 515 // consistent state and verifiable. | 515 // consistent state and verifiable. |
| 516 __ addi(r7, r7, Operand(kHeapObjectTag)); | 516 __ addi(r7, r7, Operand(kHeapObjectTag)); |
| 517 | 517 |
| 518 // Check if a non-empty properties array is needed. Continue with | 518 // Check if a non-empty properties array is needed. Continue with |
| 519 // allocated object if not fall through to runtime call if it is. | 519 // allocated object if not; allocate and initialize a FixedArray if yes. |
| 520 // r4: constructor function | 520 // r4: constructor function |
| 521 // r7: JSObject | 521 // r7: JSObject |
| 522 // r8: start of next object (not tagged) | 522 // r8: start of next object (not tagged) |
| 523 __ lbz(r6, FieldMemOperand(r5, Map::kUnusedPropertyFieldsOffset)); | 523 __ lbz(r6, FieldMemOperand(r5, Map::kUnusedPropertyFieldsOffset)); |
| 524 // The field instance sizes contains both pre-allocated property fields | 524 // The field instance sizes contains both pre-allocated property fields |
| 525 // and in-object properties. | 525 // and in-object properties. |
| 526 __ lbz(r0, FieldMemOperand(r5, Map::kPreAllocatedPropertyFieldsOffset)); | 526 __ lbz(r0, FieldMemOperand(r5, Map::kPreAllocatedPropertyFieldsOffset)); |
| 527 __ add(r6, r6, r0); | 527 __ add(r6, r6, r0); |
| 528 __ lbz(r0, FieldMemOperand(r5, Map::kInObjectPropertiesOffset)); | 528 __ lbz(r0, FieldMemOperand(r5, Map::kInObjectPropertiesOffset)); |
| 529 __ sub(r6, r6, r0, LeaveOE, SetRC); | 529 __ sub(r6, r6, r0, LeaveOE, SetRC); |
| (...skipping 1342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1872 __ bkpt(0); | 1872 __ bkpt(0); |
| 1873 } | 1873 } |
| 1874 } | 1874 } |
| 1875 | 1875 |
| 1876 | 1876 |
| 1877 #undef __ | 1877 #undef __ |
| 1878 } // namespace internal | 1878 } // namespace internal |
| 1879 } // namespace v8 | 1879 } // namespace v8 |
| 1880 | 1880 |
| 1881 #endif // V8_TARGET_ARCH_PPC | 1881 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |