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

Side by Side Diff: src/hydrogen.cc

Issue 14890007: Don't CheckSmi when type is Smi. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 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 | « no previous file | no next file » | 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 1111 matching lines...) Expand 10 before | Expand all | Expand 10 after
1122 HValue* load_dependency, 1122 HValue* load_dependency,
1123 ElementsKind elements_kind, 1123 ElementsKind elements_kind,
1124 bool is_store, 1124 bool is_store,
1125 KeyedAccessStoreMode store_mode) { 1125 KeyedAccessStoreMode store_mode) {
1126 Zone* zone = this->zone(); 1126 Zone* zone = this->zone();
1127 if (is_store) { 1127 if (is_store) {
1128 ASSERT(val != NULL); 1128 ASSERT(val != NULL);
1129 switch (elements_kind) { 1129 switch (elements_kind) {
1130 case FAST_SMI_ELEMENTS: 1130 case FAST_SMI_ELEMENTS:
1131 case FAST_HOLEY_SMI_ELEMENTS: 1131 case FAST_HOLEY_SMI_ELEMENTS:
1132 // Smi-only arrays need a smi check. 1132 if (!val->type().IsSmi()) {
1133 AddInstruction(new(zone) HCheckSmi(val)); 1133 // Smi-only arrays need a smi check.
1134 AddInstruction(new(zone) HCheckSmi(val));
1135 }
1134 // Fall through. 1136 // Fall through.
1135 case FAST_ELEMENTS: 1137 case FAST_ELEMENTS:
1136 case FAST_HOLEY_ELEMENTS: 1138 case FAST_HOLEY_ELEMENTS:
1137 case FAST_DOUBLE_ELEMENTS: 1139 case FAST_DOUBLE_ELEMENTS:
1138 case FAST_HOLEY_DOUBLE_ELEMENTS: 1140 case FAST_HOLEY_DOUBLE_ELEMENTS:
1139 return new(zone) HStoreKeyed(elements, checked_key, val, elements_kind); 1141 return new(zone) HStoreKeyed(elements, checked_key, val, elements_kind);
1140 default: 1142 default:
1141 UNREACHABLE(); 1143 UNREACHABLE();
1142 return NULL; 1144 return NULL;
1143 } 1145 }
(...skipping 5783 matching lines...) Expand 10 before | Expand all | Expand 10 after
6927 6929
6928 elements = AddLoadElements(literal); 6930 elements = AddLoadElements(literal);
6929 6931
6930 HValue* key = AddInstruction( 6932 HValue* key = AddInstruction(
6931 new(zone()) HConstant(Handle<Object>(Smi::FromInt(i), isolate()), 6933 new(zone()) HConstant(Handle<Object>(Smi::FromInt(i), isolate()),
6932 Representation::Integer32())); 6934 Representation::Integer32()));
6933 6935
6934 switch (boilerplate_elements_kind) { 6936 switch (boilerplate_elements_kind) {
6935 case FAST_SMI_ELEMENTS: 6937 case FAST_SMI_ELEMENTS:
6936 case FAST_HOLEY_SMI_ELEMENTS: 6938 case FAST_HOLEY_SMI_ELEMENTS:
6937 // Smi-only arrays need a smi check. 6939 if (!value->type().IsSmi()) {
6938 AddInstruction(new(zone()) HCheckSmi(value)); 6940 // Smi-only arrays need a smi check.
6939 // Fall through. 6941 AddInstruction(new(zone()) HCheckSmi(value));
6942 // Fall through.
6943 }
6940 case FAST_ELEMENTS: 6944 case FAST_ELEMENTS:
6941 case FAST_HOLEY_ELEMENTS: 6945 case FAST_HOLEY_ELEMENTS:
6942 case FAST_DOUBLE_ELEMENTS: 6946 case FAST_DOUBLE_ELEMENTS:
6943 case FAST_HOLEY_DOUBLE_ELEMENTS: 6947 case FAST_HOLEY_DOUBLE_ELEMENTS:
6944 AddInstruction(new(zone()) HStoreKeyed( 6948 AddInstruction(new(zone()) HStoreKeyed(
6945 elements, 6949 elements,
6946 key, 6950 key,
6947 value, 6951 value,
6948 boilerplate_elements_kind)); 6952 boilerplate_elements_kind));
6949 break; 6953 break;
(...skipping 5416 matching lines...) Expand 10 before | Expand all | Expand 10 after
12366 } 12370 }
12367 } 12371 }
12368 12372
12369 #ifdef DEBUG 12373 #ifdef DEBUG
12370 if (graph_ != NULL) graph_->Verify(false); // No full verify. 12374 if (graph_ != NULL) graph_->Verify(false); // No full verify.
12371 if (allocator_ != NULL) allocator_->Verify(); 12375 if (allocator_ != NULL) allocator_->Verify();
12372 #endif 12376 #endif
12373 } 12377 }
12374 12378
12375 } } // namespace v8::internal 12379 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698