| 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 #if V8_TARGET_ARCH_PPC | 5 #if V8_TARGET_ARCH_PPC | 
| 6 | 6 | 
| 7 #include "src/codegen.h" | 7 #include "src/codegen.h" | 
| 8 #include "src/debug/debug.h" | 8 #include "src/debug/debug.h" | 
| 9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" | 
| 10 #include "src/full-codegen/full-codegen.h" | 10 #include "src/full-codegen/full-codegen.h" | 
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 431 | 431 | 
| 432           __ bind(&allocate); | 432           __ bind(&allocate); | 
| 433         } | 433         } | 
| 434 | 434 | 
| 435         // Now allocate the JSObject on the heap. | 435         // Now allocate the JSObject on the heap. | 
| 436         // r4: constructor function | 436         // r4: constructor function | 
| 437         // r5: initial map | 437         // r5: initial map | 
| 438         Label rt_call_reload_new_target; | 438         Label rt_call_reload_new_target; | 
| 439         __ lbz(r6, FieldMemOperand(r5, Map::kInstanceSizeOffset)); | 439         __ lbz(r6, FieldMemOperand(r5, Map::kInstanceSizeOffset)); | 
| 440 | 440 | 
| 441         __ Allocate(r6, r7, r8, r9, &rt_call_reload_new_target, SIZE_IN_WORDS); | 441         __ Allocate(r6, r7, r6, r9, &rt_call_reload_new_target, SIZE_IN_WORDS); | 
| 442 | 442 | 
| 443         // Allocated the JSObject, now initialize the fields. Map is set to | 443         // Allocated the JSObject, now initialize the fields. Map is set to | 
| 444         // initial map and properties and elements are set to empty fixed array. | 444         // initial map and properties and elements are set to empty fixed array. | 
| 445         // r4: constructor function | 445         // r4: constructor function | 
| 446         // r5: initial map | 446         // r5: initial map | 
| 447         // r6: object size | 447         // r6: start of next object | 
| 448         // r7: JSObject (not tagged) | 448         // r7: JSObject (not tagged) | 
| 449         __ LoadRoot(r9, Heap::kEmptyFixedArrayRootIndex); | 449         __ LoadRoot(r9, Heap::kEmptyFixedArrayRootIndex); | 
| 450         __ mr(r8, r7); | 450         __ StoreP(r5, MemOperand(r7, JSObject::kMapOffset)); | 
| 451         __ StoreP(r5, MemOperand(r8, JSObject::kMapOffset)); | 451         __ StoreP(r9, MemOperand(r7, JSObject::kPropertiesOffset)); | 
| 452         __ StoreP(r9, MemOperand(r8, JSObject::kPropertiesOffset)); | 452         __ StoreP(r9, MemOperand(r7, JSObject::kElementsOffset)); | 
| 453         __ StoreP(r9, MemOperand(r8, JSObject::kElementsOffset)); | 453         __ addi(r8, r7, Operand(JSObject::kElementsOffset + kPointerSize)); | 
| 454         __ addi(r8, r8, Operand(JSObject::kElementsOffset + kPointerSize)); |  | 
| 455 |  | 
| 456         __ ShiftLeftImm(r9, r6, Operand(kPointerSizeLog2)); |  | 
| 457         __ add(r9, r7, r9);  // End of object. |  | 
| 458 | 454 | 
| 459         // Fill all the in-object properties with the appropriate filler. | 455         // Fill all the in-object properties with the appropriate filler. | 
| 460         // r4: constructor function | 456         // r4: constructor function | 
| 461         // r5: initial map | 457         // r5: initial map | 
| 462         // r6: object size | 458         // r6: start of next object | 
| 463         // r7: JSObject (not tagged) | 459         // r7: JSObject (not tagged) | 
| 464         // r8: First in-object property of JSObject (not tagged) | 460         // r8: First in-object property of JSObject (not tagged) | 
| 465         // r9: End of object |  | 
| 466         DCHECK_EQ(3 * kPointerSize, JSObject::kHeaderSize); | 461         DCHECK_EQ(3 * kPointerSize, JSObject::kHeaderSize); | 
| 467         __ LoadRoot(r10, Heap::kUndefinedValueRootIndex); | 462         __ LoadRoot(r9, Heap::kUndefinedValueRootIndex); | 
| 468 | 463 | 
| 469         if (!is_api_function) { | 464         if (!is_api_function) { | 
| 470           Label no_inobject_slack_tracking; | 465           Label no_inobject_slack_tracking; | 
| 471 | 466 | 
| 472           // Check if slack tracking is enabled. | 467           // Check if slack tracking is enabled. | 
| 473           __ cmpi(r11, Operand(Map::kSlackTrackingCounterEnd)); | 468           __ cmpi(r11, Operand(Map::kSlackTrackingCounterEnd)); | 
| 474           __ blt(&no_inobject_slack_tracking); | 469           __ blt(&no_inobject_slack_tracking); | 
| 475 | 470 | 
| 476           // Allocate object with a slack. | 471           // Allocate object with a slack. | 
| 477           __ lbz(r3, | 472           __ lbz(r3, FieldMemOperand(r5, Map::kUnusedPropertyFieldsOffset)); | 
| 478                  FieldMemOperand( | 473           __ ShiftLeftImm(r3, r3, Operand(kPointerSizeLog2)); | 
| 479                      r5, | 474           __ sub(r3, r6, r3); | 
| 480                      Map::kInObjectPropertiesOrConstructorFunctionIndexOffset)); | 475           // r3: offset of first field after pre-allocated fields | 
| 481           __ lbz(r5, FieldMemOperand(r5, Map::kUnusedPropertyFieldsOffset)); |  | 
| 482           __ sub(r3, r3, r5); |  | 
| 483           if (FLAG_debug_code) { | 476           if (FLAG_debug_code) { | 
| 484             __ ShiftLeftImm(r0, r3, Operand(kPointerSizeLog2)); | 477             __ cmp(r8, r3); | 
| 485             __ add(r0, r8, r0); |  | 
| 486             // r0: offset of first field after pre-allocated fields |  | 
| 487             __ cmp(r0, r9); |  | 
| 488             __ Assert(le, kUnexpectedNumberOfPreAllocatedPropertyFields); | 478             __ Assert(le, kUnexpectedNumberOfPreAllocatedPropertyFields); | 
| 489           } | 479           } | 
| 490           { | 480           __ InitializeFieldsWithFiller(r8, r3, r9); | 
| 491             Label done; |  | 
| 492             __ cmpi(r3, Operand::Zero()); |  | 
| 493             __ beq(&done); |  | 
| 494             __ InitializeNFieldsWithFiller(r8, r3, r10); |  | 
| 495             __ bind(&done); |  | 
| 496           } |  | 
| 497           // To allow for truncation. | 481           // To allow for truncation. | 
| 498           __ LoadRoot(r10, Heap::kOnePointerFillerMapRootIndex); | 482           __ LoadRoot(r9, Heap::kOnePointerFillerMapRootIndex); | 
| 499           // Fill the remaining fields with one pointer filler map. | 483           // Fill the remaining fields with one pointer filler map. | 
| 500 | 484 | 
| 501           __ bind(&no_inobject_slack_tracking); | 485           __ bind(&no_inobject_slack_tracking); | 
| 502         } | 486         } | 
| 503 | 487 | 
| 504         __ InitializeFieldsWithFiller(r8, r9, r10); | 488         __ InitializeFieldsWithFiller(r8, r6, r9); | 
| 505 | 489 | 
| 506         // Add the object tag to make the JSObject real, so that we can continue | 490         // Add the object tag to make the JSObject real, so that we can continue | 
| 507         // and jump into the continuation code at any time from now on. | 491         // and jump into the continuation code at any time from now on. | 
| 508         __ addi(r7, r7, Operand(kHeapObjectTag)); | 492         __ addi(r7, r7, Operand(kHeapObjectTag)); | 
| 509 | 493 | 
| 510         // Continue with JSObject being successfully allocated | 494         // Continue with JSObject being successfully allocated | 
| 511         // r7: JSObject | 495         // r7: JSObject | 
| 512         __ b(&allocated); | 496         __ b(&allocated); | 
| 513 | 497 | 
| 514         // Reload the new target and fall-through. | 498         // Reload the new target and fall-through. | 
| (...skipping 1364 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1879     __ bkpt(0); | 1863     __ bkpt(0); | 
| 1880   } | 1864   } | 
| 1881 } | 1865 } | 
| 1882 | 1866 | 
| 1883 | 1867 | 
| 1884 #undef __ | 1868 #undef __ | 
| 1885 }  // namespace internal | 1869 }  // namespace internal | 
| 1886 }  // namespace v8 | 1870 }  // namespace v8 | 
| 1887 | 1871 | 
| 1888 #endif  // V8_TARGET_ARCH_PPC | 1872 #endif  // V8_TARGET_ARCH_PPC | 
| OLD | NEW | 
|---|