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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 Label use_receiver, exit; | 382 Label use_receiver, exit; |
383 // If the result is a smi, it is *not* an object in the ECMA sense. | 383 // If the result is a smi, it is *not* an object in the ECMA sense. |
384 __ JumpIfSmi(rax, &use_receiver); | 384 __ JumpIfSmi(rax, &use_receiver); |
385 | 385 |
386 // If the type of the result (stored in its map) is less than | 386 // If the type of the result (stored in its map) is less than |
387 // FIRST_SPEC_OBJECT_TYPE, it is not an object in the ECMA sense. | 387 // FIRST_SPEC_OBJECT_TYPE, it is not an object in the ECMA sense. |
388 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE); | 388 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE); |
389 __ CmpObjectType(rax, FIRST_SPEC_OBJECT_TYPE, rcx); | 389 __ CmpObjectType(rax, FIRST_SPEC_OBJECT_TYPE, rcx); |
390 __ j(above_equal, &exit); | 390 __ j(above_equal, &exit); |
391 | 391 |
| 392 // Symbols are "objects". |
| 393 __ CmpInstanceType(rcx, SYMBOL_TYPE); |
| 394 __ j(equal, &exit); |
| 395 |
392 // Throw away the result of the constructor invocation and use the | 396 // Throw away the result of the constructor invocation and use the |
393 // on-stack receiver as the result. | 397 // on-stack receiver as the result. |
394 __ bind(&use_receiver); | 398 __ bind(&use_receiver); |
395 __ movq(rax, Operand(rsp, 0)); | 399 __ movq(rax, Operand(rsp, 0)); |
396 | 400 |
397 // Restore the arguments count and leave the construct frame. | 401 // Restore the arguments count and leave the construct frame. |
398 __ bind(&exit); | 402 __ bind(&exit); |
399 __ movq(rbx, Operand(rsp, kPointerSize)); // Get arguments count. | 403 __ movq(rbx, Operand(rsp, kPointerSize)); // Get arguments count. |
400 | 404 |
401 // Leave construct frame. | 405 // Leave construct frame. |
(...skipping 1433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1835 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); | 1839 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); |
1836 generator.Generate(); | 1840 generator.Generate(); |
1837 } | 1841 } |
1838 | 1842 |
1839 | 1843 |
1840 #undef __ | 1844 #undef __ |
1841 | 1845 |
1842 } } // namespace v8::internal | 1846 } } // namespace v8::internal |
1843 | 1847 |
1844 #endif // V8_TARGET_ARCH_X64 | 1848 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |