| 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/hydrogen.h" | 5 #include "src/hydrogen.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "src/v8.h" | 9 #include "src/v8.h" |
| 10 | 10 |
| (...skipping 7120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7131 HValue* HOptimizedGraphBuilder::HandleKeyedElementAccess( | 7131 HValue* HOptimizedGraphBuilder::HandleKeyedElementAccess( |
| 7132 HValue* obj, HValue* key, HValue* val, Expression* expr, | 7132 HValue* obj, HValue* key, HValue* val, Expression* expr, |
| 7133 BailoutId return_id, PropertyAccessType access_type, | 7133 BailoutId return_id, PropertyAccessType access_type, |
| 7134 bool* has_side_effects) { | 7134 bool* has_side_effects) { |
| 7135 if (key->ActualValue()->IsConstant()) { | 7135 if (key->ActualValue()->IsConstant()) { |
| 7136 Handle<Object> constant = | 7136 Handle<Object> constant = |
| 7137 HConstant::cast(key->ActualValue())->handle(isolate()); | 7137 HConstant::cast(key->ActualValue())->handle(isolate()); |
| 7138 uint32_t array_index; | 7138 uint32_t array_index; |
| 7139 if (constant->IsString() && | 7139 if (constant->IsString() && |
| 7140 !Handle<String>::cast(constant)->AsArrayIndex(&array_index)) { | 7140 !Handle<String>::cast(constant)->AsArrayIndex(&array_index)) { |
| 7141 if (!constant->IsUniqueName()) { |
| 7142 constant = isolate()->factory()->InternalizeString( |
| 7143 Handle<String>::cast(constant)); |
| 7144 } |
| 7141 HInstruction* instr = | 7145 HInstruction* instr = |
| 7142 BuildNamedAccess(access_type, expr->id(), return_id, expr, obj, | 7146 BuildNamedAccess(access_type, expr->id(), return_id, expr, obj, |
| 7143 Handle<String>::cast(constant), val, false); | 7147 Handle<String>::cast(constant), val, false); |
| 7144 if (instr == NULL || instr->IsLinked()) { | 7148 if (instr == NULL || instr->IsLinked()) { |
| 7145 *has_side_effects = false; | 7149 *has_side_effects = false; |
| 7146 } else { | 7150 } else { |
| 7147 AddInstruction(instr); | 7151 AddInstruction(instr); |
| 7148 *has_side_effects = instr->HasObservableSideEffects(); | 7152 *has_side_effects = instr->HasObservableSideEffects(); |
| 7149 } | 7153 } |
| 7150 return instr; | 7154 return instr; |
| (...skipping 5368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12519 if (ShouldProduceTraceOutput()) { | 12523 if (ShouldProduceTraceOutput()) { |
| 12520 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 12524 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 12521 } | 12525 } |
| 12522 | 12526 |
| 12523 #ifdef DEBUG | 12527 #ifdef DEBUG |
| 12524 graph_->Verify(false); // No full verify. | 12528 graph_->Verify(false); // No full verify. |
| 12525 #endif | 12529 #endif |
| 12526 } | 12530 } |
| 12527 | 12531 |
| 12528 } } // namespace v8::internal | 12532 } } // namespace v8::internal |
| OLD | NEW |