OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |