| 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 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 __ bind(&rt_call); | 578 __ bind(&rt_call); |
| 579 // Allocate the new receiver object using the runtime call. | 579 // Allocate the new receiver object using the runtime call. |
| 580 // a1: constructor function | 580 // a1: constructor function |
| 581 __ push(a1); // Argument for Runtime_NewObject. | 581 __ push(a1); // Argument for Runtime_NewObject. |
| 582 __ CallRuntime(Runtime::kNewObject, 1); | 582 __ CallRuntime(Runtime::kNewObject, 1); |
| 583 __ mov(t4, v0); | 583 __ mov(t4, v0); |
| 584 | 584 |
| 585 // Receiver for constructor call allocated. | 585 // Receiver for constructor call allocated. |
| 586 // t4: JSObject | 586 // t4: JSObject |
| 587 __ bind(&allocated); | 587 __ bind(&allocated); |
| 588 __ push(t4); | 588 __ Push(t4, t4); |
| 589 __ push(t4); | |
| 590 | 589 |
| 591 // Reload the number of arguments from the stack. | 590 // Reload the number of arguments from the stack. |
| 592 // sp[0]: receiver | 591 // sp[0]: receiver |
| 593 // sp[1]: receiver | 592 // sp[1]: receiver |
| 594 // sp[2]: constructor function | 593 // sp[2]: constructor function |
| 595 // sp[3]: number of arguments (smi-tagged) | 594 // sp[3]: number of arguments (smi-tagged) |
| 596 __ lw(a1, MemOperand(sp, 2 * kPointerSize)); | 595 __ lw(a1, MemOperand(sp, 2 * kPointerSize)); |
| 597 __ lw(a3, MemOperand(sp, 3 * kPointerSize)); | 596 __ lw(a3, MemOperand(sp, 3 * kPointerSize)); |
| 598 | 597 |
| 599 // Set up pointer to last argument. | 598 // Set up pointer to last argument. |
| (...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1085 | 1084 |
| 1086 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE); | 1085 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE); |
| 1087 __ GetObjectType(a2, a3, a3); | 1086 __ GetObjectType(a2, a3, a3); |
| 1088 __ Branch(&shift_arguments, ge, a3, Operand(FIRST_SPEC_OBJECT_TYPE)); | 1087 __ Branch(&shift_arguments, ge, a3, Operand(FIRST_SPEC_OBJECT_TYPE)); |
| 1089 | 1088 |
| 1090 __ bind(&convert_to_object); | 1089 __ bind(&convert_to_object); |
| 1091 // Enter an internal frame in order to preserve argument count. | 1090 // Enter an internal frame in order to preserve argument count. |
| 1092 { | 1091 { |
| 1093 FrameScope scope(masm, StackFrame::INTERNAL); | 1092 FrameScope scope(masm, StackFrame::INTERNAL); |
| 1094 __ sll(a0, a0, kSmiTagSize); // Smi tagged. | 1093 __ sll(a0, a0, kSmiTagSize); // Smi tagged. |
| 1095 __ push(a0); | 1094 __ Push(a0, a2); |
| 1096 | |
| 1097 __ push(a2); | |
| 1098 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION); | 1095 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION); |
| 1099 __ mov(a2, v0); | 1096 __ mov(a2, v0); |
| 1100 | 1097 |
| 1101 __ pop(a0); | 1098 __ pop(a0); |
| 1102 __ sra(a0, a0, kSmiTagSize); // Un-tag. | 1099 __ sra(a0, a0, kSmiTagSize); // Un-tag. |
| 1103 // Leave internal frame. | 1100 // Leave internal frame. |
| 1104 } | 1101 } |
| 1105 // Restore the function to a1, and the flag to t0. | 1102 // Restore the function to a1, and the flag to t0. |
| 1106 __ sll(at, a0, kPointerSizeLog2); | 1103 __ sll(at, a0, kPointerSizeLog2); |
| 1107 __ addu(at, sp, at); | 1104 __ addu(at, sp, at); |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1237 __ Branch(&okay, gt, a2, Operand(t3)); // Signed comparison. | 1234 __ Branch(&okay, gt, a2, Operand(t3)); // Signed comparison. |
| 1238 | 1235 |
| 1239 // Out of stack space. | 1236 // Out of stack space. |
| 1240 __ lw(a1, MemOperand(fp, kFunctionOffset)); | 1237 __ lw(a1, MemOperand(fp, kFunctionOffset)); |
| 1241 __ Push(a1, v0); | 1238 __ Push(a1, v0); |
| 1242 __ InvokeBuiltin(Builtins::APPLY_OVERFLOW, CALL_FUNCTION); | 1239 __ InvokeBuiltin(Builtins::APPLY_OVERFLOW, CALL_FUNCTION); |
| 1243 // End of stack check. | 1240 // End of stack check. |
| 1244 | 1241 |
| 1245 // Push current limit and index. | 1242 // Push current limit and index. |
| 1246 __ bind(&okay); | 1243 __ bind(&okay); |
| 1247 __ push(v0); // Limit. | 1244 __ mov(a1, zero_reg); |
| 1248 __ mov(a1, zero_reg); // Initial index. | 1245 __ Push(v0, a1); // Limit and initial index. |
| 1249 __ push(a1); | |
| 1250 | 1246 |
| 1251 // Get the receiver. | 1247 // Get the receiver. |
| 1252 __ lw(a0, MemOperand(fp, kRecvOffset)); | 1248 __ lw(a0, MemOperand(fp, kRecvOffset)); |
| 1253 | 1249 |
| 1254 // Check that the function is a JS function (otherwise it must be a proxy). | 1250 // Check that the function is a JS function (otherwise it must be a proxy). |
| 1255 Label push_receiver; | 1251 Label push_receiver; |
| 1256 __ lw(a1, MemOperand(fp, kFunctionOffset)); | 1252 __ lw(a1, MemOperand(fp, kFunctionOffset)); |
| 1257 __ GetObjectType(a1, a2, a2); | 1253 __ GetObjectType(a1, a2, a2); |
| 1258 __ Branch(&push_receiver, ne, a2, Operand(JS_FUNCTION_TYPE)); | 1254 __ Branch(&push_receiver, ne, a2, Operand(JS_FUNCTION_TYPE)); |
| 1259 | 1255 |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1504 __ bind(&dont_adapt_arguments); | 1500 __ bind(&dont_adapt_arguments); |
| 1505 __ Jump(a3); | 1501 __ Jump(a3); |
| 1506 } | 1502 } |
| 1507 | 1503 |
| 1508 | 1504 |
| 1509 #undef __ | 1505 #undef __ |
| 1510 | 1506 |
| 1511 } } // namespace v8::internal | 1507 } } // namespace v8::internal |
| 1512 | 1508 |
| 1513 #endif // V8_TARGET_ARCH_MIPS | 1509 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |