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

Side by Side Diff: src/hydrogen-instructions.cc

Issue 57123002: Reland 21774: Generate KeyedLoadGeneric with Hydrogen (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Turn off by default Created 7 years 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
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 2641 matching lines...) Expand 10 before | Expand all | Expand 10 after
2652 bool HConstant::EmitAtUses() { 2652 bool HConstant::EmitAtUses() {
2653 ASSERT(IsLinked()); 2653 ASSERT(IsLinked());
2654 if (block()->graph()->has_osr() && 2654 if (block()->graph()->has_osr() &&
2655 block()->graph()->IsStandardConstant(this)) { 2655 block()->graph()->IsStandardConstant(this)) {
2656 // TODO(titzer): this seems like a hack that should be fixed by custom OSR. 2656 // TODO(titzer): this seems like a hack that should be fixed by custom OSR.
2657 return true; 2657 return true;
2658 } 2658 }
2659 if (UseCount() == 0) return true; 2659 if (UseCount() == 0) return true;
2660 if (IsCell()) return false; 2660 if (IsCell()) return false;
2661 if (representation().IsDouble()) return false; 2661 if (representation().IsDouble()) return false;
2662 if (representation().IsExternal()) return false;
2662 return true; 2663 return true;
2663 } 2664 }
2664 2665
2665 2666
2666 HConstant* HConstant::CopyToRepresentation(Representation r, Zone* zone) const { 2667 HConstant* HConstant::CopyToRepresentation(Representation r, Zone* zone) const {
2667 if (r.IsSmi() && !has_smi_value_) return NULL; 2668 if (r.IsSmi() && !has_smi_value_) return NULL;
2668 if (r.IsInteger32() && !has_int32_value_) return NULL; 2669 if (r.IsInteger32() && !has_int32_value_) return NULL;
2669 if (r.IsDouble() && !has_double_value_) return NULL; 2670 if (r.IsDouble() && !has_double_value_) return NULL;
2670 if (r.IsExternal() && !has_external_reference_value_) return NULL; 2671 if (r.IsExternal() && !has_external_reference_value_) return NULL;
2671 if (has_int32_value_) { 2672 if (has_int32_value_) {
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
3123 ASSERT(elements_kind() >= FIRST_EXTERNAL_ARRAY_ELEMENTS_KIND && 3124 ASSERT(elements_kind() >= FIRST_EXTERNAL_ARRAY_ELEMENTS_KIND &&
3124 elements_kind() <= LAST_EXTERNAL_ARRAY_ELEMENTS_KIND); 3125 elements_kind() <= LAST_EXTERNAL_ARRAY_ELEMENTS_KIND);
3125 elements()->PrintNameTo(stream); 3126 elements()->PrintNameTo(stream);
3126 stream->Add("."); 3127 stream->Add(".");
3127 stream->Add(ElementsKindToString(elements_kind())); 3128 stream->Add(ElementsKindToString(elements_kind()));
3128 } 3129 }
3129 3130
3130 stream->Add("["); 3131 stream->Add("[");
3131 key()->PrintNameTo(stream); 3132 key()->PrintNameTo(stream);
3132 if (IsDehoisted()) { 3133 if (IsDehoisted()) {
3133 stream->Add(" + %d]", index_offset()); 3134 stream->Add(" + %d]", base_offset());
3134 } else { 3135 } else {
3135 stream->Add("]"); 3136 stream->Add("]");
3136 } 3137 }
3137 3138
3138 if (HasDependency()) { 3139 if (HasDependency()) {
3139 stream->Add(" "); 3140 stream->Add(" ");
3140 dependency()->PrintNameTo(stream); 3141 dependency()->PrintNameTo(stream);
3141 } 3142 }
3142 3143
3143 if (RequiresHoleCheck()) { 3144 if (RequiresHoleCheck()) {
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
3224 HCheckMapValue::New(block()->graph()->zone(), 3225 HCheckMapValue::New(block()->graph()->zone(),
3225 block()->graph()->GetInvalidContext(), 3226 block()->graph()->GetInvalidContext(),
3226 object(), 3227 object(),
3227 names_cache->map()); 3228 names_cache->map());
3228 HInstruction* index = HLoadKeyed::New( 3229 HInstruction* index = HLoadKeyed::New(
3229 block()->graph()->zone(), 3230 block()->graph()->zone(),
3230 block()->graph()->GetInvalidContext(), 3231 block()->graph()->GetInvalidContext(),
3231 index_cache, 3232 index_cache,
3232 key_load->key(), 3233 key_load->key(),
3233 key_load->key(), 3234 key_load->key(),
3234 key_load->elements_kind()); 3235 key_load->elements_kind(),
Toon Verwaest 2013/12/04 17:29:26 Why is this the same elements kind as the array of
danno 2014/06/06 15:43:50 That's beyond the scope of this change, which itse
3236 NEVER_RETURN_HOLE,
3237 key_load->base_offset());
3235 map_check->InsertBefore(this); 3238 map_check->InsertBefore(this);
3236 index->InsertBefore(this); 3239 index->InsertBefore(this);
3237 HLoadFieldByIndex* load = new(block()->zone()) HLoadFieldByIndex( 3240 HInstruction* int_index = new(block()->zone()) HChange(
3238 object(), index); 3241 index, Representation::Integer32(), false, false);
3242 HChange::cast(int_index)->InsertBefore(this);
Toon Verwaest 2013/12/04 17:29:26 So this change is actually (or better, will be) su
danno 2014/06/06 15:43:50 This change is no longer necessary, after unrelate
3243 HLoadFieldByIndex* load =
3244 HLoadFieldByIndex::New(block()->graph()->zone(),
3245 block()->graph()->GetInvalidContext(),
3246 object(),
3247 int_index);
3239 load->InsertBefore(this); 3248 load->InsertBefore(this);
3240 return load; 3249 return load;
3241 } 3250 }
3242 } 3251 }
3243 } 3252 }
3244 3253
3245 return this; 3254 return this;
3246 } 3255 }
3247 3256
3248 3257
(...skipping 28 matching lines...) Expand all
3277 elements()->PrintNameTo(stream); 3286 elements()->PrintNameTo(stream);
3278 stream->Add("."); 3287 stream->Add(".");
3279 stream->Add(ElementsKindToString(elements_kind())); 3288 stream->Add(ElementsKindToString(elements_kind()));
3280 ASSERT(elements_kind() >= FIRST_EXTERNAL_ARRAY_ELEMENTS_KIND && 3289 ASSERT(elements_kind() >= FIRST_EXTERNAL_ARRAY_ELEMENTS_KIND &&
3281 elements_kind() <= LAST_EXTERNAL_ARRAY_ELEMENTS_KIND); 3290 elements_kind() <= LAST_EXTERNAL_ARRAY_ELEMENTS_KIND);
3282 } 3291 }
3283 3292
3284 stream->Add("["); 3293 stream->Add("[");
3285 key()->PrintNameTo(stream); 3294 key()->PrintNameTo(stream);
3286 if (IsDehoisted()) { 3295 if (IsDehoisted()) {
3287 stream->Add(" + %d] = ", index_offset()); 3296 stream->Add(" + %d] = ", base_offset());
3288 } else { 3297 } else {
3289 stream->Add("] = "); 3298 stream->Add("] = ");
3290 } 3299 }
3291 3300
3292 value()->PrintNameTo(stream); 3301 value()->PrintNameTo(stream);
3293 } 3302 }
3294 3303
3295 3304
3296 void HStoreKeyedGeneric::PrintDataTo(StringStream* stream) { 3305 void HStoreKeyedGeneric::PrintDataTo(StringStream* stream) {
3297 object()->PrintNameTo(stream); 3306 object()->PrintNameTo(stream);
(...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after
4413 break; 4422 break;
4414 case kExternalMemory: 4423 case kExternalMemory:
4415 stream->Add("[external-memory]"); 4424 stream->Add("[external-memory]");
4416 break; 4425 break;
4417 } 4426 }
4418 4427
4419 stream->Add("@%d", offset()); 4428 stream->Add("@%d", offset());
4420 } 4429 }
4421 4430
4422 } } // namespace v8::internal 4431 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698