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 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1037 | 1037 |
1038 // If the result is a smi, it is *not* an object in the ECMA sense. | 1038 // If the result is a smi, it is *not* an object in the ECMA sense. |
1039 // r0: result | 1039 // r0: result |
1040 // sp[0]: receiver (newly allocated object) | 1040 // sp[0]: receiver (newly allocated object) |
1041 // sp[1]: constructor function | 1041 // sp[1]: constructor function |
1042 // sp[2]: number of arguments (smi-tagged) | 1042 // sp[2]: number of arguments (smi-tagged) |
1043 __ JumpIfSmi(r0, &use_receiver); | 1043 __ JumpIfSmi(r0, &use_receiver); |
1044 | 1044 |
1045 // If the type of the result (stored in its map) is less than | 1045 // If the type of the result (stored in its map) is less than |
1046 // FIRST_SPEC_OBJECT_TYPE, it is not an object in the ECMA sense. | 1046 // FIRST_SPEC_OBJECT_TYPE, it is not an object in the ECMA sense. |
1047 __ CompareObjectType(r0, r3, r3, FIRST_SPEC_OBJECT_TYPE); | 1047 __ CompareObjectType(r0, r1, r3, FIRST_SPEC_OBJECT_TYPE); |
1048 __ b(ge, &exit); | 1048 __ b(ge, &exit); |
1049 | 1049 |
| 1050 // Symbols are "objects". |
| 1051 __ CompareInstanceType(r1, r3, SYMBOL_TYPE); |
| 1052 __ b(eq, &exit); |
| 1053 |
1050 // Throw away the result of the constructor invocation and use the | 1054 // Throw away the result of the constructor invocation and use the |
1051 // on-stack receiver as the result. | 1055 // on-stack receiver as the result. |
1052 __ bind(&use_receiver); | 1056 __ bind(&use_receiver); |
1053 __ ldr(r0, MemOperand(sp)); | 1057 __ ldr(r0, MemOperand(sp)); |
1054 | 1058 |
1055 // Remove receiver from the stack, remove caller arguments, and | 1059 // Remove receiver from the stack, remove caller arguments, and |
1056 // return. | 1060 // return. |
1057 __ bind(&exit); | 1061 __ bind(&exit); |
1058 // r0: result | 1062 // r0: result |
1059 // sp[0]: receiver (newly allocated object) | 1063 // sp[0]: receiver (newly allocated object) |
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1850 __ bind(&dont_adapt_arguments); | 1854 __ bind(&dont_adapt_arguments); |
1851 __ Jump(r3); | 1855 __ Jump(r3); |
1852 } | 1856 } |
1853 | 1857 |
1854 | 1858 |
1855 #undef __ | 1859 #undef __ |
1856 | 1860 |
1857 } } // namespace v8::internal | 1861 } } // namespace v8::internal |
1858 | 1862 |
1859 #endif // V8_TARGET_ARCH_ARM | 1863 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |