OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
668 template <> inline bool Is<JSFunction>(Object* obj) { | 668 template <> inline bool Is<JSFunction>(Object* obj) { |
669 return obj->IsJSFunction(); | 669 return obj->IsJSFunction(); |
670 } | 670 } |
671 | 671 |
672 | 672 |
673 TYPE_CHECKER(Code, CODE_TYPE) | 673 TYPE_CHECKER(Code, CODE_TYPE) |
674 TYPE_CHECKER(Oddball, ODDBALL_TYPE) | 674 TYPE_CHECKER(Oddball, ODDBALL_TYPE) |
675 TYPE_CHECKER(Cell, CELL_TYPE) | 675 TYPE_CHECKER(Cell, CELL_TYPE) |
676 TYPE_CHECKER(PropertyCell, PROPERTY_CELL_TYPE) | 676 TYPE_CHECKER(PropertyCell, PROPERTY_CELL_TYPE) |
677 TYPE_CHECKER(SharedFunctionInfo, SHARED_FUNCTION_INFO_TYPE) | 677 TYPE_CHECKER(SharedFunctionInfo, SHARED_FUNCTION_INFO_TYPE) |
| 678 TYPE_CHECKER(OptimizedCodeEntry, OPTIMIZED_CODE_ENTRY_TYPE) |
678 TYPE_CHECKER(JSGeneratorObject, JS_GENERATOR_OBJECT_TYPE) | 679 TYPE_CHECKER(JSGeneratorObject, JS_GENERATOR_OBJECT_TYPE) |
679 TYPE_CHECKER(JSModule, JS_MODULE_TYPE) | 680 TYPE_CHECKER(JSModule, JS_MODULE_TYPE) |
680 TYPE_CHECKER(JSValue, JS_VALUE_TYPE) | 681 TYPE_CHECKER(JSValue, JS_VALUE_TYPE) |
681 TYPE_CHECKER(JSDate, JS_DATE_TYPE) | 682 TYPE_CHECKER(JSDate, JS_DATE_TYPE) |
682 TYPE_CHECKER(JSMessageObject, JS_MESSAGE_OBJECT_TYPE) | 683 TYPE_CHECKER(JSMessageObject, JS_MESSAGE_OBJECT_TYPE) |
683 | 684 |
684 | 685 |
685 bool Object::IsStringWrapper() { | 686 bool Object::IsStringWrapper() { |
686 return IsJSValue() && JSValue::cast(this)->value()->IsString(); | 687 return IsJSValue() && JSValue::cast(this)->value()->IsString(); |
687 } | 688 } |
(...skipping 1879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2567 CAST_ACCESSOR(Name) | 2568 CAST_ACCESSOR(Name) |
2568 CAST_ACCESSOR(JSReceiver) | 2569 CAST_ACCESSOR(JSReceiver) |
2569 CAST_ACCESSOR(JSObject) | 2570 CAST_ACCESSOR(JSObject) |
2570 CAST_ACCESSOR(Smi) | 2571 CAST_ACCESSOR(Smi) |
2571 CAST_ACCESSOR(HeapObject) | 2572 CAST_ACCESSOR(HeapObject) |
2572 CAST_ACCESSOR(HeapNumber) | 2573 CAST_ACCESSOR(HeapNumber) |
2573 CAST_ACCESSOR(Oddball) | 2574 CAST_ACCESSOR(Oddball) |
2574 CAST_ACCESSOR(Cell) | 2575 CAST_ACCESSOR(Cell) |
2575 CAST_ACCESSOR(PropertyCell) | 2576 CAST_ACCESSOR(PropertyCell) |
2576 CAST_ACCESSOR(SharedFunctionInfo) | 2577 CAST_ACCESSOR(SharedFunctionInfo) |
| 2578 CAST_ACCESSOR(OptimizedCodeEntry) |
2577 CAST_ACCESSOR(Map) | 2579 CAST_ACCESSOR(Map) |
2578 CAST_ACCESSOR(JSFunction) | 2580 CAST_ACCESSOR(JSFunction) |
2579 CAST_ACCESSOR(GlobalObject) | 2581 CAST_ACCESSOR(GlobalObject) |
2580 CAST_ACCESSOR(JSGlobalProxy) | 2582 CAST_ACCESSOR(JSGlobalProxy) |
2581 CAST_ACCESSOR(JSGlobalObject) | 2583 CAST_ACCESSOR(JSGlobalObject) |
2582 CAST_ACCESSOR(JSBuiltinsObject) | 2584 CAST_ACCESSOR(JSBuiltinsObject) |
2583 CAST_ACCESSOR(Code) | 2585 CAST_ACCESSOR(Code) |
2584 CAST_ACCESSOR(JSArray) | 2586 CAST_ACCESSOR(JSArray) |
2585 CAST_ACCESSOR(JSArrayBuffer) | 2587 CAST_ACCESSOR(JSArrayBuffer) |
2586 CAST_ACCESSOR(JSArrayBufferView) | 2588 CAST_ACCESSOR(JSArrayBufferView) |
(...skipping 2337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4924 // enough power of 2. | 4926 // enough power of 2. |
4925 if (tries >= 16 && (((tries - 1) & tries) == 0)) { | 4927 if (tries >= 16 && (((tries - 1) & tries) == 0)) { |
4926 set_optimization_disabled(false); | 4928 set_optimization_disabled(false); |
4927 set_opt_count(0); | 4929 set_opt_count(0); |
4928 set_deopt_count(0); | 4930 set_deopt_count(0); |
4929 code()->set_optimizable(true); | 4931 code()->set_optimizable(true); |
4930 } | 4932 } |
4931 } | 4933 } |
4932 | 4934 |
4933 | 4935 |
| 4936 ACCESSORS(OptimizedCodeEntry, native_context, Context, kNativeContextOffset) |
| 4937 ACCESSORS(OptimizedCodeEntry, function, JSFunction, kFunctionOffset) |
| 4938 ACCESSORS(OptimizedCodeEntry, code, Code, kCodeOffset) |
| 4939 ACCESSORS(OptimizedCodeEntry, literals, FixedArray, kLiteralsOffset) |
| 4940 |
| 4941 |
| 4942 OptimizedCodeEntry* OptimizedCodeEntry::next_by_shared_info() { |
| 4943 Object* object = READ_FIELD(this, kNextBySharedInfoOffset); |
| 4944 if (object == NULL) return NULL; |
| 4945 return OptimizedCodeEntry::cast(object); |
| 4946 } |
| 4947 |
| 4948 |
| 4949 OptimizedCodeEntry* OptimizedCodeEntry::next_by_native_context() { |
| 4950 Object* object = READ_FIELD(this, kNextByNativeContextOffset); |
| 4951 if (object == NULL) return NULL; |
| 4952 return OptimizedCodeEntry::cast(object); |
| 4953 } |
| 4954 |
| 4955 |
| 4956 void OptimizedCodeEntry::set_next_by_shared_info(OptimizedCodeEntry* value, |
| 4957 WriteBarrierMode mode) { |
| 4958 WRITE_FIELD(this, kNextBySharedInfoOffset, value); |
| 4959 CONDITIONAL_WRITE_BARRIER( |
| 4960 GetHeap(), this, kNextBySharedInfoOffset, value, mode); |
| 4961 } |
| 4962 |
| 4963 |
| 4964 void OptimizedCodeEntry::set_next_by_native_context(OptimizedCodeEntry* value, |
| 4965 WriteBarrierMode mode) { |
| 4966 WRITE_FIELD(this, kNextByNativeContextOffset, value); |
| 4967 CONDITIONAL_WRITE_BARRIER( |
| 4968 GetHeap(), this, kNextByNativeContextOffset, value, mode); |
| 4969 } |
| 4970 |
| 4971 |
| 4972 bool OptimizedCodeEntry::cacheable() { |
| 4973 return static_cast<bool>(READ_BYTE_FIELD(this, kCacheableOffset)); |
| 4974 } |
| 4975 |
| 4976 |
| 4977 void OptimizedCodeEntry::set_cacheable(bool val) { |
| 4978 WRITE_BYTE_FIELD(this, kCacheableOffset, static_cast<byte>(val)); |
| 4979 } |
| 4980 |
| 4981 |
4934 bool JSFunction::IsBuiltin() { | 4982 bool JSFunction::IsBuiltin() { |
4935 return context()->global_object()->IsJSBuiltinsObject(); | 4983 return context()->global_object()->IsJSBuiltinsObject(); |
4936 } | 4984 } |
4937 | 4985 |
4938 | 4986 |
4939 bool JSFunction::NeedsArgumentsAdaption() { | 4987 bool JSFunction::NeedsArgumentsAdaption() { |
4940 return shared()->formal_parameter_count() != | 4988 return shared()->formal_parameter_count() != |
4941 SharedFunctionInfo::kDontAdaptArgumentsSentinel; | 4989 SharedFunctionInfo::kDontAdaptArgumentsSentinel; |
4942 } | 4990 } |
4943 | 4991 |
(...skipping 1348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6292 #undef WRITE_UINT32_FIELD | 6340 #undef WRITE_UINT32_FIELD |
6293 #undef READ_SHORT_FIELD | 6341 #undef READ_SHORT_FIELD |
6294 #undef WRITE_SHORT_FIELD | 6342 #undef WRITE_SHORT_FIELD |
6295 #undef READ_BYTE_FIELD | 6343 #undef READ_BYTE_FIELD |
6296 #undef WRITE_BYTE_FIELD | 6344 #undef WRITE_BYTE_FIELD |
6297 | 6345 |
6298 | 6346 |
6299 } } // namespace v8::internal | 6347 } } // namespace v8::internal |
6300 | 6348 |
6301 #endif // V8_OBJECTS_INL_H_ | 6349 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |