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

Side by Side Diff: src/x64/ic-x64.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/x64/full-codegen-x64.cc ('k') | src/x64/lithium-codegen-x64.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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 // receiver: holds the receiver on entry and is unchanged. 69 // receiver: holds the receiver on entry and is unchanged.
70 // r0: used to hold receiver instance type. 70 // r0: used to hold receiver instance type.
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 __ JumpIfSmi(receiver, miss); 74 __ JumpIfSmi(receiver, miss);
75 75
76 // Check that the receiver is a valid JS object. 76 // Check that the receiver is a valid JS object.
77 __ movq(r1, FieldOperand(receiver, HeapObject::kMapOffset)); 77 __ movq(r1, FieldOperand(receiver, HeapObject::kMapOffset));
78 __ movb(r0, FieldOperand(r1, Map::kInstanceTypeOffset)); 78 __ movb(r0, FieldOperand(r1, Map::kInstanceTypeOffset));
79 __ cmpb(r0, Immediate(FIRST_JS_OBJECT_TYPE)); 79 __ cmpb(r0, Immediate(FIRST_SPEC_OBJECT_TYPE));
80 __ j(below, miss); 80 __ j(below, miss);
81 81
82 // If this assert fails, we have to check upper bound too. 82 // If this assert fails, we have to check upper bound too.
83 ASSERT(LAST_TYPE == JS_FUNCTION_TYPE); 83 STATIC_ASSERT(LAST_TYPE == LAST_SPEC_OBJECT_TYPE);
84 84
85 GenerateGlobalInstanceTypeCheck(masm, r0, miss); 85 GenerateGlobalInstanceTypeCheck(masm, r0, miss);
86 86
87 // Check for non-global object that requires access check. 87 // Check for non-global object that requires access check.
88 __ testb(FieldOperand(r1, Map::kBitFieldOffset), 88 __ testb(FieldOperand(r1, Map::kBitFieldOffset),
89 Immediate((1 << Map::kIsAccessCheckNeeded) | 89 Immediate((1 << Map::kIsAccessCheckNeeded) |
90 (1 << Map::kHasNamedInterceptor))); 90 (1 << Map::kHasNamedInterceptor)));
91 __ j(not_zero, miss); 91 __ j(not_zero, miss);
92 92
93 __ movq(r0, FieldOperand(receiver, JSObject::kPropertiesOffset)); 93 __ movq(r0, FieldOperand(receiver, JSObject::kPropertiesOffset));
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 // to do this because this generic stub does not perform map checks. 723 // to do this because this generic stub does not perform map checks.
724 __ testb(FieldOperand(rbx, Map::kBitFieldOffset), 724 __ testb(FieldOperand(rbx, Map::kBitFieldOffset),
725 Immediate(1 << Map::kIsAccessCheckNeeded)); 725 Immediate(1 << Map::kIsAccessCheckNeeded));
726 __ j(not_zero, &slow_with_tagged_index); 726 __ j(not_zero, &slow_with_tagged_index);
727 // Check that the key is a smi. 727 // Check that the key is a smi.
728 __ JumpIfNotSmi(rcx, &slow_with_tagged_index); 728 __ JumpIfNotSmi(rcx, &slow_with_tagged_index);
729 __ SmiToInteger32(rcx, rcx); 729 __ SmiToInteger32(rcx, rcx);
730 730
731 __ CmpInstanceType(rbx, JS_ARRAY_TYPE); 731 __ CmpInstanceType(rbx, JS_ARRAY_TYPE);
732 __ j(equal, &array); 732 __ j(equal, &array);
733 // Check that the object is some kind of JS object. 733 // Check that the object is some kind of JSObject.
734 __ CmpInstanceType(rbx, FIRST_JS_OBJECT_TYPE); 734 __ CmpInstanceType(rbx, FIRST_JS_RECEIVER_TYPE);
735 __ j(below, &slow); 735 __ j(below, &slow);
736 __ CmpInstanceType(rbx, JS_PROXY_TYPE);
737 __ j(equal, &slow);
738 __ CmpInstanceType(rbx, JS_FUNCTION_PROXY_TYPE);
739 __ j(equal, &slow);
736 740
737 // Object case: Check key against length in the elements array. 741 // Object case: Check key against length in the elements array.
738 // rax: value 742 // rax: value
739 // rdx: JSObject 743 // rdx: JSObject
740 // rcx: index 744 // rcx: index
741 __ movq(rbx, FieldOperand(rdx, JSObject::kElementsOffset)); 745 __ movq(rbx, FieldOperand(rdx, JSObject::kElementsOffset));
742 // Check that the object is in fast mode and writable. 746 // Check that the object is in fast mode and writable.
743 __ CompareRoot(FieldOperand(rbx, HeapObject::kMapOffset), 747 __ CompareRoot(FieldOperand(rbx, HeapObject::kMapOffset),
744 Heap::kFixedArrayMapRootIndex); 748 Heap::kFixedArrayMapRootIndex);
745 __ j(not_equal, &slow); 749 __ j(not_equal, &slow);
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after
1602 Condition cc = *jmp_address == Assembler::kJncShortOpcode 1606 Condition cc = *jmp_address == Assembler::kJncShortOpcode
1603 ? not_zero 1607 ? not_zero
1604 : zero; 1608 : zero;
1605 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); 1609 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc);
1606 } 1610 }
1607 1611
1608 1612
1609 } } // namespace v8::internal 1613 } } // namespace v8::internal
1610 1614
1611 #endif // V8_TARGET_ARCH_X64 1615 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/full-codegen-x64.cc ('k') | src/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698