OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 <stdlib.h> | 5 #include <stdlib.h> |
6 | 6 |
7 #include "src/v8.h" | 7 #include "src/v8.h" |
8 | 8 |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/scopeinfo.h" | 10 #include "src/scopeinfo.h" |
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 } | 557 } |
558 | 558 |
559 context_slot_cache->Update(scope_info, name, *mode, *location, | 559 context_slot_cache->Update(scope_info, name, *mode, *location, |
560 *init_flag, *maybe_assigned_flag, result); | 560 *init_flag, *maybe_assigned_flag, result); |
561 DCHECK(result < scope_info->ContextLength()); | 561 DCHECK(result < scope_info->ContextLength()); |
562 return result; | 562 return result; |
563 } | 563 } |
564 } | 564 } |
565 // Cache as not found. Mode, location, init flag and maybe assigned flag | 565 // Cache as not found. Mode, location, init flag and maybe assigned flag |
566 // don't matter. | 566 // don't matter. |
567 context_slot_cache->Update(scope_info, name, INTERNAL, | 567 context_slot_cache->Update(scope_info, name, TEMPORARY, |
568 VariableLocation::CONTEXT, kNeedsInitialization, | 568 VariableLocation::CONTEXT, kNeedsInitialization, |
569 kNotAssigned, -1); | 569 kNotAssigned, -1); |
570 } | 570 } |
571 return -1; | 571 return -1; |
572 } | 572 } |
573 | 573 |
574 | 574 |
575 int ScopeInfo::ParameterIndex(String* name) { | 575 int ScopeInfo::ParameterIndex(String* name) { |
576 DCHECK(name->IsInternalizedString()); | 576 DCHECK(name->IsInternalizedString()); |
577 if (length() > 0) { | 577 if (length() > 0) { |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
846 info->set_mode(i, var->mode()); | 846 info->set_mode(i, var->mode()); |
847 DCHECK(var->index() >= 0); | 847 DCHECK(var->index() >= 0); |
848 info->set_index(i, var->index()); | 848 info->set_index(i, var->index()); |
849 } | 849 } |
850 DCHECK(i == info->length()); | 850 DCHECK(i == info->length()); |
851 return info; | 851 return info; |
852 } | 852 } |
853 | 853 |
854 } // namespace internal | 854 } // namespace internal |
855 } // namespace v8 | 855 } // namespace v8 |
OLD | NEW |