| OLD | NEW |
| 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 #ifndef V8_OBJECTS_H_ | 5 #ifndef V8_OBJECTS_H_ |
| 6 #define V8_OBJECTS_H_ | 6 #define V8_OBJECTS_H_ |
| 7 | 7 |
| 8 #include <iosfwd> | 8 #include <iosfwd> |
| 9 | 9 |
| 10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
| (...skipping 7133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7144 | 7144 |
| 7145 private: | 7145 private: |
| 7146 DISALLOW_IMPLICIT_CONSTRUCTORS(JSGlobalObject); | 7146 DISALLOW_IMPLICIT_CONSTRUCTORS(JSGlobalObject); |
| 7147 }; | 7147 }; |
| 7148 | 7148 |
| 7149 | 7149 |
| 7150 // Builtins global object which holds the runtime routines written in | 7150 // Builtins global object which holds the runtime routines written in |
| 7151 // JavaScript. | 7151 // JavaScript. |
| 7152 class JSBuiltinsObject: public GlobalObject { | 7152 class JSBuiltinsObject: public GlobalObject { |
| 7153 public: | 7153 public: |
| 7154 // Accessors for the runtime routines written in JavaScript. | |
| 7155 inline Object* javascript_builtin(Builtins::JavaScript id); | |
| 7156 inline void set_javascript_builtin(Builtins::JavaScript id, Object* value); | |
| 7157 | |
| 7158 DECLARE_CAST(JSBuiltinsObject) | 7154 DECLARE_CAST(JSBuiltinsObject) |
| 7159 | 7155 |
| 7160 // Dispatched behavior. | 7156 // Dispatched behavior. |
| 7161 DECLARE_PRINTER(JSBuiltinsObject) | 7157 DECLARE_PRINTER(JSBuiltinsObject) |
| 7162 DECLARE_VERIFIER(JSBuiltinsObject) | 7158 DECLARE_VERIFIER(JSBuiltinsObject) |
| 7163 | 7159 |
| 7164 // Layout description. The size of the builtins object includes | 7160 // Layout description. |
| 7165 // room for two pointers per runtime routine written in javascript | 7161 static const int kSize = GlobalObject::kHeaderSize; |
| 7166 // (function and code object). | |
| 7167 static const int kJSBuiltinsCount = Builtins::id_count; | |
| 7168 static const int kJSBuiltinsOffset = GlobalObject::kHeaderSize; | |
| 7169 static const int kSize = | |
| 7170 GlobalObject::kHeaderSize + (kJSBuiltinsCount * kPointerSize); | |
| 7171 | |
| 7172 static int OffsetOfFunctionWithId(Builtins::JavaScript id) { | |
| 7173 return kJSBuiltinsOffset + id * kPointerSize; | |
| 7174 } | |
| 7175 | 7162 |
| 7176 private: | 7163 private: |
| 7177 DISALLOW_IMPLICIT_CONSTRUCTORS(JSBuiltinsObject); | 7164 DISALLOW_IMPLICIT_CONSTRUCTORS(JSBuiltinsObject); |
| 7178 }; | 7165 }; |
| 7179 | 7166 |
| 7180 | 7167 |
| 7181 // Representation for JS Wrapper objects, String, Number, Boolean, etc. | 7168 // Representation for JS Wrapper objects, String, Number, Boolean, etc. |
| 7182 class JSValue: public JSObject { | 7169 class JSValue: public JSObject { |
| 7183 public: | 7170 public: |
| 7184 // [value]: the object being wrapped. | 7171 // [value]: the object being wrapped. |
| (...skipping 3141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10326 } else { | 10313 } else { |
| 10327 value &= ~(1 << bit_position); | 10314 value &= ~(1 << bit_position); |
| 10328 } | 10315 } |
| 10329 return value; | 10316 return value; |
| 10330 } | 10317 } |
| 10331 }; | 10318 }; |
| 10332 | 10319 |
| 10333 } } // namespace v8::internal | 10320 } } // namespace v8::internal |
| 10334 | 10321 |
| 10335 #endif // V8_OBJECTS_H_ | 10322 #endif // V8_OBJECTS_H_ |
| OLD | NEW |