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 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 // Fill all the in-object properties with appropriate filler. | 463 // Fill all the in-object properties with appropriate filler. |
464 // a1: constructor function | 464 // a1: constructor function |
465 // a2: initial map | 465 // a2: initial map |
466 // a3: object size (in words, including memento if create_memento) | 466 // a3: object size (in words, including memento if create_memento) |
467 // t4: JSObject (not tagged) | 467 // t4: JSObject (not tagged) |
468 // t5: First in-object property of JSObject (not tagged) | 468 // t5: First in-object property of JSObject (not tagged) |
469 ASSERT_EQ(3 * kPointerSize, JSObject::kHeaderSize); | 469 ASSERT_EQ(3 * kPointerSize, JSObject::kHeaderSize); |
470 | 470 |
471 if (count_constructions) { | 471 if (count_constructions) { |
472 __ LoadRoot(t7, Heap::kUndefinedValueRootIndex); | 472 __ LoadRoot(t7, Heap::kUndefinedValueRootIndex); |
473 __ lw(a0, FieldMemOperand(a2, Map::kInstanceSizesOffset)); | 473 __ lbu(a0, FieldMemOperand(a2, Map::kPreAllocatedPropertyFieldsOffset)); |
474 __ Ext(a0, a0, Map::kPreAllocatedPropertyFieldsByte * kBitsPerByte, | |
475 kBitsPerByte); | |
476 __ sll(at, a0, kPointerSizeLog2); | 474 __ sll(at, a0, kPointerSizeLog2); |
477 __ addu(a0, t5, at); | 475 __ addu(a0, t5, at); |
478 __ sll(at, a3, kPointerSizeLog2); | 476 __ sll(at, a3, kPointerSizeLog2); |
479 __ Addu(t6, t4, Operand(at)); // End of object. | 477 __ Addu(t6, t4, Operand(at)); // End of object. |
480 // a0: offset of first field after pre-allocated fields | 478 // a0: offset of first field after pre-allocated fields |
481 if (FLAG_debug_code) { | 479 if (FLAG_debug_code) { |
482 __ Assert(le, kUnexpectedNumberOfPreAllocatedPropertyFields, | 480 __ Assert(le, kUnexpectedNumberOfPreAllocatedPropertyFields, |
483 a0, Operand(t6)); | 481 a0, Operand(t6)); |
484 } | 482 } |
485 __ InitializeFieldsWithFiller(t5, a0, t7); | 483 __ InitializeFieldsWithFiller(t5, a0, t7); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 __ Addu(t4, t4, Operand(kHeapObjectTag)); | 516 __ Addu(t4, t4, Operand(kHeapObjectTag)); |
519 | 517 |
520 // Check if a non-empty properties array is needed. Continue with | 518 // Check if a non-empty properties array is needed. Continue with |
521 // allocated object if not fall through to runtime call if it is. | 519 // allocated object if not fall through to runtime call if it is. |
522 // a1: constructor function | 520 // a1: constructor function |
523 // t4: JSObject | 521 // t4: JSObject |
524 // t5: start of next object (not tagged) | 522 // t5: start of next object (not tagged) |
525 __ lbu(a3, FieldMemOperand(a2, Map::kUnusedPropertyFieldsOffset)); | 523 __ lbu(a3, FieldMemOperand(a2, Map::kUnusedPropertyFieldsOffset)); |
526 // The field instance sizes contains both pre-allocated property fields | 524 // The field instance sizes contains both pre-allocated property fields |
527 // and in-object properties. | 525 // and in-object properties. |
528 __ lw(a0, FieldMemOperand(a2, Map::kInstanceSizesOffset)); | 526 __ lbu(t6, FieldMemOperand(a2, Map::kPreAllocatedPropertyFieldsOffset)); |
529 __ Ext(t6, a0, Map::kPreAllocatedPropertyFieldsByte * kBitsPerByte, | |
530 kBitsPerByte); | |
531 __ Addu(a3, a3, Operand(t6)); | 527 __ Addu(a3, a3, Operand(t6)); |
532 __ Ext(t6, a0, Map::kInObjectPropertiesByte * kBitsPerByte, | 528 __ lbu(t6, FieldMemOperand(a2, Map::kInObjectPropertiesOffset)); |
533 kBitsPerByte); | |
534 __ subu(a3, a3, t6); | 529 __ subu(a3, a3, t6); |
535 | 530 |
536 // Done if no extra properties are to be allocated. | 531 // Done if no extra properties are to be allocated. |
537 __ Branch(&allocated, eq, a3, Operand(zero_reg)); | 532 __ Branch(&allocated, eq, a3, Operand(zero_reg)); |
538 __ Assert(greater_equal, kPropertyAllocationCountFailed, | 533 __ Assert(greater_equal, kPropertyAllocationCountFailed, |
539 a3, Operand(zero_reg)); | 534 a3, Operand(zero_reg)); |
540 | 535 |
541 // Scale the number of elements by pointer size and add the header for | 536 // Scale the number of elements by pointer size and add the header for |
542 // FixedArrays to the start of the next object calculation from above. | 537 // FixedArrays to the start of the next object calculation from above. |
543 // a1: constructor | 538 // a1: constructor |
(...skipping 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1569 __ bind(&dont_adapt_arguments); | 1564 __ bind(&dont_adapt_arguments); |
1570 __ Jump(a3); | 1565 __ Jump(a3); |
1571 } | 1566 } |
1572 | 1567 |
1573 | 1568 |
1574 #undef __ | 1569 #undef __ |
1575 | 1570 |
1576 } } // namespace v8::internal | 1571 } } // namespace v8::internal |
1577 | 1572 |
1578 #endif // V8_TARGET_ARCH_MIPS | 1573 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |