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 <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "src/v8.h" | 9 #include "src/v8.h" |
10 | 10 |
(...skipping 3478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3489 next_block_id_(0), | 3489 next_block_id_(0), |
3490 entry_block_(NULL), | 3490 entry_block_(NULL), |
3491 blocks_(8, info->zone()), | 3491 blocks_(8, info->zone()), |
3492 values_(16, info->zone()), | 3492 values_(16, info->zone()), |
3493 phi_list_(NULL), | 3493 phi_list_(NULL), |
3494 uint32_instructions_(NULL), | 3494 uint32_instructions_(NULL), |
3495 osr_(NULL), | 3495 osr_(NULL), |
3496 info_(info), | 3496 info_(info), |
3497 zone_(info->zone()), | 3497 zone_(info->zone()), |
3498 is_recursive_(false), | 3498 is_recursive_(false), |
3499 this_has_uses_(false), | |
3500 use_optimistic_licm_(false), | 3499 use_optimistic_licm_(false), |
3501 depends_on_empty_array_proto_elements_(false), | 3500 depends_on_empty_array_proto_elements_(false), |
3502 type_change_checksum_(0), | 3501 type_change_checksum_(0), |
3503 maximum_environment_size_(0), | 3502 maximum_environment_size_(0), |
3504 no_side_effects_scope_count_(0), | 3503 no_side_effects_scope_count_(0), |
3505 disallow_adding_new_values_(false) { | 3504 disallow_adding_new_values_(false) { |
3506 if (info->IsStub()) { | 3505 if (info->IsStub()) { |
3507 CallInterfaceDescriptor descriptor = | 3506 CallInterfaceDescriptor descriptor = |
3508 info->code_stub()->GetCallInterfaceDescriptor(); | 3507 info->code_stub()->GetCallInterfaceDescriptor(); |
3509 start_environment_ = new (zone_) | 3508 start_environment_ = new (zone_) |
(...skipping 1885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5395 while (length-- > 0) { | 5394 while (length-- > 0) { |
5396 context = Add<HLoadNamedField>( | 5395 context = Add<HLoadNamedField>( |
5397 context, nullptr, | 5396 context, nullptr, |
5398 HObjectAccess::ForContextSlot(Context::PREVIOUS_INDEX)); | 5397 HObjectAccess::ForContextSlot(Context::PREVIOUS_INDEX)); |
5399 } | 5398 } |
5400 return context; | 5399 return context; |
5401 } | 5400 } |
5402 | 5401 |
5403 | 5402 |
5404 void HOptimizedGraphBuilder::VisitVariableProxy(VariableProxy* expr) { | 5403 void HOptimizedGraphBuilder::VisitVariableProxy(VariableProxy* expr) { |
5405 if (expr->is_this()) { | |
5406 graph()->MarkThisHasUses(); | |
5407 } | |
5408 | |
5409 DCHECK(!HasStackOverflow()); | 5404 DCHECK(!HasStackOverflow()); |
5410 DCHECK(current_block() != NULL); | 5405 DCHECK(current_block() != NULL); |
5411 DCHECK(current_block()->HasPredecessor()); | 5406 DCHECK(current_block()->HasPredecessor()); |
5412 Variable* variable = expr->var(); | 5407 Variable* variable = expr->var(); |
5413 switch (variable->location()) { | 5408 switch (variable->location()) { |
5414 case Variable::UNALLOCATED: { | 5409 case Variable::UNALLOCATED: { |
5415 if (IsLexicalVariableMode(variable->mode())) { | 5410 if (IsLexicalVariableMode(variable->mode())) { |
5416 // TODO(rossberg): should this be an DCHECK? | 5411 // TODO(rossberg): should this be an DCHECK? |
5417 return Bailout(kReferenceToGlobalLexicalVariable); | 5412 return Bailout(kReferenceToGlobalLexicalVariable); |
5418 } | 5413 } |
(...skipping 7715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13134 if (ShouldProduceTraceOutput()) { | 13129 if (ShouldProduceTraceOutput()) { |
13135 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13130 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
13136 } | 13131 } |
13137 | 13132 |
13138 #ifdef DEBUG | 13133 #ifdef DEBUG |
13139 graph_->Verify(false); // No full verify. | 13134 graph_->Verify(false); // No full verify. |
13140 #endif | 13135 #endif |
13141 } | 13136 } |
13142 | 13137 |
13143 } } // namespace v8::internal | 13138 } } // namespace v8::internal |
OLD | NEW |