Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(597)

Side by Side Diff: src/ast/variables.cc

Issue 2272293004: Simply use the variable index to put them into the right ScopeInfo slot rather than sorting (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: also add info in the right order, interleaved with adding names Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/ast/variables.h ('k') | src/debug/liveedit.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "src/ast/variables.h" 5 #include "src/ast/variables.h"
6 6
7 #include "src/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/globals.h" 8 #include "src/globals.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 59
60 bool Variable::IsStaticGlobalObjectProperty() const { 60 bool Variable::IsStaticGlobalObjectProperty() const {
61 // Temporaries are never global, they must always be allocated in the 61 // Temporaries are never global, they must always be allocated in the
62 // activation frame. 62 // activation frame.
63 return (IsDeclaredVariableMode(mode_) && !IsLexicalVariableMode(mode_)) && 63 return (IsDeclaredVariableMode(mode_) && !IsLexicalVariableMode(mode_)) &&
64 scope_ != NULL && scope_->is_script_scope(); 64 scope_ != NULL && scope_->is_script_scope();
65 } 65 }
66 66
67 67
68 int Variable::CompareIndex(Variable* const* v, Variable* const* w) {
69 int x = (*v)->index();
70 int y = (*w)->index();
71 // Consider sorting them according to type as well?
72 return x - y;
73 }
74
75 } // namespace internal 68 } // namespace internal
76 } // namespace v8 69 } // namespace v8
OLDNEW
« no previous file with comments | « src/ast/variables.h ('k') | src/debug/liveedit.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698