| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/crankshaft/hydrogen.h" | 5 #include "src/crankshaft/hydrogen.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 | 8 |
| 9 #include "src/allocation-site-scopes.h" | 9 #include "src/allocation-site-scopes.h" |
| 10 #include "src/ast-numbering.h" | 10 #include "src/ast-numbering.h" |
| (...skipping 7858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7869 ValueContext for_value(this, ARGUMENTS_NOT_ALLOWED); | 7869 ValueContext for_value(this, ARGUMENTS_NOT_ALLOWED); |
| 7870 Push(object); | 7870 Push(object); |
| 7871 if (key != NULL) Push(key); | 7871 if (key != NULL) Push(key); |
| 7872 BuildLoad(expr, expr->LoadId()); | 7872 BuildLoad(expr, expr->LoadId()); |
| 7873 } | 7873 } |
| 7874 | 7874 |
| 7875 | 7875 |
| 7876 void HOptimizedGraphBuilder::BuildLoad(Property* expr, | 7876 void HOptimizedGraphBuilder::BuildLoad(Property* expr, |
| 7877 BailoutId ast_id) { | 7877 BailoutId ast_id) { |
| 7878 HInstruction* instr = NULL; | 7878 HInstruction* instr = NULL; |
| 7879 if (expr->IsStringAccess()) { | 7879 if (expr->IsStringAccess() && expr->GetKeyType() == ELEMENT) { |
| 7880 HValue* index = Pop(); | 7880 HValue* index = Pop(); |
| 7881 HValue* string = Pop(); | 7881 HValue* string = Pop(); |
| 7882 HInstruction* char_code = BuildStringCharCodeAt(string, index); | 7882 HInstruction* char_code = BuildStringCharCodeAt(string, index); |
| 7883 AddInstruction(char_code); | 7883 AddInstruction(char_code); |
| 7884 instr = NewUncasted<HStringCharFromCode>(char_code); | 7884 instr = NewUncasted<HStringCharFromCode>(char_code); |
| 7885 | 7885 |
| 7886 } else if (expr->key()->IsPropertyName()) { | 7886 } else if (expr->key()->IsPropertyName()) { |
| 7887 Handle<String> name = expr->key()->AsLiteral()->AsPropertyName(); | 7887 Handle<String> name = expr->key()->AsLiteral()->AsPropertyName(); |
| 7888 HValue* object = Pop(); | 7888 HValue* object = Pop(); |
| 7889 | 7889 |
| (...skipping 5740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13630 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13630 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 13631 } | 13631 } |
| 13632 | 13632 |
| 13633 #ifdef DEBUG | 13633 #ifdef DEBUG |
| 13634 graph_->Verify(false); // No full verify. | 13634 graph_->Verify(false); // No full verify. |
| 13635 #endif | 13635 #endif |
| 13636 } | 13636 } |
| 13637 | 13637 |
| 13638 } // namespace internal | 13638 } // namespace internal |
| 13639 } // namespace v8 | 13639 } // namespace v8 |
| OLD | NEW |