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

Side by Side Diff: include/v8.h

Issue 2475433008: Set global proxy internal field count based on the global object template. (Closed)
Patch Set: Address comments 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
« no previous file with comments | « no previous file | src/api.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 /** \mainpage V8 API Reference Guide 5 /** \mainpage V8 API Reference Guide
6 * 6 *
7 * V8 is Google's open source JavaScript engine. 7 * V8 is Google's open source JavaScript engine.
8 * 8 *
9 * This set of documents provides reference material generated from the 9 * This set of documents provides reference material generated from the
10 * V8 header file, include/v8.h. 10 * V8 header file, include/v8.h.
(...skipping 7852 matching lines...) Expand 10 before | Expand all | Expand 10 after
7863 : name_count_(name_count), names_(names) { } 7863 : name_count_(name_count), names_(names) { }
7864 7864
7865 const char** begin() const { return &names_[0]; } 7865 const char** begin() const { return &names_[0]; }
7866 const char** end() const { return &names_[name_count_]; } 7866 const char** end() const { return &names_[name_count_]; }
7867 7867
7868 private: 7868 private:
7869 const int name_count_; 7869 const int name_count_;
7870 const char** names_; 7870 const char** names_;
7871 }; 7871 };
7872 7872
7873 #ifndef V8_CONTEXT_PROXY_INTERNAL_FIELD_COUNT
7874 // The number of required internal fields for global proxy objects can be
7875 // defined by embedder.
7876 #define V8_CONTEXT_PROXY_INTERNAL_FIELD_COUNT 2
7877 #endif
7878
7879 /** 7873 /**
7880 * A sandboxed execution context with its own set of built-in objects 7874 * A sandboxed execution context with its own set of built-in objects
7881 * and functions. 7875 * and functions.
7882 */ 7876 */
7883 class V8_EXPORT Context { 7877 class V8_EXPORT Context {
7884 public: 7878 public:
7885 /** 7879 /**
7886 * Returns the global proxy object. 7880 * Returns the global proxy object.
7887 * 7881 *
7888 * Global proxy object is a thin wrapper whose prototype points to actual 7882 * Global proxy object is a thin wrapper whose prototype points to actual
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
8066 public: 8060 public:
8067 explicit V8_INLINE Scope(Local<Context> context) : context_(context) { 8061 explicit V8_INLINE Scope(Local<Context> context) : context_(context) {
8068 context_->Enter(); 8062 context_->Enter();
8069 } 8063 }
8070 V8_INLINE ~Scope() { context_->Exit(); } 8064 V8_INLINE ~Scope() { context_->Exit(); }
8071 8065
8072 private: 8066 private:
8073 Local<Context> context_; 8067 Local<Context> context_;
8074 }; 8068 };
8075 8069
8076 static const int kProxyInternalFieldCount =
8077 V8_CONTEXT_PROXY_INTERNAL_FIELD_COUNT;
8078
8079 private: 8070 private:
8080 friend class Value; 8071 friend class Value;
8081 friend class Script; 8072 friend class Script;
8082 friend class Object; 8073 friend class Object;
8083 friend class Function; 8074 friend class Function;
8084 8075
8085 Local<Value> SlowGetEmbedderData(int index); 8076 Local<Value> SlowGetEmbedderData(int index);
8086 void* SlowGetAlignedPointerFromEmbedderData(int index); 8077 void* SlowGetAlignedPointerFromEmbedderData(int index);
8087 }; 8078 };
8088 8079
(...skipping 1616 matching lines...) Expand 10 before | Expand all | Expand 10 after
9705 */ 9696 */
9706 9697
9707 9698
9708 } // namespace v8 9699 } // namespace v8
9709 9700
9710 9701
9711 #undef TYPE_CHECK 9702 #undef TYPE_CHECK
9712 9703
9713 9704
9714 #endif // INCLUDE_V8_H_ 9705 #endif // INCLUDE_V8_H_
OLDNEW
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698