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

Side by Side Diff: src/variables.cc

Issue 7890031: Mark variables as being accessed from any inner scope, not only function scopes (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 bool is_valid_LHS, 59 bool is_valid_LHS,
60 Kind kind) 60 Kind kind)
61 : scope_(scope), 61 : scope_(scope),
62 name_(name), 62 name_(name),
63 mode_(mode), 63 mode_(mode),
64 kind_(kind), 64 kind_(kind),
65 location_(UNALLOCATED), 65 location_(UNALLOCATED),
66 index_(-1), 66 index_(-1),
67 local_if_not_shadowed_(NULL), 67 local_if_not_shadowed_(NULL),
68 is_valid_LHS_(is_valid_LHS), 68 is_valid_LHS_(is_valid_LHS),
69 is_accessed_from_inner_function_scope_(false), 69 is_accessed_from_inner_scope_(false),
70 is_used_(false) { 70 is_used_(false) {
71 // names must be canonicalized for fast equality checks 71 // names must be canonicalized for fast equality checks
72 ASSERT(name->IsSymbol()); 72 ASSERT(name->IsSymbol());
73 } 73 }
74 74
75 75
76 bool Variable::is_global() const { 76 bool Variable::is_global() const {
77 // Temporaries are never global, they must always be allocated in the 77 // Temporaries are never global, they must always be allocated in the
78 // activation frame. 78 // activation frame.
79 return mode_ != TEMPORARY && scope_ != NULL && scope_->is_global_scope(); 79 return mode_ != TEMPORARY && scope_ != NULL && scope_->is_global_scope();
80 } 80 }
81 81
82 } } // namespace v8::internal 82 } } // namespace v8::internal
OLDNEW
« src/scopes.cc ('K') | « src/variables.h ('k') | test/mjsunit/regress/regress-96523.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698