| 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 1112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1123 // sp[0]: receiver (newly allocated object) | 1123 // sp[0]: receiver (newly allocated object) |
| 1124 // sp[1]: constructor function | 1124 // sp[1]: constructor function |
| 1125 // sp[2]: number of arguments (smi-tagged) | 1125 // sp[2]: number of arguments (smi-tagged) |
| 1126 __ JumpIfSmi(v0, &use_receiver); | 1126 __ JumpIfSmi(v0, &use_receiver); |
| 1127 | 1127 |
| 1128 // If the type of the result (stored in its map) is less than | 1128 // If the type of the result (stored in its map) is less than |
| 1129 // FIRST_SPEC_OBJECT_TYPE, it is not an object in the ECMA sense. | 1129 // FIRST_SPEC_OBJECT_TYPE, it is not an object in the ECMA sense. |
| 1130 __ GetObjectType(v0, a1, a3); | 1130 __ GetObjectType(v0, a1, a3); |
| 1131 __ Branch(&exit, greater_equal, a3, Operand(FIRST_SPEC_OBJECT_TYPE)); | 1131 __ Branch(&exit, greater_equal, a3, Operand(FIRST_SPEC_OBJECT_TYPE)); |
| 1132 | 1132 |
| 1133 // Symbols are "objects". | |
| 1134 __ lbu(a3, FieldMemOperand(a1, Map::kInstanceTypeOffset)); | |
| 1135 __ Branch(&exit, eq, a3, Operand(SYMBOL_TYPE)); | |
| 1136 | |
| 1137 // Throw away the result of the constructor invocation and use the | 1133 // Throw away the result of the constructor invocation and use the |
| 1138 // on-stack receiver as the result. | 1134 // on-stack receiver as the result. |
| 1139 __ bind(&use_receiver); | 1135 __ bind(&use_receiver); |
| 1140 __ lw(v0, MemOperand(sp)); | 1136 __ lw(v0, MemOperand(sp)); |
| 1141 | 1137 |
| 1142 // Remove receiver from the stack, remove caller arguments, and | 1138 // Remove receiver from the stack, remove caller arguments, and |
| 1143 // return. | 1139 // return. |
| 1144 __ bind(&exit); | 1140 __ bind(&exit); |
| 1145 // v0: result | 1141 // v0: result |
| 1146 // sp[0]: receiver (newly allocated object) | 1142 // sp[0]: receiver (newly allocated object) |
| (...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1953 __ bind(&dont_adapt_arguments); | 1949 __ bind(&dont_adapt_arguments); |
| 1954 __ Jump(a3); | 1950 __ Jump(a3); |
| 1955 } | 1951 } |
| 1956 | 1952 |
| 1957 | 1953 |
| 1958 #undef __ | 1954 #undef __ |
| 1959 | 1955 |
| 1960 } } // namespace v8::internal | 1956 } } // namespace v8::internal |
| 1961 | 1957 |
| 1962 #endif // V8_TARGET_ARCH_MIPS | 1958 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |