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 1943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1954 | 1954 |
1955 int JSObject::GetHeaderSize() { return GetHeaderSize(map()->instance_type()); } | 1955 int JSObject::GetHeaderSize() { return GetHeaderSize(map()->instance_type()); } |
1956 | 1956 |
1957 | 1957 |
1958 int JSObject::GetHeaderSize(InstanceType type) { | 1958 int JSObject::GetHeaderSize(InstanceType type) { |
1959 // Check for the most common kind of JavaScript object before | 1959 // Check for the most common kind of JavaScript object before |
1960 // falling into the generic switch. This speeds up the internal | 1960 // falling into the generic switch. This speeds up the internal |
1961 // field operations considerably on average. | 1961 // field operations considerably on average. |
1962 if (type == JS_OBJECT_TYPE) return JSObject::kHeaderSize; | 1962 if (type == JS_OBJECT_TYPE) return JSObject::kHeaderSize; |
1963 switch (type) { | 1963 switch (type) { |
| 1964 case JS_SPECIAL_API_OBJECT_TYPE: |
| 1965 return JSObject::kHeaderSize; |
1964 case JS_GENERATOR_OBJECT_TYPE: | 1966 case JS_GENERATOR_OBJECT_TYPE: |
1965 return JSGeneratorObject::kSize; | 1967 return JSGeneratorObject::kSize; |
1966 case JS_MODULE_TYPE: | 1968 case JS_MODULE_TYPE: |
1967 return JSModule::kSize; | 1969 return JSModule::kSize; |
1968 case JS_GLOBAL_PROXY_TYPE: | 1970 case JS_GLOBAL_PROXY_TYPE: |
1969 return JSGlobalProxy::kSize; | 1971 return JSGlobalProxy::kSize; |
1970 case JS_GLOBAL_OBJECT_TYPE: | 1972 case JS_GLOBAL_OBJECT_TYPE: |
1971 return JSGlobalObject::kSize; | 1973 return JSGlobalObject::kSize; |
1972 case JS_BOUND_FUNCTION_TYPE: | 1974 case JS_BOUND_FUNCTION_TYPE: |
1973 return JSBoundFunction::kSize; | 1975 return JSBoundFunction::kSize; |
(...skipping 5808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7782 #undef WRITE_INT64_FIELD | 7784 #undef WRITE_INT64_FIELD |
7783 #undef READ_BYTE_FIELD | 7785 #undef READ_BYTE_FIELD |
7784 #undef WRITE_BYTE_FIELD | 7786 #undef WRITE_BYTE_FIELD |
7785 #undef NOBARRIER_READ_BYTE_FIELD | 7787 #undef NOBARRIER_READ_BYTE_FIELD |
7786 #undef NOBARRIER_WRITE_BYTE_FIELD | 7788 #undef NOBARRIER_WRITE_BYTE_FIELD |
7787 | 7789 |
7788 } // namespace internal | 7790 } // namespace internal |
7789 } // namespace v8 | 7791 } // namespace v8 |
7790 | 7792 |
7791 #endif // V8_OBJECTS_INL_H_ | 7793 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |