| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/arguments.h" | 8 #include "src/arguments.h" |
| 9 #include "src/compiler.h" | 9 #include "src/compiler.h" |
| 10 #include "src/debug.h" | 10 #include "src/debug.h" |
| (...skipping 1457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1468 // Move to the next scope. | 1468 // Move to the next scope. |
| 1469 void Next() { | 1469 void Next() { |
| 1470 DCHECK(!failed_); | 1470 DCHECK(!failed_); |
| 1471 ScopeType scope_type = Type(); | 1471 ScopeType scope_type = Type(); |
| 1472 if (scope_type == ScopeTypeGlobal) { | 1472 if (scope_type == ScopeTypeGlobal) { |
| 1473 // The global scope is always the last in the chain. | 1473 // The global scope is always the last in the chain. |
| 1474 DCHECK(context_->IsNativeContext()); | 1474 DCHECK(context_->IsNativeContext()); |
| 1475 context_ = Handle<Context>(); | 1475 context_ = Handle<Context>(); |
| 1476 return; | 1476 return; |
| 1477 } | 1477 } |
| 1478 if (scope_type == ScopeTypeScript) { | 1478 if (scope_type == ScopeTypeScript) seen_script_scope_ = true; |
| 1479 seen_script_scope_ = true; | 1479 if (nested_scope_chain_.is_empty()) { |
| 1480 if (context_->IsScriptContext()) { | 1480 if (scope_type == ScopeTypeScript) { |
| 1481 if (context_->IsScriptContext()) { |
| 1482 context_ = Handle<Context>(context_->previous(), isolate_); |
| 1483 } |
| 1484 CHECK(context_->IsNativeContext()); |
| 1485 } else { |
| 1481 context_ = Handle<Context>(context_->previous(), isolate_); | 1486 context_ = Handle<Context>(context_->previous(), isolate_); |
| 1482 } | 1487 } |
| 1483 if (!nested_scope_chain_.is_empty()) { | |
| 1484 DCHECK_EQ(nested_scope_chain_.last()->scope_type(), SCRIPT_SCOPE); | |
| 1485 nested_scope_chain_.RemoveLast(); | |
| 1486 DCHECK(nested_scope_chain_.is_empty()); | |
| 1487 } | |
| 1488 CHECK(context_->IsNativeContext()); | |
| 1489 return; | |
| 1490 } | |
| 1491 if (nested_scope_chain_.is_empty()) { | |
| 1492 context_ = Handle<Context>(context_->previous(), isolate_); | |
| 1493 } else { | 1488 } else { |
| 1494 if (nested_scope_chain_.last()->HasContext()) { | 1489 if (nested_scope_chain_.last()->HasContext()) { |
| 1495 DCHECK(context_->previous() != NULL); | 1490 DCHECK(context_->previous() != NULL); |
| 1496 context_ = Handle<Context>(context_->previous(), isolate_); | 1491 context_ = Handle<Context>(context_->previous(), isolate_); |
| 1497 } | 1492 } |
| 1498 nested_scope_chain_.RemoveLast(); | 1493 nested_scope_chain_.RemoveLast(); |
| 1499 } | 1494 } |
| 1500 } | 1495 } |
| 1501 | 1496 |
| 1502 // Return the type of the current scope. | 1497 // Return the type of the current scope. |
| (...skipping 1659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3162 return Smi::FromInt(isolate->debug()->is_active()); | 3157 return Smi::FromInt(isolate->debug()->is_active()); |
| 3163 } | 3158 } |
| 3164 | 3159 |
| 3165 | 3160 |
| 3166 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) { | 3161 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) { |
| 3167 UNIMPLEMENTED(); | 3162 UNIMPLEMENTED(); |
| 3168 return NULL; | 3163 return NULL; |
| 3169 } | 3164 } |
| 3170 } | 3165 } |
| 3171 } // namespace v8::internal | 3166 } // namespace v8::internal |
| OLD | NEW |