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

Side by Side Diff: src/hydrogen.cc

Issue 150453003: Fix polymorphic load handling. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 5679 matching lines...) Expand 10 before | Expand all | Expand 10 after
5690 void HOptimizedGraphBuilder::HandlePolymorphicLoadNamedField( 5690 void HOptimizedGraphBuilder::HandlePolymorphicLoadNamedField(
5691 BailoutId ast_id, 5691 BailoutId ast_id,
5692 BailoutId return_id, 5692 BailoutId return_id,
5693 HValue* object, 5693 HValue* object,
5694 SmallMapList* types, 5694 SmallMapList* types,
5695 Handle<String> name) { 5695 Handle<String> name) {
5696 // Something did not match; must use a polymorphic load. 5696 // Something did not match; must use a polymorphic load.
5697 int count = 0; 5697 int count = 0;
5698 HBasicBlock* join = NULL; 5698 HBasicBlock* join = NULL;
5699 HBasicBlock* number_block = NULL; 5699 HBasicBlock* number_block = NULL;
5700 bool handled_string = false;
5700 5701
5701 bool handle_smi = false; 5702 bool handle_smi = false;
5702 for (int i = 0; i < types->length() && count < kMaxLoadPolymorphism; ++i) { 5703 for (int i = 0; i < types->length() && count < kMaxLoadPolymorphism; ++i) {
5703 PropertyAccessInfo info(this, IC::MapToType(types->at(i)), name); 5704 PropertyAccessInfo info(this, IC::MapToType(types->at(i)), name);
5705 if (info.type()->Is(HeapType::String())) {
5706 if (handled_string) continue;
5707 handled_string = true;
5708 }
5704 if (info.CanLoadMonomorphic()) { 5709 if (info.CanLoadMonomorphic()) {
5705 count++; 5710 count++;
5706 if (info.type()->Is(HeapType::Number())) { 5711 if (info.type()->Is(HeapType::Number())) {
5707 handle_smi = true; 5712 handle_smi = true;
5708 break; 5713 break;
5709 } 5714 }
5710 } 5715 }
5711 } 5716 }
5712 5717
5713 count = 0; 5718 count = 0;
5714 bool handled_string = false;
5715 HControlInstruction* smi_check = NULL; 5719 HControlInstruction* smi_check = NULL;
5720 handled_string = false;
5716 5721
5717 for (int i = 0; i < types->length() && count < kMaxLoadPolymorphism; ++i) { 5722 for (int i = 0; i < types->length() && count < kMaxLoadPolymorphism; ++i) {
5718 PropertyAccessInfo info(this, IC::MapToType(types->at(i)), name); 5723 PropertyAccessInfo info(this, IC::MapToType(types->at(i)), name);
5719 if (info.type()->Is(HeapType::String())) { 5724 if (info.type()->Is(HeapType::String())) {
5720 if (handled_string) continue; 5725 if (handled_string) continue;
5721 handled_string = true; 5726 handled_string = true;
5722 } 5727 }
5723 if (!info.CanLoadMonomorphic()) continue; 5728 if (!info.CanLoadMonomorphic()) continue;
5724 5729
5725 if (count == 0) { 5730 if (count == 0) {
(...skipping 5729 matching lines...) Expand 10 before | Expand all | Expand 10 after
11455 if (ShouldProduceTraceOutput()) { 11460 if (ShouldProduceTraceOutput()) {
11456 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 11461 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
11457 } 11462 }
11458 11463
11459 #ifdef DEBUG 11464 #ifdef DEBUG
11460 graph_->Verify(false); // No full verify. 11465 graph_->Verify(false); // No full verify.
11461 #endif 11466 #endif
11462 } 11467 }
11463 11468
11464 } } // namespace v8::internal 11469 } } // 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