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

Side by Side Diff: src/code-stubs-hydrogen.cc

Issue 19954005: Eliminate map checks of constant values. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Naming Created 7 years, 5 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/arm/lithium-codegen-arm.cc ('k') | src/flag-definitions.h » ('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 835 matching lines...) Expand 10 before | Expand all | Expand 10 after
846 Handle<Object> placeholer_value(Smi::FromInt(0), isolate()); 846 Handle<Object> placeholer_value(Smi::FromInt(0), isolate());
847 Handle<PropertyCell> placeholder_cell = 847 Handle<PropertyCell> placeholder_cell =
848 isolate()->factory()->NewPropertyCell(placeholer_value); 848 isolate()->factory()->NewPropertyCell(placeholer_value);
849 849
850 HParameter* receiver = GetParameter(0); 850 HParameter* receiver = GetParameter(0);
851 HParameter* value = GetParameter(2); 851 HParameter* value = GetParameter(2);
852 852
853 // Check that the map of the global has not changed: use a placeholder map 853 // Check that the map of the global has not changed: use a placeholder map
854 // that will be replaced later with the global object's map. 854 // that will be replaced later with the global object's map.
855 Handle<Map> placeholder_map = isolate()->factory()->meta_map(); 855 Handle<Map> placeholder_map = isolate()->factory()->meta_map();
856 AddInstruction(HCheckMaps::New(receiver, placeholder_map, zone())); 856 AddInstruction(HCheckMaps::New(
857 receiver, placeholder_map, zone(), top_info()));
857 858
858 HValue* cell = Add<HConstant>(placeholder_cell, Representation::Tagged()); 859 HValue* cell = Add<HConstant>(placeholder_cell, Representation::Tagged());
859 HObjectAccess access(HObjectAccess::ForCellPayload(isolate())); 860 HObjectAccess access(HObjectAccess::ForCellPayload(isolate()));
860 HValue* cell_contents = Add<HLoadNamedField>(cell, access); 861 HValue* cell_contents = Add<HLoadNamedField>(cell, access);
861 862
862 if (stub->is_constant()) { 863 if (stub->is_constant()) {
863 IfBuilder builder(this); 864 IfBuilder builder(this);
864 builder.If<HCompareObjectEqAndBranch>(cell_contents, value); 865 builder.If<HCompareObjectEqAndBranch>(cell_contents, value);
865 builder.Then(); 866 builder.Then();
866 builder.ElseDeopt(); 867 builder.ElseDeopt();
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
917 return value; 918 return value;
918 } 919 }
919 920
920 921
921 Handle<Code> ElementsTransitionAndStoreStub::GenerateCode() { 922 Handle<Code> ElementsTransitionAndStoreStub::GenerateCode() {
922 return DoGenerateCode(this); 923 return DoGenerateCode(this);
923 } 924 }
924 925
925 926
926 } } // namespace v8::internal 927 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698