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

Side by Side Diff: src/ia32/stub-cache-ia32.cc

Issue 59103005: Proper fix for the issue exposed by r17459 (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix ALL the casting confusion Created 7 years, 1 month 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/arm/stub-cache-arm.cc ('k') | src/ic.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 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 771 matching lines...) Expand 10 before | Expand all | Expand 10 after
782 __ bind(label); 782 __ bind(label);
783 __ mov(this->name(), Immediate(name)); 783 __ mov(this->name(), Immediate(name));
784 } 784 }
785 } 785 }
786 786
787 787
788 // Generate code to check that a global property cell is empty. Create 788 // Generate code to check that a global property cell is empty. Create
789 // the property cell at compilation time if no cell exists for the 789 // the property cell at compilation time if no cell exists for the
790 // property. 790 // property.
791 void StubCompiler::GenerateCheckPropertyCell(MacroAssembler* masm, 791 void StubCompiler::GenerateCheckPropertyCell(MacroAssembler* masm,
792 Handle<GlobalObject> global, 792 Handle<JSGlobalObject> global,
793 Handle<Name> name, 793 Handle<Name> name,
794 Register scratch, 794 Register scratch,
795 Label* miss) { 795 Label* miss) {
796 Handle<PropertyCell> cell = 796 Handle<PropertyCell> cell =
797 GlobalObject::EnsurePropertyCell(global, name); 797 JSGlobalObject::EnsurePropertyCell(global, name);
798 ASSERT(cell->value()->IsTheHole()); 798 ASSERT(cell->value()->IsTheHole());
799 Handle<Oddball> the_hole = masm->isolate()->factory()->the_hole_value(); 799 Handle<Oddball> the_hole = masm->isolate()->factory()->the_hole_value();
800 if (Serializer::enabled()) { 800 if (Serializer::enabled()) {
801 __ mov(scratch, Immediate(cell)); 801 __ mov(scratch, Immediate(cell));
802 __ cmp(FieldOperand(scratch, PropertyCell::kValueOffset), 802 __ cmp(FieldOperand(scratch, PropertyCell::kValueOffset),
803 Immediate(the_hole)); 803 Immediate(the_hole));
804 } else { 804 } else {
805 __ cmp(Operand::ForCell(cell), Immediate(the_hole)); 805 __ cmp(Operand::ForCell(cell), Immediate(the_hole));
806 } 806 }
807 __ j(not_equal, miss); 807 __ j(not_equal, miss);
808 } 808 }
809 809
810 810
811 void StoreStubCompiler::GenerateNegativeHolderLookup( 811 void StoreStubCompiler::GenerateNegativeHolderLookup(
812 MacroAssembler* masm, 812 MacroAssembler* masm,
813 Handle<JSObject> holder, 813 Handle<JSObject> holder,
814 Register holder_reg, 814 Register holder_reg,
815 Handle<Name> name, 815 Handle<Name> name,
816 Label* miss) { 816 Label* miss) {
817 if (holder->IsJSGlobalObject()) { 817 if (holder->IsJSGlobalObject()) {
818 GenerateCheckPropertyCell( 818 GenerateCheckPropertyCell(
819 masm, Handle<GlobalObject>::cast(holder), name, scratch1(), miss); 819 masm, Handle<JSGlobalObject>::cast(holder), name, scratch1(), miss);
820 } else if (!holder->HasFastProperties() && !holder->IsJSGlobalProxy()) { 820 } else if (!holder->HasFastProperties() && !holder->IsJSGlobalProxy()) {
821 GenerateDictionaryNegativeLookup( 821 GenerateDictionaryNegativeLookup(
822 masm, miss, holder_reg, name, scratch1(), scratch2()); 822 masm, miss, holder_reg, name, scratch1(), scratch2());
823 } 823 }
824 } 824 }
825 825
826 826
827 // Receiver_reg is preserved on jumps to miss_label, but may be destroyed if 827 // Receiver_reg is preserved on jumps to miss_label, but may be destroyed if
828 // store is successful. 828 // store is successful.
829 void StoreStubCompiler::GenerateStoreTransition(MacroAssembler* masm, 829 void StoreStubCompiler::GenerateStoreTransition(MacroAssembler* masm,
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
1119 1119
1120 1120
1121 void StubCompiler::GenerateCheckPropertyCells(MacroAssembler* masm, 1121 void StubCompiler::GenerateCheckPropertyCells(MacroAssembler* masm,
1122 Handle<JSObject> object, 1122 Handle<JSObject> object,
1123 Handle<JSObject> holder, 1123 Handle<JSObject> holder,
1124 Handle<Name> name, 1124 Handle<Name> name,
1125 Register scratch, 1125 Register scratch,
1126 Label* miss) { 1126 Label* miss) {
1127 Handle<JSObject> current = object; 1127 Handle<JSObject> current = object;
1128 while (!current.is_identical_to(holder)) { 1128 while (!current.is_identical_to(holder)) {
1129 if (current->IsGlobalObject()) { 1129 if (current->IsJSGlobalObject()) {
1130 GenerateCheckPropertyCell(masm, 1130 GenerateCheckPropertyCell(masm,
1131 Handle<GlobalObject>::cast(current), 1131 Handle<JSGlobalObject>::cast(current),
1132 name, 1132 name,
1133 scratch, 1133 scratch,
1134 miss); 1134 miss);
1135 } 1135 }
1136 current = Handle<JSObject>(JSObject::cast(current->GetPrototype())); 1136 current = Handle<JSObject>(JSObject::cast(current->GetPrototype()));
1137 } 1137 }
1138 } 1138 }
1139 1139
1140 1140
1141 void StubCompiler::GenerateTailCall(MacroAssembler* masm, Handle<Code> code) { 1141 void StubCompiler::GenerateTailCall(MacroAssembler* masm, Handle<Code> code) {
(...skipping 1874 matching lines...) Expand 10 before | Expand all | Expand 10 after
3016 // Return the generated code. 3016 // Return the generated code.
3017 return GetICCode( 3017 return GetICCode(
3018 kind(), Code::NORMAL, factory()->empty_string(), POLYMORPHIC); 3018 kind(), Code::NORMAL, factory()->empty_string(), POLYMORPHIC);
3019 } 3019 }
3020 3020
3021 3021
3022 Handle<Code> LoadStubCompiler::CompileLoadNonexistent( 3022 Handle<Code> LoadStubCompiler::CompileLoadNonexistent(
3023 Handle<JSObject> object, 3023 Handle<JSObject> object,
3024 Handle<JSObject> last, 3024 Handle<JSObject> last,
3025 Handle<Name> name, 3025 Handle<Name> name,
3026 Handle<GlobalObject> global) { 3026 Handle<JSGlobalObject> global) {
3027 Label success; 3027 Label success;
3028 3028
3029 NonexistentHandlerFrontend(object, last, name, &success, global); 3029 NonexistentHandlerFrontend(object, last, name, &success, global);
3030 3030
3031 __ bind(&success); 3031 __ bind(&success);
3032 // Return undefined if maps of the full prototype chain are still the 3032 // Return undefined if maps of the full prototype chain are still the
3033 // same and no global property with this name contains a value. 3033 // same and no global property with this name contains a value.
3034 __ mov(eax, isolate()->factory()->undefined_value()); 3034 __ mov(eax, isolate()->factory()->undefined_value());
3035 __ ret(0); 3035 __ ret(0);
3036 3036
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
3241 // ----------------------------------- 3241 // -----------------------------------
3242 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric); 3242 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric);
3243 } 3243 }
3244 3244
3245 3245
3246 #undef __ 3246 #undef __
3247 3247
3248 } } // namespace v8::internal 3248 } } // namespace v8::internal
3249 3249
3250 #endif // V8_TARGET_ARCH_IA32 3250 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/arm/stub-cache-arm.cc ('k') | src/ic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698