OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 3748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3759 | 3759 |
3760 VISIT_FOR_VALUE(expr->obj()); | 3760 VISIT_FOR_VALUE(expr->obj()); |
3761 | 3761 |
3762 HInstruction* instr = NULL; | 3762 HInstruction* instr = NULL; |
3763 if (expr->IsArrayLength()) { | 3763 if (expr->IsArrayLength()) { |
3764 HValue* array = Pop(); | 3764 HValue* array = Pop(); |
3765 AddInstruction(new HCheckNonSmi(array)); | 3765 AddInstruction(new HCheckNonSmi(array)); |
3766 AddInstruction(new HCheckInstanceType(array, JS_ARRAY_TYPE, JS_ARRAY_TYPE)); | 3766 AddInstruction(new HCheckInstanceType(array, JS_ARRAY_TYPE, JS_ARRAY_TYPE)); |
3767 instr = new HJSArrayLength(array); | 3767 instr = new HJSArrayLength(array); |
3768 | 3768 |
| 3769 } else if (expr->IsStringLength()) { |
| 3770 HValue* string = Pop(); |
| 3771 AddInstruction(new HCheckNonSmi(string)); |
| 3772 AddInstruction(new HCheckInstanceType(string, |
| 3773 FIRST_STRING_TYPE, |
| 3774 LAST_STRING_TYPE)); |
| 3775 instr = new HStringLength(string); |
| 3776 |
3769 } else if (expr->IsFunctionPrototype()) { | 3777 } else if (expr->IsFunctionPrototype()) { |
3770 HValue* function = Pop(); | 3778 HValue* function = Pop(); |
3771 AddInstruction(new HCheckNonSmi(function)); | 3779 AddInstruction(new HCheckNonSmi(function)); |
3772 instr = new HLoadFunctionPrototype(function); | 3780 instr = new HLoadFunctionPrototype(function); |
3773 | 3781 |
3774 } else if (expr->key()->IsPropertyName()) { | 3782 } else if (expr->key()->IsPropertyName()) { |
3775 Handle<String> name = expr->key()->AsLiteral()->AsPropertyName(); | 3783 Handle<String> name = expr->key()->AsLiteral()->AsPropertyName(); |
3776 ZoneMapList* types = expr->GetReceiverTypes(); | 3784 ZoneMapList* types = expr->GetReceiverTypes(); |
3777 | 3785 |
3778 HValue* obj = Pop(); | 3786 HValue* obj = Pop(); |
(...skipping 2087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5866 } | 5874 } |
5867 } | 5875 } |
5868 | 5876 |
5869 #ifdef DEBUG | 5877 #ifdef DEBUG |
5870 if (graph_ != NULL) graph_->Verify(); | 5878 if (graph_ != NULL) graph_->Verify(); |
5871 if (allocator_ != NULL) allocator_->Verify(); | 5879 if (allocator_ != NULL) allocator_->Verify(); |
5872 #endif | 5880 #endif |
5873 } | 5881 } |
5874 | 5882 |
5875 } } // namespace v8::internal | 5883 } } // namespace v8::internal |
OLD | NEW |