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

Side by Side Diff: src/variables.cc

Issue 7187007: Merge arguments branch to bleeding edge (second try). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Undelete external-array test. Created 9 years, 6 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
« no previous file with comments | « src/variables.h ('k') | src/x64/code-stubs-x64.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 // 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 UNREACHABLE(); 50 UNREACHABLE();
51 return NULL; 51 return NULL;
52 } 52 }
53 53
54 54
55 Property* Variable::AsProperty() const { 55 Property* Variable::AsProperty() const {
56 return rewrite_ == NULL ? NULL : rewrite_->AsProperty(); 56 return rewrite_ == NULL ? NULL : rewrite_->AsProperty();
57 } 57 }
58 58
59 59
60 Slot* Variable::AsSlot() const { 60 Slot* Variable::AsSlot() const { return rewrite_; }
61 return rewrite_ == NULL ? NULL : rewrite_->AsSlot();
62 }
63 61
64 62
65 bool Variable::IsStackAllocated() const { 63 bool Variable::IsStackAllocated() const {
66 Slot* slot = AsSlot(); 64 return rewrite_ != NULL && rewrite_->IsStackAllocated();
67 return slot != NULL && slot->IsStackAllocated();
68 } 65 }
69 66
70 67
71 bool Variable::IsParameter() const { 68 bool Variable::IsParameter() const {
72 Slot* s = AsSlot(); 69 return rewrite_ != NULL && rewrite_->type() == Slot::PARAMETER;
73 return s != NULL && s->type() == Slot::PARAMETER;
74 } 70 }
75 71
76 72
77 bool Variable::IsStackLocal() const { 73 bool Variable::IsStackLocal() const {
78 Slot* s = AsSlot(); 74 return rewrite_ != NULL && rewrite_->type() == Slot::LOCAL;
79 return s != NULL && s->type() == Slot::LOCAL;
80 } 75 }
81 76
82 77
83 bool Variable::IsContextSlot() const { 78 bool Variable::IsContextSlot() const {
84 Slot* s = AsSlot(); 79 return rewrite_ != NULL && rewrite_->type() == Slot::CONTEXT;
85 return s != NULL && s->type() == Slot::CONTEXT;
86 } 80 }
87 81
88 82
89 Variable::Variable(Scope* scope, 83 Variable::Variable(Scope* scope,
90 Handle<String> name, 84 Handle<String> name,
91 Mode mode, 85 Mode mode,
92 bool is_valid_LHS, 86 bool is_valid_LHS,
93 Kind kind) 87 Kind kind)
94 : scope_(scope), 88 : scope_(scope),
95 name_(name), 89 name_(name),
96 mode_(mode), 90 mode_(mode),
97 kind_(kind), 91 kind_(kind),
98 local_if_not_shadowed_(NULL), 92 local_if_not_shadowed_(NULL),
99 rewrite_(NULL), 93 rewrite_(NULL),
100 is_valid_LHS_(is_valid_LHS), 94 is_valid_LHS_(is_valid_LHS),
101 is_accessed_from_inner_scope_(false), 95 is_accessed_from_inner_scope_(false),
102 is_used_(false) { 96 is_used_(false) {
103 // names must be canonicalized for fast equality checks 97 // names must be canonicalized for fast equality checks
104 ASSERT(name->IsSymbol()); 98 ASSERT(name->IsSymbol());
105 } 99 }
106 100
107 101
108 bool Variable::is_global() const { 102 bool Variable::is_global() const {
109 // Temporaries are never global, they must always be allocated in the 103 // Temporaries are never global, they must always be allocated in the
110 // activation frame. 104 // activation frame.
111 return mode_ != TEMPORARY && scope_ != NULL && scope_->is_global_scope(); 105 return mode_ != TEMPORARY && scope_ != NULL && scope_->is_global_scope();
112 } 106 }
113 107
114 } } // namespace v8::internal 108 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/variables.h ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698