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

Unified Diff: src/contexts.h

Issue 10878047: Revert to code state of 3.13.1 plus r12350 (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler.cc ('k') | src/contexts.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/contexts.h
diff --git a/src/contexts.h b/src/contexts.h
index 8df16dd50ac47f897720f1d1c738944e3043c396..e0d8a14a5526c307e01e761c012308afef70edcb 100644
--- a/src/contexts.h
+++ b/src/contexts.h
@@ -96,7 +96,7 @@ enum BindingFlags {
// must always be allocated via Heap::AllocateContext() or
// Factory::NewContext.
-#define NATIVE_CONTEXT_FIELDS(V) \
+#define GLOBAL_CONTEXT_FIELDS(V) \
V(GLOBAL_PROXY_INDEX, JSObject, global_proxy_object) \
V(SECURITY_TOKEN_INDEX, Object, security_token) \
V(BOOLEAN_FUNCTION_INDEX, JSFunction, boolean_function) \
@@ -193,15 +193,15 @@ enum BindingFlags {
// For block contexts, contains the respective ScopeInfo.
// For module contexts, points back to the respective JSModule.
//
-// [ global_object ] A pointer to the global object. Provided for quick
+// [ global ] A pointer to the global object. Provided for quick
// access to the global object from inside the code (since
// we always have a context pointer).
//
// In addition, function contexts may have statically allocated context slots
// to store local variables/functions that are accessed from inner functions
// (via static context addresses) or through 'eval' (dynamic context lookups).
-// Finally, the native context contains additional slots for fast access to
-// native properties.
+// Finally, the global context contains additional slots for fast access to
+// global properties.
class Context: public FixedArray {
public:
@@ -221,13 +221,13 @@ class Context: public FixedArray {
// (with contexts), or the variable name (catch contexts), the serialized
// scope info (block contexts), or the module instance (module contexts).
EXTENSION_INDEX,
- GLOBAL_OBJECT_INDEX,
+ GLOBAL_INDEX,
MIN_CONTEXT_SLOTS,
// This slot holds the thrown value in catch contexts.
THROWN_OBJECT_INDEX = MIN_CONTEXT_SLOTS,
- // These slots are only in native contexts.
+ // These slots are only in global contexts.
GLOBAL_PROXY_INDEX = MIN_CONTEXT_SLOTS,
SECURITY_TOKEN_INDEX,
ARGUMENTS_BOILERPLATE_INDEX,
@@ -294,7 +294,7 @@ class Context: public FixedArray {
NEXT_CONTEXT_LINK, // Weak.
// Total number of slots.
- NATIVE_CONTEXT_SLOTS,
+ GLOBAL_CONTEXT_SLOTS,
FIRST_WEAK_SLOT = OPTIMIZED_FUNCTIONS_LIST
};
@@ -321,14 +321,12 @@ class Context: public FixedArray {
// may be the context itself.
Context* declaration_context();
- GlobalObject* global_object() {
- Object* result = get(GLOBAL_OBJECT_INDEX);
+ GlobalObject* global() {
+ Object* result = get(GLOBAL_INDEX);
ASSERT(IsBootstrappingOrGlobalObject(result));
return reinterpret_cast<GlobalObject*>(result);
}
- void set_global_object(GlobalObject* object) {
- set(GLOBAL_OBJECT_INDEX, object);
- }
+ void set_global(GlobalObject* global) { set(GLOBAL_INDEX, global); }
// Returns a JSGlobalProxy object or null.
JSObject* global_proxy();
@@ -337,11 +335,11 @@ class Context: public FixedArray {
// The builtins object.
JSBuiltinsObject* builtins();
- // Compute the native context by traversing the context chain.
- Context* native_context();
+ // Compute the global context by traversing the context chain.
+ Context* global_context();
- // Predicates for context types. IsNativeContext is defined on Object
- // because we frequently have to know if arbitrary objects are natives
+ // Predicates for context types. IsGlobalContext is defined on Object
+ // because we frequently have to know if arbitrary objects are global
// contexts.
bool IsFunctionContext() {
Map* map = this->map();
@@ -364,29 +362,29 @@ class Context: public FixedArray {
return map == map->GetHeap()->module_context_map();
}
- // Tells whether the native context is marked with out of memory.
+ // Tells whether the global context is marked with out of memory.
inline bool has_out_of_memory();
- // Mark the native context with out of memory.
+ // Mark the global context with out of memory.
inline void mark_out_of_memory();
- // A native context hold a list of all functions which have been optimized.
+ // A global context hold a list of all functions which have been optimized.
void AddOptimizedFunction(JSFunction* function);
void RemoveOptimizedFunction(JSFunction* function);
Object* OptimizedFunctionsListHead();
void ClearOptimizedFunctions();
-#define NATIVE_CONTEXT_FIELD_ACCESSORS(index, type, name) \
+#define GLOBAL_CONTEXT_FIELD_ACCESSORS(index, type, name) \
void set_##name(type* value) { \
- ASSERT(IsNativeContext()); \
+ ASSERT(IsGlobalContext()); \
set(index, value); \
} \
type* name() { \
- ASSERT(IsNativeContext()); \
+ ASSERT(IsGlobalContext()); \
return type::cast(get(index)); \
}
- NATIVE_CONTEXT_FIELDS(NATIVE_CONTEXT_FIELD_ACCESSORS)
-#undef NATIVE_CONTEXT_FIELD_ACCESSORS
+ GLOBAL_CONTEXT_FIELDS(GLOBAL_CONTEXT_FIELD_ACCESSORS)
+#undef GLOBAL_CONTEXT_FIELD_ACCESSORS
// Lookup the slot called name, starting with the current context.
// There are three possibilities:
@@ -416,7 +414,7 @@ class Context: public FixedArray {
return kHeaderSize + index * kPointerSize - kHeapObjectTag;
}
- static const int kSize = kHeaderSize + NATIVE_CONTEXT_SLOTS * kPointerSize;
+ static const int kSize = kHeaderSize + GLOBAL_CONTEXT_SLOTS * kPointerSize;
// GC support.
typedef FixedBodyDescriptor<
« no previous file with comments | « src/compiler.cc ('k') | src/contexts.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698