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

Side by Side Diff: src/hydrogen.cc

Issue 14224009: Replace instance type check for polymorphic array.length with map check (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Remove spurious change Created 7 years, 8 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 6548 matching lines...) Expand 10 before | Expand all | Expand 10 after
6559 HValue* object, 6559 HValue* object,
6560 SmallMapList* types, 6560 SmallMapList* types,
6561 Handle<String> name) { 6561 Handle<String> name) {
6562 if (!name->Equals(isolate()->heap()->length_string())) return false; 6562 if (!name->Equals(isolate()->heap()->length_string())) return false;
6563 6563
6564 for (int i = 0; i < types->length(); i++) { 6564 for (int i = 0; i < types->length(); i++) {
6565 if (types->at(i)->instance_type() != JS_ARRAY_TYPE) return false; 6565 if (types->at(i)->instance_type() != JS_ARRAY_TYPE) return false;
6566 } 6566 }
6567 6567
6568 AddInstruction(new(zone()) HCheckNonSmi(object)); 6568 AddInstruction(new(zone()) HCheckNonSmi(object));
6569
6569 HInstruction* typecheck = 6570 HInstruction* typecheck =
6570 AddInstruction(HCheckInstanceType::NewIsJSArray(object, zone())); 6571 AddInstruction(new(zone()) HCheckMaps(object, types, zone()));
6571 HInstruction* instr = 6572 HInstruction* instr =
6572 HLoadNamedField::NewArrayLength(zone(), object, typecheck); 6573 HLoadNamedField::NewArrayLength(zone(), object, typecheck);
6573 instr->set_position(expr->position()); 6574 instr->set_position(expr->position());
6574 ast_context()->ReturnInstruction(instr, expr->id()); 6575 ast_context()->ReturnInstruction(instr, expr->id());
6575 return true; 6576 return true;
6576 } 6577 }
6577 6578
6578 6579
6579 void HOptimizedGraphBuilder::HandlePolymorphicLoadNamedField(Property* expr, 6580 void HOptimizedGraphBuilder::HandlePolymorphicLoadNamedField(Property* expr,
6580 HValue* object, 6581 HValue* object,
(...skipping 5085 matching lines...) Expand 10 before | Expand all | Expand 10 after
11666 } 11667 }
11667 } 11668 }
11668 11669
11669 #ifdef DEBUG 11670 #ifdef DEBUG
11670 if (graph_ != NULL) graph_->Verify(false); // No full verify. 11671 if (graph_ != NULL) graph_->Verify(false); // No full verify.
11671 if (allocator_ != NULL) allocator_->Verify(); 11672 if (allocator_ != NULL) allocator_->Verify();
11672 #endif 11673 #endif
11673 } 11674 }
11674 11675
11675 } } // namespace v8::internal 11676 } } // 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