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 3449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3460 // r7: undefined | 3460 // r7: undefined |
3461 __ CompareInstanceType(r2, r3, JS_FUNCTION_TYPE); | 3461 __ CompareInstanceType(r2, r3, JS_FUNCTION_TYPE); |
3462 __ Check(ne, "Function constructed by construct stub."); | 3462 __ Check(ne, "Function constructed by construct stub."); |
3463 #endif | 3463 #endif |
3464 | 3464 |
3465 // Now allocate the JSObject in new space. | 3465 // Now allocate the JSObject in new space. |
3466 // r0: argc | 3466 // r0: argc |
3467 // r1: constructor function | 3467 // r1: constructor function |
3468 // r2: initial map | 3468 // r2: initial map |
3469 // r7: undefined | 3469 // r7: undefined |
| 3470 ASSERT(function->has_initial_map()); |
3470 __ ldrb(r3, FieldMemOperand(r2, Map::kInstanceSizeOffset)); | 3471 __ ldrb(r3, FieldMemOperand(r2, Map::kInstanceSizeOffset)); |
| 3472 #ifdef DEBUG |
| 3473 int instance_size = function->initial_map()->instance_size(); |
| 3474 __ cmp(r3, Operand(instance_size >> kPointerSizeLog2)); |
| 3475 __ Check(eq, "Instance size of initial map changed."); |
| 3476 #endif |
3471 __ AllocateInNewSpace(r3, r4, r5, r6, &generic_stub_call, SIZE_IN_WORDS); | 3477 __ AllocateInNewSpace(r3, r4, r5, r6, &generic_stub_call, SIZE_IN_WORDS); |
3472 | 3478 |
3473 // Allocated the JSObject, now initialize the fields. Map is set to initial | 3479 // Allocated the JSObject, now initialize the fields. Map is set to initial |
3474 // map and properties and elements are set to empty fixed array. | 3480 // map and properties and elements are set to empty fixed array. |
3475 // r0: argc | 3481 // r0: argc |
3476 // r1: constructor function | 3482 // r1: constructor function |
3477 // r2: initial map | 3483 // r2: initial map |
3478 // r3: object size (in words) | 3484 // r3: object size (in words) |
3479 // r4: JSObject (not tagged) | 3485 // r4: JSObject (not tagged) |
3480 // r7: undefined | 3486 // r7: undefined |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3518 __ bind(&next); | 3524 __ bind(&next); |
3519 } else { | 3525 } else { |
3520 // Set the property to the constant value. | 3526 // Set the property to the constant value. |
3521 Handle<Object> constant(shared->GetThisPropertyAssignmentConstant(i)); | 3527 Handle<Object> constant(shared->GetThisPropertyAssignmentConstant(i)); |
3522 __ mov(r2, Operand(constant)); | 3528 __ mov(r2, Operand(constant)); |
3523 __ str(r2, MemOperand(r5, kPointerSize, PostIndex)); | 3529 __ str(r2, MemOperand(r5, kPointerSize, PostIndex)); |
3524 } | 3530 } |
3525 } | 3531 } |
3526 | 3532 |
3527 // Fill the unused in-object property fields with undefined. | 3533 // Fill the unused in-object property fields with undefined. |
3528 ASSERT(function->has_initial_map()); | |
3529 for (int i = shared->this_property_assignments_count(); | 3534 for (int i = shared->this_property_assignments_count(); |
3530 i < function->initial_map()->inobject_properties(); | 3535 i < function->initial_map()->inobject_properties(); |
3531 i++) { | 3536 i++) { |
3532 __ str(r7, MemOperand(r5, kPointerSize, PostIndex)); | 3537 __ str(r7, MemOperand(r5, kPointerSize, PostIndex)); |
3533 } | 3538 } |
3534 | 3539 |
3535 // r0: argc | 3540 // r0: argc |
3536 // r4: JSObject (not tagged) | 3541 // r4: JSObject (not tagged) |
3537 // Move argc to r1 and the JSObject to return to r0 and tag it. | 3542 // Move argc to r1 and the JSObject to return to r0 and tag it. |
3538 __ mov(r1, r0); | 3543 __ mov(r1, r0); |
(...skipping 1238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4777 __ Jump(ic_slow, RelocInfo::CODE_TARGET); | 4782 __ Jump(ic_slow, RelocInfo::CODE_TARGET); |
4778 } | 4783 } |
4779 } | 4784 } |
4780 | 4785 |
4781 | 4786 |
4782 #undef __ | 4787 #undef __ |
4783 | 4788 |
4784 } } // namespace v8::internal | 4789 } } // namespace v8::internal |
4785 | 4790 |
4786 #endif // V8_TARGET_ARCH_ARM | 4791 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |