| 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 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 Label use_receiver, exit; | 402 Label use_receiver, exit; |
| 403 | 403 |
| 404 // If the result is a smi, it is *not* an object in the ECMA sense. | 404 // If the result is a smi, it is *not* an object in the ECMA sense. |
| 405 __ JumpIfSmi(eax, &use_receiver); | 405 __ JumpIfSmi(eax, &use_receiver); |
| 406 | 406 |
| 407 // If the type of the result (stored in its map) is less than | 407 // If the type of the result (stored in its map) is less than |
| 408 // FIRST_SPEC_OBJECT_TYPE, it is not an object in the ECMA sense. | 408 // FIRST_SPEC_OBJECT_TYPE, it is not an object in the ECMA sense. |
| 409 __ CmpObjectType(eax, FIRST_SPEC_OBJECT_TYPE, ecx); | 409 __ CmpObjectType(eax, FIRST_SPEC_OBJECT_TYPE, ecx); |
| 410 __ j(above_equal, &exit); | 410 __ j(above_equal, &exit); |
| 411 | 411 |
| 412 // Symbols are "objects". | |
| 413 __ CmpInstanceType(ecx, SYMBOL_TYPE); | |
| 414 __ j(equal, &exit); | |
| 415 | |
| 416 // Throw away the result of the constructor invocation and use the | 412 // Throw away the result of the constructor invocation and use the |
| 417 // on-stack receiver as the result. | 413 // on-stack receiver as the result. |
| 418 __ bind(&use_receiver); | 414 __ bind(&use_receiver); |
| 419 __ mov(eax, Operand(esp, 0)); | 415 __ mov(eax, Operand(esp, 0)); |
| 420 | 416 |
| 421 // Restore the arguments count and leave the construct frame. | 417 // Restore the arguments count and leave the construct frame. |
| 422 __ bind(&exit); | 418 __ bind(&exit); |
| 423 __ mov(ebx, Operand(esp, kPointerSize)); // Get arguments count. | 419 __ mov(ebx, Operand(esp, kPointerSize)); // Get arguments count. |
| 424 | 420 |
| 425 // Leave construct frame. | 421 // Leave construct frame. |
| (...skipping 1451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1877 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); | 1873 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); |
| 1878 generator.Generate(); | 1874 generator.Generate(); |
| 1879 } | 1875 } |
| 1880 | 1876 |
| 1881 | 1877 |
| 1882 #undef __ | 1878 #undef __ |
| 1883 } | 1879 } |
| 1884 } // namespace v8::internal | 1880 } // namespace v8::internal |
| 1885 | 1881 |
| 1886 #endif // V8_TARGET_ARCH_IA32 | 1882 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |