Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(335)

Side by Side Diff: src/ia32/ic-ia32.cc

Issue 6992072: Implement set trap for proxies, and revamp class hierarchy in preparation (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review. Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 // Holds the property dictionary on fall through. 71 // Holds the property dictionary on fall through.
72 // r1: used to hold receivers map. 72 // r1: used to hold receivers map.
73 73
74 // Check that the receiver isn't a smi. 74 // Check that the receiver isn't a smi.
75 __ test(receiver, Immediate(kSmiTagMask)); 75 __ test(receiver, Immediate(kSmiTagMask));
76 __ j(zero, miss); 76 __ j(zero, miss);
77 77
78 // Check that the receiver is a valid JS object. 78 // Check that the receiver is a valid JS object.
79 __ mov(r1, FieldOperand(receiver, HeapObject::kMapOffset)); 79 __ mov(r1, FieldOperand(receiver, HeapObject::kMapOffset));
80 __ movzx_b(r0, FieldOperand(r1, Map::kInstanceTypeOffset)); 80 __ movzx_b(r0, FieldOperand(r1, Map::kInstanceTypeOffset));
81 __ cmp(r0, FIRST_JS_OBJECT_TYPE); 81 __ cmp(r0, FIRST_SPEC_OBJECT_TYPE);
82 __ j(below, miss); 82 __ j(below, miss);
83 83
84 // If this assert fails, we have to check upper bound too. 84 // If this assert fails, we have to check upper bound too.
85 ASSERT(LAST_TYPE == JS_FUNCTION_TYPE); 85 STATIC_ASSERT(LAST_TYPE == LAST_SPEC_OBJECT_TYPE);
86 86
87 GenerateGlobalInstanceTypeCheck(masm, r0, miss); 87 GenerateGlobalInstanceTypeCheck(masm, r0, miss);
88 88
89 // Check for non-global object that requires access check. 89 // Check for non-global object that requires access check.
90 __ test_b(FieldOperand(r1, Map::kBitFieldOffset), 90 __ test_b(FieldOperand(r1, Map::kBitFieldOffset),
91 (1 << Map::kIsAccessCheckNeeded) | 91 (1 << Map::kIsAccessCheckNeeded) |
92 (1 << Map::kHasNamedInterceptor)); 92 (1 << Map::kHasNamedInterceptor));
93 __ j(not_zero, miss); 93 __ j(not_zero, miss);
94 94
95 __ mov(r0, FieldOperand(receiver, JSObject::kPropertiesOffset)); 95 __ mov(r0, FieldOperand(receiver, JSObject::kPropertiesOffset));
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 // Check that the receiver does not require access checks. We need 720 // Check that the receiver does not require access checks. We need
721 // to do this because this generic stub does not perform map checks. 721 // to do this because this generic stub does not perform map checks.
722 __ test_b(FieldOperand(edi, Map::kBitFieldOffset), 722 __ test_b(FieldOperand(edi, Map::kBitFieldOffset),
723 1 << Map::kIsAccessCheckNeeded); 723 1 << Map::kIsAccessCheckNeeded);
724 __ j(not_zero, &slow); 724 __ j(not_zero, &slow);
725 // Check that the key is a smi. 725 // Check that the key is a smi.
726 __ test(ecx, Immediate(kSmiTagMask)); 726 __ test(ecx, Immediate(kSmiTagMask));
727 __ j(not_zero, &slow); 727 __ j(not_zero, &slow);
728 __ CmpInstanceType(edi, JS_ARRAY_TYPE); 728 __ CmpInstanceType(edi, JS_ARRAY_TYPE);
729 __ j(equal, &array); 729 __ j(equal, &array);
730 // Check that the object is some kind of JS object. 730 // Check that the object is some kind of JSObject.
731 __ CmpInstanceType(edi, FIRST_JS_OBJECT_TYPE); 731 __ CmpInstanceType(edi, FIRST_JS_RECEIVER_TYPE);
732 __ j(below, &slow); 732 __ j(below, &slow);
733 __ CmpInstanceType(edi, JS_PROXY_TYPE);
734 __ j(equal, &slow);
735 __ CmpInstanceType(edi, JS_FUNCTION_PROXY_TYPE);
736 __ j(equal, &slow);
733 737
734 // Object case: Check key against length in the elements array. 738 // Object case: Check key against length in the elements array.
735 // eax: value 739 // eax: value
736 // edx: JSObject 740 // edx: JSObject
737 // ecx: key (a smi) 741 // ecx: key (a smi)
738 __ mov(edi, FieldOperand(edx, JSObject::kElementsOffset)); 742 __ mov(edi, FieldOperand(edx, JSObject::kElementsOffset));
739 // Check that the object is in fast mode and writable. 743 // Check that the object is in fast mode and writable.
740 __ CheckMap(edi, FACTORY->fixed_array_map(), &slow, DONT_DO_SMI_CHECK); 744 __ CheckMap(edi, FACTORY->fixed_array_map(), &slow, DONT_DO_SMI_CHECK);
741 __ cmp(ecx, FieldOperand(edi, FixedArray::kLengthOffset)); 745 __ cmp(ecx, FieldOperand(edi, FixedArray::kLengthOffset));
742 __ j(below, &fast); 746 __ j(below, &fast);
(...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after
1593 Condition cc = *jmp_address == Assembler::kJncShortOpcode 1597 Condition cc = *jmp_address == Assembler::kJncShortOpcode
1594 ? not_zero 1598 ? not_zero
1595 : zero; 1599 : zero;
1596 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); 1600 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc);
1597 } 1601 }
1598 1602
1599 1603
1600 } } // namespace v8::internal 1604 } } // namespace v8::internal
1601 1605
1602 #endif // V8_TARGET_ARCH_IA32 1606 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698