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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 Label use_receiver, exit; | 376 Label use_receiver, exit; |
377 | 377 |
378 // If the result is a smi, it is *not* an object in the ECMA sense. | 378 // If the result is a smi, it is *not* an object in the ECMA sense. |
379 __ JumpIfSmi(eax, &use_receiver); | 379 __ JumpIfSmi(eax, &use_receiver); |
380 | 380 |
381 // If the type of the result (stored in its map) is less than | 381 // If the type of the result (stored in its map) is less than |
382 // FIRST_SPEC_OBJECT_TYPE, it is not an object in the ECMA sense. | 382 // FIRST_SPEC_OBJECT_TYPE, it is not an object in the ECMA sense. |
383 __ CmpObjectType(eax, FIRST_SPEC_OBJECT_TYPE, ecx); | 383 __ CmpObjectType(eax, FIRST_SPEC_OBJECT_TYPE, ecx); |
384 __ j(above_equal, &exit); | 384 __ j(above_equal, &exit); |
385 | 385 |
| 386 // Symbols are "objects". |
| 387 __ CmpInstanceType(ecx, SYMBOL_TYPE); |
| 388 __ j(equal, &exit); |
| 389 |
386 // Throw away the result of the constructor invocation and use the | 390 // Throw away the result of the constructor invocation and use the |
387 // on-stack receiver as the result. | 391 // on-stack receiver as the result. |
388 __ bind(&use_receiver); | 392 __ bind(&use_receiver); |
389 __ mov(eax, Operand(esp, 0)); | 393 __ mov(eax, Operand(esp, 0)); |
390 | 394 |
391 // Restore the arguments count and leave the construct frame. | 395 // Restore the arguments count and leave the construct frame. |
392 __ bind(&exit); | 396 __ bind(&exit); |
393 __ mov(ebx, Operand(esp, kPointerSize)); // Get arguments count. | 397 __ mov(ebx, Operand(esp, kPointerSize)); // Get arguments count. |
394 | 398 |
395 // Leave construct frame. | 399 // Leave construct frame. |
(...skipping 1428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1824 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); | 1828 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); |
1825 generator.Generate(); | 1829 generator.Generate(); |
1826 } | 1830 } |
1827 | 1831 |
1828 | 1832 |
1829 #undef __ | 1833 #undef __ |
1830 } | 1834 } |
1831 } // namespace v8::internal | 1835 } // namespace v8::internal |
1832 | 1836 |
1833 #endif // V8_TARGET_ARCH_IA32 | 1837 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |