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 3750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3761 | 3761 |
3762 void Code::set_stack_check_table_offset(unsigned offset) { | 3762 void Code::set_stack_check_table_offset(unsigned offset) { |
3763 ASSERT_EQ(FUNCTION, kind()); | 3763 ASSERT_EQ(FUNCTION, kind()); |
3764 ASSERT(IsAligned(offset, static_cast<unsigned>(kIntSize))); | 3764 ASSERT(IsAligned(offset, static_cast<unsigned>(kIntSize))); |
3765 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset); | 3765 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset); |
3766 int updated = StackCheckTableOffsetField::update(previous, offset); | 3766 int updated = StackCheckTableOffsetField::update(previous, offset); |
3767 WRITE_UINT32_FIELD(this, kKindSpecificFlags2Offset, updated); | 3767 WRITE_UINT32_FIELD(this, kKindSpecificFlags2Offset, updated); |
3768 } | 3768 } |
3769 | 3769 |
3770 | 3770 |
| 3771 bool Code::stack_check_patched_for_osr() { |
| 3772 ASSERT_EQ(FUNCTION, kind()); |
| 3773 return StackCheckPatchedForOSRField::decode( |
| 3774 READ_UINT32_FIELD(this, kKindSpecificFlags2Offset)); |
| 3775 } |
| 3776 |
| 3777 |
| 3778 void Code::set_stack_check_patched_for_osr(bool value) { |
| 3779 ASSERT_EQ(FUNCTION, kind()); |
| 3780 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset); |
| 3781 int updated = StackCheckPatchedForOSRField::update(previous, value); |
| 3782 WRITE_UINT32_FIELD(this, kKindSpecificFlags2Offset, updated); |
| 3783 } |
| 3784 |
| 3785 |
| 3786 |
3771 CheckType Code::check_type() { | 3787 CheckType Code::check_type() { |
3772 ASSERT(is_call_stub() || is_keyed_call_stub()); | 3788 ASSERT(is_call_stub() || is_keyed_call_stub()); |
3773 byte type = READ_BYTE_FIELD(this, kCheckTypeOffset); | 3789 byte type = READ_BYTE_FIELD(this, kCheckTypeOffset); |
3774 return static_cast<CheckType>(type); | 3790 return static_cast<CheckType>(type); |
3775 } | 3791 } |
3776 | 3792 |
3777 | 3793 |
3778 void Code::set_check_type(CheckType value) { | 3794 void Code::set_check_type(CheckType value) { |
3779 ASSERT(is_call_stub() || is_keyed_call_stub()); | 3795 ASSERT(is_call_stub() || is_keyed_call_stub()); |
3780 WRITE_BYTE_FIELD(this, kCheckTypeOffset, value); | 3796 WRITE_BYTE_FIELD(this, kCheckTypeOffset, value); |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4293 kHiddenPrototypeBit) | 4309 kHiddenPrototypeBit) |
4294 BOOL_ACCESSORS(FunctionTemplateInfo, flag, undetectable, kUndetectableBit) | 4310 BOOL_ACCESSORS(FunctionTemplateInfo, flag, undetectable, kUndetectableBit) |
4295 BOOL_ACCESSORS(FunctionTemplateInfo, flag, needs_access_check, | 4311 BOOL_ACCESSORS(FunctionTemplateInfo, flag, needs_access_check, |
4296 kNeedsAccessCheckBit) | 4312 kNeedsAccessCheckBit) |
4297 BOOL_ACCESSORS(FunctionTemplateInfo, flag, read_only_prototype, | 4313 BOOL_ACCESSORS(FunctionTemplateInfo, flag, read_only_prototype, |
4298 kReadOnlyPrototypeBit) | 4314 kReadOnlyPrototypeBit) |
4299 BOOL_ACCESSORS(SharedFunctionInfo, start_position_and_type, is_expression, | 4315 BOOL_ACCESSORS(SharedFunctionInfo, start_position_and_type, is_expression, |
4300 kIsExpressionBit) | 4316 kIsExpressionBit) |
4301 BOOL_ACCESSORS(SharedFunctionInfo, start_position_and_type, is_toplevel, | 4317 BOOL_ACCESSORS(SharedFunctionInfo, start_position_and_type, is_toplevel, |
4302 kIsTopLevelBit) | 4318 kIsTopLevelBit) |
| 4319 |
4303 BOOL_GETTER(SharedFunctionInfo, | 4320 BOOL_GETTER(SharedFunctionInfo, |
4304 compiler_hints, | 4321 compiler_hints, |
4305 has_only_simple_this_property_assignments, | 4322 has_only_simple_this_property_assignments, |
4306 kHasOnlySimpleThisPropertyAssignments) | 4323 kHasOnlySimpleThisPropertyAssignments) |
4307 BOOL_ACCESSORS(SharedFunctionInfo, | 4324 BOOL_ACCESSORS(SharedFunctionInfo, |
4308 compiler_hints, | 4325 compiler_hints, |
4309 allows_lazy_compilation, | 4326 allows_lazy_compilation, |
4310 kAllowLazyCompilation) | 4327 kAllowLazyCompilation) |
4311 BOOL_ACCESSORS(SharedFunctionInfo, | 4328 BOOL_ACCESSORS(SharedFunctionInfo, |
4312 compiler_hints, | 4329 compiler_hints, |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4699 bool JSFunction::IsOptimizable() { | 4716 bool JSFunction::IsOptimizable() { |
4700 return code()->kind() == Code::FUNCTION && code()->optimizable(); | 4717 return code()->kind() == Code::FUNCTION && code()->optimizable(); |
4701 } | 4718 } |
4702 | 4719 |
4703 | 4720 |
4704 bool JSFunction::IsMarkedForLazyRecompilation() { | 4721 bool JSFunction::IsMarkedForLazyRecompilation() { |
4705 return code() == GetIsolate()->builtins()->builtin(Builtins::kLazyRecompile); | 4722 return code() == GetIsolate()->builtins()->builtin(Builtins::kLazyRecompile); |
4706 } | 4723 } |
4707 | 4724 |
4708 | 4725 |
| 4726 bool JSFunction::IsMarkedForInstallingRecompiledCode() { |
| 4727 return code() == GetIsolate()->builtins()->builtin( |
| 4728 Builtins::kInstallRecompiledCode); |
| 4729 } |
| 4730 |
| 4731 |
4709 bool JSFunction::IsMarkedForParallelRecompilation() { | 4732 bool JSFunction::IsMarkedForParallelRecompilation() { |
4710 return code() == | 4733 return code() == GetIsolate()->builtins()->builtin( |
4711 GetIsolate()->builtins()->builtin(Builtins::kParallelRecompile); | 4734 Builtins::kParallelRecompile); |
4712 } | 4735 } |
4713 | 4736 |
4714 | 4737 |
4715 bool JSFunction::IsInRecompileQueue() { | 4738 bool JSFunction::IsInRecompileQueue() { |
4716 return code() == GetIsolate()->builtins()->builtin( | 4739 return code() == GetIsolate()->builtins()->builtin( |
4717 Builtins::kInRecompileQueue); | 4740 Builtins::kInRecompileQueue); |
4718 } | 4741 } |
4719 | 4742 |
4720 | 4743 |
4721 Code* JSFunction::code() { | 4744 Code* JSFunction::code() { |
(...skipping 11 matching lines...) Expand all Loading... |
4733 ASSERT(!HEAP->InNewSpace(value)); | 4756 ASSERT(!HEAP->InNewSpace(value)); |
4734 Address entry = value->entry(); | 4757 Address entry = value->entry(); |
4735 WRITE_INTPTR_FIELD(this, kCodeEntryOffset, reinterpret_cast<intptr_t>(entry)); | 4758 WRITE_INTPTR_FIELD(this, kCodeEntryOffset, reinterpret_cast<intptr_t>(entry)); |
4736 GetHeap()->incremental_marking()->RecordWriteOfCodeEntry( | 4759 GetHeap()->incremental_marking()->RecordWriteOfCodeEntry( |
4737 this, | 4760 this, |
4738 HeapObject::RawField(this, kCodeEntryOffset), | 4761 HeapObject::RawField(this, kCodeEntryOffset), |
4739 value); | 4762 value); |
4740 } | 4763 } |
4741 | 4764 |
4742 | 4765 |
| 4766 void JSFunction::set_code_no_write_barrier(Code* value) { |
| 4767 ASSERT(!HEAP->InNewSpace(value)); |
| 4768 Address entry = value->entry(); |
| 4769 WRITE_INTPTR_FIELD(this, kCodeEntryOffset, reinterpret_cast<intptr_t>(entry)); |
| 4770 } |
| 4771 |
| 4772 |
4743 void JSFunction::ReplaceCode(Code* code) { | 4773 void JSFunction::ReplaceCode(Code* code) { |
4744 bool was_optimized = IsOptimized(); | 4774 bool was_optimized = IsOptimized(); |
4745 bool is_optimized = code->kind() == Code::OPTIMIZED_FUNCTION; | 4775 bool is_optimized = code->kind() == Code::OPTIMIZED_FUNCTION; |
4746 | 4776 |
4747 set_code(code); | 4777 set_code(code); |
4748 | 4778 |
4749 // Add/remove the function from the list of optimized functions for this | 4779 // Add/remove the function from the list of optimized functions for this |
4750 // context based on the state change. | 4780 // context based on the state change. |
4751 if (!was_optimized && is_optimized) { | 4781 if (!was_optimized && is_optimized) { |
4752 context()->native_context()->AddOptimizedFunction(this); | 4782 context()->native_context()->AddOptimizedFunction(this); |
(...skipping 1232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5985 #undef WRITE_UINT32_FIELD | 6015 #undef WRITE_UINT32_FIELD |
5986 #undef READ_SHORT_FIELD | 6016 #undef READ_SHORT_FIELD |
5987 #undef WRITE_SHORT_FIELD | 6017 #undef WRITE_SHORT_FIELD |
5988 #undef READ_BYTE_FIELD | 6018 #undef READ_BYTE_FIELD |
5989 #undef WRITE_BYTE_FIELD | 6019 #undef WRITE_BYTE_FIELD |
5990 | 6020 |
5991 | 6021 |
5992 } } // namespace v8::internal | 6022 } } // namespace v8::internal |
5993 | 6023 |
5994 #endif // V8_OBJECTS_INL_H_ | 6024 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |