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 1941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1952 | 1952 |
1953 int JSObject::GetHeaderSize() { return GetHeaderSize(map()->instance_type()); } | 1953 int JSObject::GetHeaderSize() { return GetHeaderSize(map()->instance_type()); } |
1954 | 1954 |
1955 | 1955 |
1956 int JSObject::GetHeaderSize(InstanceType type) { | 1956 int JSObject::GetHeaderSize(InstanceType type) { |
1957 // Check for the most common kind of JavaScript object before | 1957 // Check for the most common kind of JavaScript object before |
1958 // falling into the generic switch. This speeds up the internal | 1958 // falling into the generic switch. This speeds up the internal |
1959 // field operations considerably on average. | 1959 // field operations considerably on average. |
1960 if (type == JS_OBJECT_TYPE) return JSObject::kHeaderSize; | 1960 if (type == JS_OBJECT_TYPE) return JSObject::kHeaderSize; |
1961 switch (type) { | 1961 switch (type) { |
| 1962 case JS_SPECIAL_API_OBJECT_TYPE: |
| 1963 return JSObject::kHeaderSize; |
1962 case JS_GENERATOR_OBJECT_TYPE: | 1964 case JS_GENERATOR_OBJECT_TYPE: |
1963 return JSGeneratorObject::kSize; | 1965 return JSGeneratorObject::kSize; |
1964 case JS_MODULE_TYPE: | 1966 case JS_MODULE_TYPE: |
1965 return JSModule::kSize; | 1967 return JSModule::kSize; |
1966 case JS_GLOBAL_PROXY_TYPE: | 1968 case JS_GLOBAL_PROXY_TYPE: |
1967 return JSGlobalProxy::kSize; | 1969 return JSGlobalProxy::kSize; |
1968 case JS_GLOBAL_OBJECT_TYPE: | 1970 case JS_GLOBAL_OBJECT_TYPE: |
1969 return JSGlobalObject::kSize; | 1971 return JSGlobalObject::kSize; |
1970 case JS_BOUND_FUNCTION_TYPE: | 1972 case JS_BOUND_FUNCTION_TYPE: |
1971 return JSBoundFunction::kSize; | 1973 return JSBoundFunction::kSize; |
(...skipping 5773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7745 #undef WRITE_INT64_FIELD | 7747 #undef WRITE_INT64_FIELD |
7746 #undef READ_BYTE_FIELD | 7748 #undef READ_BYTE_FIELD |
7747 #undef WRITE_BYTE_FIELD | 7749 #undef WRITE_BYTE_FIELD |
7748 #undef NOBARRIER_READ_BYTE_FIELD | 7750 #undef NOBARRIER_READ_BYTE_FIELD |
7749 #undef NOBARRIER_WRITE_BYTE_FIELD | 7751 #undef NOBARRIER_WRITE_BYTE_FIELD |
7750 | 7752 |
7751 } // namespace internal | 7753 } // namespace internal |
7752 } // namespace v8 | 7754 } // namespace v8 |
7753 | 7755 |
7754 #endif // V8_OBJECTS_INL_H_ | 7756 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |