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 "hydrogen.h" | 5 #include "hydrogen.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "v8.h" | 9 #include "v8.h" |
10 #include "allocation-site-scopes.h" | 10 #include "allocation-site-scopes.h" |
(...skipping 10497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10508 ASSERT(globals_.is_empty()); | 10508 ASSERT(globals_.is_empty()); |
10509 AstVisitor::VisitDeclarations(declarations); | 10509 AstVisitor::VisitDeclarations(declarations); |
10510 if (!globals_.is_empty()) { | 10510 if (!globals_.is_empty()) { |
10511 Handle<FixedArray> array = | 10511 Handle<FixedArray> array = |
10512 isolate()->factory()->NewFixedArray(globals_.length(), TENURED); | 10512 isolate()->factory()->NewFixedArray(globals_.length(), TENURED); |
10513 for (int i = 0; i < globals_.length(); ++i) array->set(i, *globals_.at(i)); | 10513 for (int i = 0; i < globals_.length(); ++i) array->set(i, *globals_.at(i)); |
10514 int flags = DeclareGlobalsEvalFlag::encode(current_info()->is_eval()) | | 10514 int flags = DeclareGlobalsEvalFlag::encode(current_info()->is_eval()) | |
10515 DeclareGlobalsNativeFlag::encode(current_info()->is_native()) | | 10515 DeclareGlobalsNativeFlag::encode(current_info()->is_native()) | |
10516 DeclareGlobalsStrictMode::encode(current_info()->strict_mode()); | 10516 DeclareGlobalsStrictMode::encode(current_info()->strict_mode()); |
10517 Add<HDeclareGlobals>(array, flags); | 10517 Add<HDeclareGlobals>(array, flags); |
10518 globals_.Clear(); | 10518 globals_.Rewind(0); |
10519 } | 10519 } |
10520 } | 10520 } |
10521 | 10521 |
10522 | 10522 |
10523 void HOptimizedGraphBuilder::VisitVariableDeclaration( | 10523 void HOptimizedGraphBuilder::VisitVariableDeclaration( |
10524 VariableDeclaration* declaration) { | 10524 VariableDeclaration* declaration) { |
10525 VariableProxy* proxy = declaration->proxy(); | 10525 VariableProxy* proxy = declaration->proxy(); |
10526 VariableMode mode = declaration->mode(); | 10526 VariableMode mode = declaration->mode(); |
10527 Variable* variable = proxy->var(); | 10527 Variable* variable = proxy->var(); |
10528 bool hole_init = mode == LET || mode == CONST || mode == CONST_LEGACY; | 10528 bool hole_init = mode == LET || mode == CONST || mode == CONST_LEGACY; |
(...skipping 1266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11795 if (ShouldProduceTraceOutput()) { | 11795 if (ShouldProduceTraceOutput()) { |
11796 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 11796 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
11797 } | 11797 } |
11798 | 11798 |
11799 #ifdef DEBUG | 11799 #ifdef DEBUG |
11800 graph_->Verify(false); // No full verify. | 11800 graph_->Verify(false); // No full verify. |
11801 #endif | 11801 #endif |
11802 } | 11802 } |
11803 | 11803 |
11804 } } // namespace v8::internal | 11804 } } // namespace v8::internal |
OLD | NEW |