| 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 3812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3823 return false; | 3823 return false; |
| 3824 } | 3824 } |
| 3825 | 3825 |
| 3826 HInstruction* result = NULL; | 3826 HInstruction* result = NULL; |
| 3827 if (expr->key()->IsPropertyName()) { | 3827 if (expr->key()->IsPropertyName()) { |
| 3828 Handle<String> name = expr->key()->AsLiteral()->AsPropertyName(); | 3828 Handle<String> name = expr->key()->AsLiteral()->AsPropertyName(); |
| 3829 if (!name->IsEqualTo(CStrVector("length"))) return false; | 3829 if (!name->IsEqualTo(CStrVector("length"))) return false; |
| 3830 HInstruction* elements = AddInstruction(new HArgumentsElements); | 3830 HInstruction* elements = AddInstruction(new HArgumentsElements); |
| 3831 result = new HArgumentsLength(elements); | 3831 result = new HArgumentsLength(elements); |
| 3832 } else { | 3832 } else { |
| 3833 Push(graph()->GetArgumentsObject()); |
| 3833 VisitForValue(expr->key()); | 3834 VisitForValue(expr->key()); |
| 3834 if (HasStackOverflow()) return false; | 3835 if (HasStackOverflow()) return false; |
| 3835 HValue* key = Pop(); | 3836 HValue* key = Pop(); |
| 3837 Drop(1); // Arguments object. |
| 3836 HInstruction* elements = AddInstruction(new HArgumentsElements); | 3838 HInstruction* elements = AddInstruction(new HArgumentsElements); |
| 3837 HInstruction* length = AddInstruction(new HArgumentsLength(elements)); | 3839 HInstruction* length = AddInstruction(new HArgumentsLength(elements)); |
| 3838 AddInstruction(new HBoundsCheck(key, length)); | 3840 AddInstruction(new HBoundsCheck(key, length)); |
| 3839 result = new HAccessArgumentsAt(elements, length, key); | 3841 result = new HAccessArgumentsAt(elements, length, key); |
| 3840 } | 3842 } |
| 3841 ast_context()->ReturnInstruction(result, expr->id()); | 3843 ast_context()->ReturnInstruction(result, expr->id()); |
| 3842 return true; | 3844 return true; |
| 3843 } | 3845 } |
| 3844 | 3846 |
| 3845 | 3847 |
| (...skipping 2260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6106 } | 6108 } |
| 6107 } | 6109 } |
| 6108 | 6110 |
| 6109 #ifdef DEBUG | 6111 #ifdef DEBUG |
| 6110 if (graph_ != NULL) graph_->Verify(); | 6112 if (graph_ != NULL) graph_->Verify(); |
| 6111 if (allocator_ != NULL) allocator_->Verify(); | 6113 if (allocator_ != NULL) allocator_->Verify(); |
| 6112 #endif | 6114 #endif |
| 6113 } | 6115 } |
| 6114 | 6116 |
| 6115 } } // namespace v8::internal | 6117 } } // namespace v8::internal |
| OLD | NEW |