| 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 3435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3446 __ Branch(&generic_stub_call, ne, t0, Operand(MAP_TYPE)); | 3446 __ Branch(&generic_stub_call, ne, t0, Operand(MAP_TYPE)); |
| 3447 | 3447 |
| 3448 #ifdef DEBUG | 3448 #ifdef DEBUG |
| 3449 // Cannot construct functions this way. | 3449 // Cannot construct functions this way. |
| 3450 // a0: argc | 3450 // a0: argc |
| 3451 // a1: constructor function | 3451 // a1: constructor function |
| 3452 // a2: initial map | 3452 // a2: initial map |
| 3453 // t7: undefined | 3453 // t7: undefined |
| 3454 __ lbu(a3, FieldMemOperand(a2, Map::kInstanceTypeOffset)); | 3454 __ lbu(a3, FieldMemOperand(a2, Map::kInstanceTypeOffset)); |
| 3455 __ Check(ne, "Function constructed by construct stub.", | 3455 __ Check(ne, "Function constructed by construct stub.", |
| 3456 a3, Operand(JS_FUNCTION_TYPE)); | 3456 a3, Operand(JS_FUNCTION_TYPE)); |
| 3457 #endif | 3457 #endif |
| 3458 | 3458 |
| 3459 // Now allocate the JSObject in new space. | 3459 // Now allocate the JSObject in new space. |
| 3460 // a0: argc | 3460 // a0: argc |
| 3461 // a1: constructor function | 3461 // a1: constructor function |
| 3462 // a2: initial map | 3462 // a2: initial map |
| 3463 // t7: undefined | 3463 // t7: undefined |
| 3464 ASSERT(function->has_initial_map()); |
| 3464 __ lbu(a3, FieldMemOperand(a2, Map::kInstanceSizeOffset)); | 3465 __ lbu(a3, FieldMemOperand(a2, Map::kInstanceSizeOffset)); |
| 3466 #ifdef DEBUG |
| 3467 int instance_size = function->initial_map()->instance_size(); |
| 3468 __ Check(eq, "Instance size of initial map changed.", |
| 3469 a3, Operand(instance_size >> kPointerSizeLog2)); |
| 3470 #endif |
| 3465 __ AllocateInNewSpace(a3, t4, t5, t6, &generic_stub_call, SIZE_IN_WORDS); | 3471 __ AllocateInNewSpace(a3, t4, t5, t6, &generic_stub_call, SIZE_IN_WORDS); |
| 3466 | 3472 |
| 3467 // Allocated the JSObject, now initialize the fields. Map is set to initial | 3473 // Allocated the JSObject, now initialize the fields. Map is set to initial |
| 3468 // map and properties and elements are set to empty fixed array. | 3474 // map and properties and elements are set to empty fixed array. |
| 3469 // a0: argc | 3475 // a0: argc |
| 3470 // a1: constructor function | 3476 // a1: constructor function |
| 3471 // a2: initial map | 3477 // a2: initial map |
| 3472 // a3: object size (in words) | 3478 // a3: object size (in words) |
| 3473 // t4: JSObject (not tagged) | 3479 // t4: JSObject (not tagged) |
| 3474 // t7: undefined | 3480 // t7: undefined |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3517 } else { | 3523 } else { |
| 3518 // Set the property to the constant value. | 3524 // Set the property to the constant value. |
| 3519 Handle<Object> constant(shared->GetThisPropertyAssignmentConstant(i)); | 3525 Handle<Object> constant(shared->GetThisPropertyAssignmentConstant(i)); |
| 3520 __ li(a2, Operand(constant)); | 3526 __ li(a2, Operand(constant)); |
| 3521 __ sw(a2, MemOperand(t5)); | 3527 __ sw(a2, MemOperand(t5)); |
| 3522 __ Addu(t5, t5, kPointerSize); | 3528 __ Addu(t5, t5, kPointerSize); |
| 3523 } | 3529 } |
| 3524 } | 3530 } |
| 3525 | 3531 |
| 3526 // Fill the unused in-object property fields with undefined. | 3532 // Fill the unused in-object property fields with undefined. |
| 3527 ASSERT(function->has_initial_map()); | |
| 3528 for (int i = shared->this_property_assignments_count(); | 3533 for (int i = shared->this_property_assignments_count(); |
| 3529 i < function->initial_map()->inobject_properties(); | 3534 i < function->initial_map()->inobject_properties(); |
| 3530 i++) { | 3535 i++) { |
| 3531 __ sw(t7, MemOperand(t5)); | 3536 __ sw(t7, MemOperand(t5)); |
| 3532 __ Addu(t5, t5, kPointerSize); | 3537 __ Addu(t5, t5, kPointerSize); |
| 3533 } | 3538 } |
| 3534 | 3539 |
| 3535 // a0: argc | 3540 // a0: argc |
| 3536 // t4: JSObject (not tagged) | 3541 // t4: JSObject (not tagged) |
| 3537 // Move argc to a1 and the JSObject to return to v0 and tag it. | 3542 // Move argc to a1 and the JSObject to return to v0 and tag it. |
| (...skipping 1298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4836 __ Jump(ic_slow, RelocInfo::CODE_TARGET); | 4841 __ Jump(ic_slow, RelocInfo::CODE_TARGET); |
| 4837 } | 4842 } |
| 4838 } | 4843 } |
| 4839 | 4844 |
| 4840 | 4845 |
| 4841 #undef __ | 4846 #undef __ |
| 4842 | 4847 |
| 4843 } } // namespace v8::internal | 4848 } } // namespace v8::internal |
| 4844 | 4849 |
| 4845 #endif // V8_TARGET_ARCH_MIPS | 4850 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |