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) | |
679 TYPE_CHECKER(JSGeneratorObject, JS_GENERATOR_OBJECT_TYPE) | 678 TYPE_CHECKER(JSGeneratorObject, JS_GENERATOR_OBJECT_TYPE) |
680 TYPE_CHECKER(JSModule, JS_MODULE_TYPE) | 679 TYPE_CHECKER(JSModule, JS_MODULE_TYPE) |
681 TYPE_CHECKER(JSValue, JS_VALUE_TYPE) | 680 TYPE_CHECKER(JSValue, JS_VALUE_TYPE) |
682 TYPE_CHECKER(JSDate, JS_DATE_TYPE) | 681 TYPE_CHECKER(JSDate, JS_DATE_TYPE) |
683 TYPE_CHECKER(JSMessageObject, JS_MESSAGE_OBJECT_TYPE) | 682 TYPE_CHECKER(JSMessageObject, JS_MESSAGE_OBJECT_TYPE) |
684 | 683 |
685 | 684 |
686 bool Object::IsStringWrapper() { | 685 bool Object::IsStringWrapper() { |
687 return IsJSValue() && JSValue::cast(this)->value()->IsString(); | 686 return IsJSValue() && JSValue::cast(this)->value()->IsString(); |
688 } | 687 } |
(...skipping 1877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2566 CAST_ACCESSOR(Name) | 2565 CAST_ACCESSOR(Name) |
2567 CAST_ACCESSOR(JSReceiver) | 2566 CAST_ACCESSOR(JSReceiver) |
2568 CAST_ACCESSOR(JSObject) | 2567 CAST_ACCESSOR(JSObject) |
2569 CAST_ACCESSOR(Smi) | 2568 CAST_ACCESSOR(Smi) |
2570 CAST_ACCESSOR(HeapObject) | 2569 CAST_ACCESSOR(HeapObject) |
2571 CAST_ACCESSOR(HeapNumber) | 2570 CAST_ACCESSOR(HeapNumber) |
2572 CAST_ACCESSOR(Oddball) | 2571 CAST_ACCESSOR(Oddball) |
2573 CAST_ACCESSOR(Cell) | 2572 CAST_ACCESSOR(Cell) |
2574 CAST_ACCESSOR(PropertyCell) | 2573 CAST_ACCESSOR(PropertyCell) |
2575 CAST_ACCESSOR(SharedFunctionInfo) | 2574 CAST_ACCESSOR(SharedFunctionInfo) |
2576 CAST_ACCESSOR(OptimizedCodeEntry) | |
2577 CAST_ACCESSOR(Map) | 2575 CAST_ACCESSOR(Map) |
2578 CAST_ACCESSOR(JSFunction) | 2576 CAST_ACCESSOR(JSFunction) |
2579 CAST_ACCESSOR(GlobalObject) | 2577 CAST_ACCESSOR(GlobalObject) |
2580 CAST_ACCESSOR(JSGlobalProxy) | 2578 CAST_ACCESSOR(JSGlobalProxy) |
2581 CAST_ACCESSOR(JSGlobalObject) | 2579 CAST_ACCESSOR(JSGlobalObject) |
2582 CAST_ACCESSOR(JSBuiltinsObject) | 2580 CAST_ACCESSOR(JSBuiltinsObject) |
2583 CAST_ACCESSOR(Code) | 2581 CAST_ACCESSOR(Code) |
2584 CAST_ACCESSOR(JSArray) | 2582 CAST_ACCESSOR(JSArray) |
2585 CAST_ACCESSOR(JSArrayBuffer) | 2583 CAST_ACCESSOR(JSArrayBuffer) |
2586 CAST_ACCESSOR(JSArrayBufferView) | 2584 CAST_ACCESSOR(JSArrayBufferView) |
(...skipping 2332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4919 // enough power of 2. | 4917 // enough power of 2. |
4920 if (tries >= 16 && (((tries - 1) & tries) == 0)) { | 4918 if (tries >= 16 && (((tries - 1) & tries) == 0)) { |
4921 set_optimization_disabled(false); | 4919 set_optimization_disabled(false); |
4922 set_opt_count(0); | 4920 set_opt_count(0); |
4923 set_deopt_count(0); | 4921 set_deopt_count(0); |
4924 code()->set_optimizable(true); | 4922 code()->set_optimizable(true); |
4925 } | 4923 } |
4926 } | 4924 } |
4927 | 4925 |
4928 | 4926 |
4929 ACCESSORS(OptimizedCodeEntry, native_context, Context, kNativeContextOffset) | |
4930 ACCESSORS(OptimizedCodeEntry, function, JSFunction, kFunctionOffset) | |
4931 ACCESSORS(OptimizedCodeEntry, code, Code, kCodeOffset) | |
4932 ACCESSORS(OptimizedCodeEntry, literals, FixedArray, kLiteralsOffset) | |
4933 | |
4934 | |
4935 OptimizedCodeEntry* OptimizedCodeEntry::next_by_shared_info() { | |
4936 Object* object = READ_FIELD(this, kNextBySharedInfoOffset); | |
4937 if (object == NULL) return NULL; | |
4938 return OptimizedCodeEntry::cast(object); | |
4939 } | |
4940 | |
4941 | |
4942 OptimizedCodeEntry* OptimizedCodeEntry::next_by_native_context() { | |
4943 Object* object = READ_FIELD(this, kNextByNativeContextOffset); | |
4944 if (object == NULL) return NULL; | |
4945 return OptimizedCodeEntry::cast(object); | |
4946 } | |
4947 | |
4948 | |
4949 void OptimizedCodeEntry::set_next_by_shared_info(OptimizedCodeEntry* value, | |
4950 WriteBarrierMode mode) { | |
4951 WRITE_FIELD(this, kNextBySharedInfoOffset, value); | |
4952 CONDITIONAL_WRITE_BARRIER( | |
4953 GetHeap(), this, kNextBySharedInfoOffset, value, mode); | |
4954 } | |
4955 | |
4956 | |
4957 void OptimizedCodeEntry::set_next_by_native_context(OptimizedCodeEntry* value, | |
4958 WriteBarrierMode mode) { | |
4959 WRITE_FIELD(this, kNextByNativeContextOffset, value); | |
4960 CONDITIONAL_WRITE_BARRIER( | |
4961 GetHeap(), this, kNextByNativeContextOffset, value, mode); | |
4962 } | |
4963 | |
4964 | |
4965 bool OptimizedCodeEntry::cacheable() { | |
4966 return static_cast<bool>(READ_BYTE_FIELD(this, kCacheableOffset)); | |
4967 } | |
4968 | |
4969 | |
4970 void OptimizedCodeEntry::set_cacheable(bool val) { | |
4971 WRITE_BYTE_FIELD(this, kCacheableOffset, static_cast<byte>(val)); | |
4972 } | |
4973 | |
4974 | |
4975 bool JSFunction::IsBuiltin() { | 4927 bool JSFunction::IsBuiltin() { |
4976 return context()->global_object()->IsJSBuiltinsObject(); | 4928 return context()->global_object()->IsJSBuiltinsObject(); |
4977 } | 4929 } |
4978 | 4930 |
4979 | 4931 |
4980 bool JSFunction::NeedsArgumentsAdaption() { | 4932 bool JSFunction::NeedsArgumentsAdaption() { |
4981 return shared()->formal_parameter_count() != | 4933 return shared()->formal_parameter_count() != |
4982 SharedFunctionInfo::kDontAdaptArgumentsSentinel; | 4934 SharedFunctionInfo::kDontAdaptArgumentsSentinel; |
4983 } | 4935 } |
4984 | 4936 |
(...skipping 1348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6333 #undef WRITE_UINT32_FIELD | 6285 #undef WRITE_UINT32_FIELD |
6334 #undef READ_SHORT_FIELD | 6286 #undef READ_SHORT_FIELD |
6335 #undef WRITE_SHORT_FIELD | 6287 #undef WRITE_SHORT_FIELD |
6336 #undef READ_BYTE_FIELD | 6288 #undef READ_BYTE_FIELD |
6337 #undef WRITE_BYTE_FIELD | 6289 #undef WRITE_BYTE_FIELD |
6338 | 6290 |
6339 | 6291 |
6340 } } // namespace v8::internal | 6292 } } // namespace v8::internal |
6341 | 6293 |
6342 #endif // V8_OBJECTS_INL_H_ | 6294 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |