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 // Review notes: | 5 // Review notes: |
6 // | 6 // |
7 // - The use of macros in these inline functions may seem superfluous | 7 // - The use of macros in these inline functions may seem superfluous |
8 // but it is absolutely needed to make sure gcc generates optimal | 8 // but it is absolutely needed to make sure gcc generates optimal |
9 // code. gcc is not happy when attempting to inline too deep. | 9 // code. gcc is not happy when attempting to inline too deep. |
10 // | 10 // |
(...skipping 1981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1992 | 1992 |
1993 int JSObject::GetHeaderSize() { return GetHeaderSize(map()->instance_type()); } | 1993 int JSObject::GetHeaderSize() { return GetHeaderSize(map()->instance_type()); } |
1994 | 1994 |
1995 | 1995 |
1996 int JSObject::GetHeaderSize(InstanceType type) { | 1996 int JSObject::GetHeaderSize(InstanceType type) { |
1997 // Check for the most common kind of JavaScript object before | 1997 // Check for the most common kind of JavaScript object before |
1998 // falling into the generic switch. This speeds up the internal | 1998 // falling into the generic switch. This speeds up the internal |
1999 // field operations considerably on average. | 1999 // field operations considerably on average. |
2000 if (type == JS_OBJECT_TYPE) return JSObject::kHeaderSize; | 2000 if (type == JS_OBJECT_TYPE) return JSObject::kHeaderSize; |
2001 switch (type) { | 2001 switch (type) { |
| 2002 case JS_API_OBJECT_TYPE: |
2002 case JS_SPECIAL_API_OBJECT_TYPE: | 2003 case JS_SPECIAL_API_OBJECT_TYPE: |
2003 return JSObject::kHeaderSize; | 2004 return JSObject::kHeaderSize; |
2004 case JS_GENERATOR_OBJECT_TYPE: | 2005 case JS_GENERATOR_OBJECT_TYPE: |
2005 return JSGeneratorObject::kSize; | 2006 return JSGeneratorObject::kSize; |
2006 case JS_MODULE_TYPE: | 2007 case JS_MODULE_TYPE: |
2007 return JSModule::kSize; | 2008 return JSModule::kSize; |
2008 case JS_GLOBAL_PROXY_TYPE: | 2009 case JS_GLOBAL_PROXY_TYPE: |
2009 return JSGlobalProxy::kSize; | 2010 return JSGlobalProxy::kSize; |
2010 case JS_GLOBAL_OBJECT_TYPE: | 2011 case JS_GLOBAL_OBJECT_TYPE: |
2011 return JSGlobalObject::kSize; | 2012 return JSGlobalObject::kSize; |
(...skipping 5789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7801 #undef WRITE_INT64_FIELD | 7802 #undef WRITE_INT64_FIELD |
7802 #undef READ_BYTE_FIELD | 7803 #undef READ_BYTE_FIELD |
7803 #undef WRITE_BYTE_FIELD | 7804 #undef WRITE_BYTE_FIELD |
7804 #undef NOBARRIER_READ_BYTE_FIELD | 7805 #undef NOBARRIER_READ_BYTE_FIELD |
7805 #undef NOBARRIER_WRITE_BYTE_FIELD | 7806 #undef NOBARRIER_WRITE_BYTE_FIELD |
7806 | 7807 |
7807 } // namespace internal | 7808 } // namespace internal |
7808 } // namespace v8 | 7809 } // namespace v8 |
7809 | 7810 |
7810 #endif // V8_OBJECTS_INL_H_ | 7811 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |