| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 | 356 |
| 357 // If the result is an object (in the ECMA sense), we should get rid | 357 // If the result is an object (in the ECMA sense), we should get rid |
| 358 // of the receiver and use the result; see ECMA-262 section 13.2.2-7 | 358 // of the receiver and use the result; see ECMA-262 section 13.2.2-7 |
| 359 // on page 74. | 359 // on page 74. |
| 360 Label use_receiver, exit; | 360 Label use_receiver, exit; |
| 361 // If the result is a smi, it is *not* an object in the ECMA sense. | 361 // If the result is a smi, it is *not* an object in the ECMA sense. |
| 362 __ JumpIfSmi(rax, &use_receiver); | 362 __ JumpIfSmi(rax, &use_receiver); |
| 363 | 363 |
| 364 // If the type of the result (stored in its map) is less than | 364 // If the type of the result (stored in its map) is less than |
| 365 // FIRST_SPEC_OBJECT_TYPE, it is not an object in the ECMA sense. | 365 // FIRST_SPEC_OBJECT_TYPE, it is not an object in the ECMA sense. |
| 366 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE); |
| 366 __ CmpObjectType(rax, FIRST_SPEC_OBJECT_TYPE, rcx); | 367 __ CmpObjectType(rax, FIRST_SPEC_OBJECT_TYPE, rcx); |
| 367 __ j(above_equal, &exit); | 368 __ j(above_equal, &exit); |
| 368 | 369 |
| 369 // Throw away the result of the constructor invocation and use the | 370 // Throw away the result of the constructor invocation and use the |
| 370 // on-stack receiver as the result. | 371 // on-stack receiver as the result. |
| 371 __ bind(&use_receiver); | 372 __ bind(&use_receiver); |
| 372 __ movq(rax, Operand(rsp, 0)); | 373 __ movq(rax, Operand(rsp, 0)); |
| 373 | 374 |
| 374 // Restore the arguments count and leave the construct frame. | 375 // Restore the arguments count and leave the construct frame. |
| 375 __ bind(&exit); | 376 __ bind(&exit); |
| (...skipping 1137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1513 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); | 1514 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); |
| 1514 generator.Generate(); | 1515 generator.Generate(); |
| 1515 } | 1516 } |
| 1516 | 1517 |
| 1517 | 1518 |
| 1518 #undef __ | 1519 #undef __ |
| 1519 | 1520 |
| 1520 } } // namespace v8::internal | 1521 } } // namespace v8::internal |
| 1521 | 1522 |
| 1522 #endif // V8_TARGET_ARCH_X64 | 1523 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |