| 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 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 Label use_receiver, exit; | 409 Label use_receiver, exit; |
| 410 // If the result is a smi, it is *not* an object in the ECMA sense. | 410 // If the result is a smi, it is *not* an object in the ECMA sense. |
| 411 __ JumpIfSmi(rax, &use_receiver); | 411 __ JumpIfSmi(rax, &use_receiver); |
| 412 | 412 |
| 413 // If the type of the result (stored in its map) is less than | 413 // If the type of the result (stored in its map) is less than |
| 414 // FIRST_SPEC_OBJECT_TYPE, it is not an object in the ECMA sense. | 414 // FIRST_SPEC_OBJECT_TYPE, it is not an object in the ECMA sense. |
| 415 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE); | 415 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE); |
| 416 __ CmpObjectType(rax, FIRST_SPEC_OBJECT_TYPE, rcx); | 416 __ CmpObjectType(rax, FIRST_SPEC_OBJECT_TYPE, rcx); |
| 417 __ j(above_equal, &exit); | 417 __ j(above_equal, &exit); |
| 418 | 418 |
| 419 // Symbols are "objects". | |
| 420 __ CmpInstanceType(rcx, SYMBOL_TYPE); | |
| 421 __ j(equal, &exit); | |
| 422 | |
| 423 // Throw away the result of the constructor invocation and use the | 419 // Throw away the result of the constructor invocation and use the |
| 424 // on-stack receiver as the result. | 420 // on-stack receiver as the result. |
| 425 __ bind(&use_receiver); | 421 __ bind(&use_receiver); |
| 426 __ movq(rax, Operand(rsp, 0)); | 422 __ movq(rax, Operand(rsp, 0)); |
| 427 | 423 |
| 428 // Restore the arguments count and leave the construct frame. | 424 // Restore the arguments count and leave the construct frame. |
| 429 __ bind(&exit); | 425 __ bind(&exit); |
| 430 __ movq(rbx, Operand(rsp, kPointerSize)); // Get arguments count. | 426 __ movq(rbx, Operand(rsp, kPointerSize)); // Get arguments count. |
| 431 | 427 |
| 432 // Leave construct frame. | 428 // Leave construct frame. |
| (...skipping 1464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1897 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); | 1893 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); |
| 1898 generator.Generate(); | 1894 generator.Generate(); |
| 1899 } | 1895 } |
| 1900 | 1896 |
| 1901 | 1897 |
| 1902 #undef __ | 1898 #undef __ |
| 1903 | 1899 |
| 1904 } } // namespace v8::internal | 1900 } } // namespace v8::internal |
| 1905 | 1901 |
| 1906 #endif // V8_TARGET_ARCH_X64 | 1902 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |