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

Side by Side Diff: src/contexts-inl.h

Issue 2435023002: Use a different map to distinguish eval contexts (Closed)
Patch Set: relax dchecks Created 4 years, 1 month 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
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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 #ifndef V8_CONTEXTS_INL_H_ 5 #ifndef V8_CONTEXTS_INL_H_
6 #define V8_CONTEXTS_INL_H_ 6 #define V8_CONTEXTS_INL_H_
7 7
8 #include "src/contexts.h" 8 #include "src/contexts.h"
9 #include "src/objects-inl.h" 9 #include "src/objects-inl.h"
10 10
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 Map* map = this->map(); 111 Map* map = this->map();
112 return map == map->GetHeap()->block_context_map(); 112 return map == map->GetHeap()->block_context_map();
113 } 113 }
114 114
115 115
116 bool Context::IsModuleContext() { 116 bool Context::IsModuleContext() {
117 Map* map = this->map(); 117 Map* map = this->map();
118 return map == map->GetHeap()->module_context_map(); 118 return map == map->GetHeap()->module_context_map();
119 } 119 }
120 120
121 bool Context::IsEvalContext() {
122 Map* map = this->map();
123 return map == map->GetHeap()->eval_context_map();
124 }
121 125
122 bool Context::IsScriptContext() { 126 bool Context::IsScriptContext() {
123 Map* map = this->map(); 127 Map* map = this->map();
124 return map == map->GetHeap()->script_context_map(); 128 return map == map->GetHeap()->script_context_map();
125 } 129 }
126 130
127 131
128 bool Context::HasSameSecurityTokenAs(Context* that) { 132 bool Context::HasSameSecurityTokenAs(Context* that) {
129 return this->native_context()->security_token() == 133 return this->native_context()->security_token() ==
130 that->native_context()->security_token(); 134 that->native_context()->security_token();
(...skipping 14 matching lines...) Expand all
145 return type::cast(get(index)); \ 149 return type::cast(get(index)); \
146 } 150 }
147 NATIVE_CONTEXT_FIELDS(NATIVE_CONTEXT_FIELD_ACCESSORS) 151 NATIVE_CONTEXT_FIELDS(NATIVE_CONTEXT_FIELD_ACCESSORS)
148 #undef NATIVE_CONTEXT_FIELD_ACCESSORS 152 #undef NATIVE_CONTEXT_FIELD_ACCESSORS
149 153
150 154
151 } // namespace internal 155 } // namespace internal
152 } // namespace v8 156 } // namespace v8
153 157
154 #endif // V8_CONTEXTS_INL_H_ 158 #endif // V8_CONTEXTS_INL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698