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

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

Issue 1406113007: Merge GlobalObject with JSGlobalObject. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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
« no previous file with comments | « src/contexts.cc ('k') | src/crankshaft/arm/lithium-codegen-arm.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 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 bool Context::has_extension() { return extension() != nullptr; } 59 bool Context::has_extension() { return extension() != nullptr; }
60 Object* Context::extension() { return get(EXTENSION_INDEX); } 60 Object* Context::extension() { return get(EXTENSION_INDEX); }
61 void Context::set_extension(Object* object) { set(EXTENSION_INDEX, object); } 61 void Context::set_extension(Object* object) { set(EXTENSION_INDEX, object); }
62 62
63 63
64 JSModule* Context::module() { return JSModule::cast(get(EXTENSION_INDEX)); } 64 JSModule* Context::module() { return JSModule::cast(get(EXTENSION_INDEX)); }
65 void Context::set_module(JSModule* module) { set(EXTENSION_INDEX, module); } 65 void Context::set_module(JSModule* module) { set(EXTENSION_INDEX, module); }
66 66
67 67
68 GlobalObject* Context::global_object() { 68 JSGlobalObject* Context::global_object() {
69 Object* result = get(GLOBAL_OBJECT_INDEX); 69 Object* result = get(GLOBAL_OBJECT_INDEX);
70 DCHECK(IsBootstrappingOrGlobalObject(this->GetIsolate(), result)); 70 DCHECK(IsBootstrappingOrGlobalObject(this->GetIsolate(), result));
71 return reinterpret_cast<GlobalObject*>(result); 71 return reinterpret_cast<JSGlobalObject*>(result);
72 } 72 }
73 73
74 74
75 void Context::set_global_object(GlobalObject* object) { 75 void Context::set_global_object(JSGlobalObject* object) {
76 set(GLOBAL_OBJECT_INDEX, object); 76 set(GLOBAL_OBJECT_INDEX, object);
77 } 77 }
78 78
79 79
80 bool Context::IsNativeContext() { 80 bool Context::IsNativeContext() {
81 Map* map = this->map(); 81 Map* map = this->map();
82 return map == map->GetHeap()->native_context_map(); 82 return map == map->GetHeap()->native_context_map();
83 } 83 }
84 84
85 85
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 return type::cast(get(index)); \ 139 return type::cast(get(index)); \
140 } 140 }
141 NATIVE_CONTEXT_FIELDS(NATIVE_CONTEXT_FIELD_ACCESSORS) 141 NATIVE_CONTEXT_FIELDS(NATIVE_CONTEXT_FIELD_ACCESSORS)
142 #undef NATIVE_CONTEXT_FIELD_ACCESSORS 142 #undef NATIVE_CONTEXT_FIELD_ACCESSORS
143 143
144 144
145 } // namespace internal 145 } // namespace internal
146 } // namespace v8 146 } // namespace v8
147 147
148 #endif // V8_CONTEXTS_INL_H_ 148 #endif // V8_CONTEXTS_INL_H_
OLDNEW
« no previous file with comments | « src/contexts.cc ('k') | src/crankshaft/arm/lithium-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698