| 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 581 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 592   { Label convert_to_object, use_global_receiver, patch_receiver; | 592   { Label convert_to_object, use_global_receiver, patch_receiver; | 
| 593     // Change context eagerly in case we need the global receiver. | 593     // Change context eagerly in case we need the global receiver. | 
| 594     __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset)); | 594     __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset)); | 
| 595 | 595 | 
| 596     // Do not transform the receiver for strict mode functions. | 596     // Do not transform the receiver for strict mode functions. | 
| 597     __ mov(ebx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); | 597     __ mov(ebx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); | 
| 598     __ test_b(FieldOperand(ebx, SharedFunctionInfo::kStrictModeByteOffset), | 598     __ test_b(FieldOperand(ebx, SharedFunctionInfo::kStrictModeByteOffset), | 
| 599               1 << SharedFunctionInfo::kStrictModeBitWithinByte); | 599               1 << SharedFunctionInfo::kStrictModeBitWithinByte); | 
| 600     __ j(not_equal, &shift_arguments); | 600     __ j(not_equal, &shift_arguments); | 
| 601 | 601 | 
| 602     // Do not transform the receiver for natives (shared already in ebx). |  | 
| 603     __ mov(ebx, FieldOperand(ebx, SharedFunctionInfo::kScriptOffset)); |  | 
| 604     __ cmp(ebx, factory->undefined_value()); |  | 
| 605     __ j(equal, &shift_arguments); |  | 
| 606     __ mov(ebx, FieldOperand(ebx, Script::kTypeOffset)); |  | 
| 607     __ SmiUntag(ebx); |  | 
| 608     __ cmp(ebx, Script::TYPE_NATIVE); |  | 
| 609     __ j(equal, &shift_arguments); |  | 
| 610 |  | 
| 611     // Compute the receiver in non-strict mode. | 602     // Compute the receiver in non-strict mode. | 
| 612     __ mov(ebx, Operand(esp, eax, times_4, 0));  // First argument. | 603     __ mov(ebx, Operand(esp, eax, times_4, 0));  // First argument. | 
| 613     __ test(ebx, Immediate(kSmiTagMask)); | 604     __ test(ebx, Immediate(kSmiTagMask)); | 
| 614     __ j(zero, &convert_to_object); | 605     __ j(zero, &convert_to_object); | 
| 615 | 606 | 
| 616     __ cmp(ebx, factory->null_value()); | 607     __ cmp(ebx, factory->null_value()); | 
| 617     __ j(equal, &use_global_receiver); | 608     __ j(equal, &use_global_receiver); | 
| 618     __ cmp(ebx, factory->undefined_value()); | 609     __ cmp(ebx, factory->undefined_value()); | 
| 619     __ j(equal, &use_global_receiver); | 610     __ j(equal, &use_global_receiver); | 
| 620 | 611 | 
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 757   // Compute the receiver. | 748   // Compute the receiver. | 
| 758   Label call_to_object, use_global_receiver, push_receiver; | 749   Label call_to_object, use_global_receiver, push_receiver; | 
| 759   __ mov(ebx, Operand(ebp, 3 * kPointerSize)); | 750   __ mov(ebx, Operand(ebp, 3 * kPointerSize)); | 
| 760 | 751 | 
| 761   // Do not transform the receiver for strict mode functions. | 752   // Do not transform the receiver for strict mode functions. | 
| 762   __ mov(ecx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); | 753   __ mov(ecx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); | 
| 763   __ test_b(FieldOperand(ecx, SharedFunctionInfo::kStrictModeByteOffset), | 754   __ test_b(FieldOperand(ecx, SharedFunctionInfo::kStrictModeByteOffset), | 
| 764             1 << SharedFunctionInfo::kStrictModeBitWithinByte); | 755             1 << SharedFunctionInfo::kStrictModeBitWithinByte); | 
| 765   __ j(not_equal, &push_receiver); | 756   __ j(not_equal, &push_receiver); | 
| 766 | 757 | 
| 767   Factory* factory = masm->isolate()->factory(); |  | 
| 768 |  | 
| 769   // Do not transform the receiver for natives (shared already in ecx). |  | 
| 770   __ mov(ecx, FieldOperand(ecx, SharedFunctionInfo::kScriptOffset)); |  | 
| 771   __ cmp(ecx, factory->undefined_value()); |  | 
| 772   __ j(equal, &push_receiver); |  | 
| 773   __ mov(ecx, FieldOperand(ecx, Script::kTypeOffset)); |  | 
| 774   __ SmiUntag(ecx); |  | 
| 775   __ cmp(ecx, Script::TYPE_NATIVE); |  | 
| 776   __ j(equal, &push_receiver); |  | 
| 777 |  | 
| 778   // Compute the receiver in non-strict mode. | 758   // Compute the receiver in non-strict mode. | 
| 779   __ test(ebx, Immediate(kSmiTagMask)); | 759   __ test(ebx, Immediate(kSmiTagMask)); | 
| 780   __ j(zero, &call_to_object); | 760   __ j(zero, &call_to_object); | 
|  | 761   Factory* factory = masm->isolate()->factory(); | 
| 781   __ cmp(ebx, factory->null_value()); | 762   __ cmp(ebx, factory->null_value()); | 
| 782   __ j(equal, &use_global_receiver); | 763   __ j(equal, &use_global_receiver); | 
| 783   __ cmp(ebx, factory->undefined_value()); | 764   __ cmp(ebx, factory->undefined_value()); | 
| 784   __ j(equal, &use_global_receiver); | 765   __ j(equal, &use_global_receiver); | 
| 785 | 766 | 
| 786   // If given receiver is already a JavaScript object then there's no | 767   // If given receiver is already a JavaScript object then there's no | 
| 787   // reason for converting it. | 768   // reason for converting it. | 
| 788   // We don't use IsObjectJSObjectType here because we jump on success. | 769   // We don't use IsObjectJSObjectType here because we jump on success. | 
| 789   __ mov(ecx, FieldOperand(ebx, HeapObject::kMapOffset)); | 770   __ mov(ecx, FieldOperand(ebx, HeapObject::kMapOffset)); | 
| 790   __ movzx_b(ecx, FieldOperand(ecx, Map::kInstanceTypeOffset)); | 771   __ movzx_b(ecx, FieldOperand(ecx, Map::kInstanceTypeOffset)); | 
| (...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1606   Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); | 1587   Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); | 
| 1607   generator.Generate(); | 1588   generator.Generate(); | 
| 1608 } | 1589 } | 
| 1609 | 1590 | 
| 1610 | 1591 | 
| 1611 #undef __ | 1592 #undef __ | 
| 1612 } | 1593 } | 
| 1613 }  // namespace v8::internal | 1594 }  // namespace v8::internal | 
| 1614 | 1595 | 
| 1615 #endif  // V8_TARGET_ARCH_IA32 | 1596 #endif  // V8_TARGET_ARCH_IA32 | 
| OLD | NEW | 
|---|