| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1195 // Change context eagerly in case we need the global receiver. | 1195 // Change context eagerly in case we need the global receiver. |
| 1196 __ lw(cp, FieldMemOperand(a1, JSFunction::kContextOffset)); | 1196 __ lw(cp, FieldMemOperand(a1, JSFunction::kContextOffset)); |
| 1197 | 1197 |
| 1198 // Do not transform the receiver for strict mode functions. | 1198 // Do not transform the receiver for strict mode functions. |
| 1199 __ lw(a2, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); | 1199 __ lw(a2, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); |
| 1200 __ lw(a3, FieldMemOperand(a2, SharedFunctionInfo::kCompilerHintsOffset)); | 1200 __ lw(a3, FieldMemOperand(a2, SharedFunctionInfo::kCompilerHintsOffset)); |
| 1201 __ And(t0, a3, Operand(1 << (SharedFunctionInfo::kStrictModeFunction + | 1201 __ And(t0, a3, Operand(1 << (SharedFunctionInfo::kStrictModeFunction + |
| 1202 kSmiTagSize))); | 1202 kSmiTagSize))); |
| 1203 __ Branch(&shift_arguments, ne, t0, Operand(zero_reg)); | 1203 __ Branch(&shift_arguments, ne, t0, Operand(zero_reg)); |
| 1204 | 1204 |
| 1205 // Do not transform the receiver for native (shared already in r2). | 1205 // Do not transform the receiver for native (Compilerhints already in a3). |
| 1206 __ lw(a2, FieldMemOperand(a2, SharedFunctionInfo::kScriptOffset)); | 1206 __ And(t0, a3, Operand(1 << (SharedFunctionInfo::kES5Native + |
| 1207 __ LoadRoot(a3, Heap::kUndefinedValueRootIndex); | 1207 kSmiTagSize))); |
| 1208 __ Branch(&shift_arguments, eq, a2, Operand(a3)); | 1208 __ Branch(&shift_arguments, ne, t0, Operand(zero_reg)); |
| 1209 __ lw(a2, FieldMemOperand(a2, Script::kTypeOffset)); | |
| 1210 __ sra(a2, a2, kSmiTagSize); | |
| 1211 __ Branch(&shift_arguments, eq, a2, Operand(Script::TYPE_NATIVE)); | |
| 1212 | 1209 |
| 1213 // Compute the receiver in non-strict mode. | 1210 // Compute the receiver in non-strict mode. |
| 1214 // Load first argument in a2. a2 = -kPointerSize(sp + n_args << 2). | 1211 // Load first argument in a2. a2 = -kPointerSize(sp + n_args << 2). |
| 1215 __ sll(at, a0, kPointerSizeLog2); | 1212 __ sll(at, a0, kPointerSizeLog2); |
| 1216 __ addu(a2, sp, at); | 1213 __ addu(a2, sp, at); |
| 1217 __ lw(a2, MemOperand(a2, -kPointerSize)); | 1214 __ lw(a2, MemOperand(a2, -kPointerSize)); |
| 1218 // a0: actual number of arguments | 1215 // a0: actual number of arguments |
| 1219 // a1: function | 1216 // a1: function |
| 1220 // a2: first argument | 1217 // a2: first argument |
| 1221 __ JumpIfSmi(a2, &convert_to_object, t2); | 1218 __ JumpIfSmi(a2, &convert_to_object, t2); |
| 1222 | 1219 |
| 1223 // Heap::kUndefinedValueRootIndex is already in a3. | 1220 __ LoadRoot(a3, Heap::kUndefinedValueRootIndex); |
| 1224 __ Branch(&use_global_receiver, eq, a2, Operand(a3)); | 1221 __ Branch(&use_global_receiver, eq, a2, Operand(a3)); |
| 1225 __ LoadRoot(a3, Heap::kNullValueRootIndex); | 1222 __ LoadRoot(a3, Heap::kNullValueRootIndex); |
| 1226 __ Branch(&use_global_receiver, eq, a2, Operand(a3)); | 1223 __ Branch(&use_global_receiver, eq, a2, Operand(a3)); |
| 1227 | 1224 |
| 1228 __ GetObjectType(a2, a3, a3); | 1225 __ GetObjectType(a2, a3, a3); |
| 1229 __ Branch(&convert_to_object, lt, a3, Operand(FIRST_JS_OBJECT_TYPE)); | 1226 __ Branch(&convert_to_object, lt, a3, Operand(FIRST_JS_OBJECT_TYPE)); |
| 1230 __ Branch(&shift_arguments, le, a3, Operand(LAST_JS_OBJECT_TYPE)); | 1227 __ Branch(&shift_arguments, le, a3, Operand(LAST_JS_OBJECT_TYPE)); |
| 1231 | 1228 |
| 1232 __ bind(&convert_to_object); | 1229 __ bind(&convert_to_object); |
| 1233 __ EnterInternalFrame(); // In order to preserve argument count. | 1230 __ EnterInternalFrame(); // In order to preserve argument count. |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1382 // Compute the receiver. | 1379 // Compute the receiver. |
| 1383 Label call_to_object, use_global_receiver, push_receiver; | 1380 Label call_to_object, use_global_receiver, push_receiver; |
| 1384 __ lw(a0, MemOperand(fp, kRecvOffset)); | 1381 __ lw(a0, MemOperand(fp, kRecvOffset)); |
| 1385 | 1382 |
| 1386 // Do not transform the receiver for strict mode functions. | 1383 // Do not transform the receiver for strict mode functions. |
| 1387 __ lw(a2, FieldMemOperand(a1, SharedFunctionInfo::kCompilerHintsOffset)); | 1384 __ lw(a2, FieldMemOperand(a1, SharedFunctionInfo::kCompilerHintsOffset)); |
| 1388 __ And(t0, a2, Operand(1 << (SharedFunctionInfo::kStrictModeFunction + | 1385 __ And(t0, a2, Operand(1 << (SharedFunctionInfo::kStrictModeFunction + |
| 1389 kSmiTagSize))); | 1386 kSmiTagSize))); |
| 1390 __ Branch(&push_receiver, ne, t0, Operand(zero_reg)); | 1387 __ Branch(&push_receiver, ne, t0, Operand(zero_reg)); |
| 1391 | 1388 |
| 1392 // Do not transform the receiver for native (shared already in a1). | 1389 // Do not transform the receiver for native (Compilerhints already in a2). |
| 1393 __ lw(a1, FieldMemOperand(a1, SharedFunctionInfo::kScriptOffset)); | 1390 __ And(t0, a2, Operand(1 << (SharedFunctionInfo::kES5Native + |
| 1394 __ LoadRoot(a2, Heap::kUndefinedValueRootIndex); | 1391 kSmiTagSize))); |
| 1395 __ Branch(&push_receiver, eq, a1, Operand(a2)); | 1392 __ Branch(&push_receiver, ne, t0, Operand(zero_reg)); |
| 1396 __ lw(a1, FieldMemOperand(a1, Script::kTypeOffset)); | |
| 1397 __ sra(a1, a1, kSmiTagSize); | |
| 1398 __ Branch(&push_receiver, eq, a1, Operand(Script::TYPE_NATIVE)); | |
| 1399 | 1393 |
| 1400 // Compute the receiver in non-strict mode. | 1394 // Compute the receiver in non-strict mode. |
| 1401 __ And(t0, a0, Operand(kSmiTagMask)); | 1395 __ And(t0, a0, Operand(kSmiTagMask)); |
| 1402 __ Branch(&call_to_object, eq, t0, Operand(zero_reg)); | 1396 __ Branch(&call_to_object, eq, t0, Operand(zero_reg)); |
| 1403 __ LoadRoot(a1, Heap::kNullValueRootIndex); | 1397 __ LoadRoot(a1, Heap::kNullValueRootIndex); |
| 1404 __ Branch(&use_global_receiver, eq, a0, Operand(a1)); | 1398 __ Branch(&use_global_receiver, eq, a0, Operand(a1)); |
| 1405 // Heap::kUndefinedValueRootIndex is already in a2. | 1399 __ LoadRoot(a2, Heap::kUndefinedValueRootIndex); |
| 1406 __ Branch(&use_global_receiver, eq, a0, Operand(a2)); | 1400 __ Branch(&use_global_receiver, eq, a0, Operand(a2)); |
| 1407 | 1401 |
| 1408 // Check if the receiver is already a JavaScript object. | 1402 // Check if the receiver is already a JavaScript object. |
| 1409 // a0: receiver | 1403 // a0: receiver |
| 1410 __ GetObjectType(a0, a1, a1); | 1404 __ GetObjectType(a0, a1, a1); |
| 1411 __ Branch(&call_to_object, lt, a1, Operand(FIRST_JS_OBJECT_TYPE)); | 1405 __ Branch(&call_to_object, lt, a1, Operand(FIRST_JS_OBJECT_TYPE)); |
| 1412 __ Branch(&push_receiver, le, a1, Operand(LAST_JS_OBJECT_TYPE)); | 1406 __ Branch(&push_receiver, le, a1, Operand(LAST_JS_OBJECT_TYPE)); |
| 1413 | 1407 |
| 1414 // Convert the receiver to a regular object. | 1408 // Convert the receiver to a regular object. |
| 1415 // a0: receiver | 1409 // a0: receiver |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1609 __ bind(&dont_adapt_arguments); | 1603 __ bind(&dont_adapt_arguments); |
| 1610 __ Jump(a3); | 1604 __ Jump(a3); |
| 1611 } | 1605 } |
| 1612 | 1606 |
| 1613 | 1607 |
| 1614 #undef __ | 1608 #undef __ |
| 1615 | 1609 |
| 1616 } } // namespace v8::internal | 1610 } } // namespace v8::internal |
| 1617 | 1611 |
| 1618 #endif // V8_TARGET_ARCH_MIPS | 1612 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |