OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 #include "src/objects.h" | 5 #include "src/objects.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <iomanip> | 8 #include <iomanip> |
9 #include <sstream> | 9 #include <sstream> |
10 | 10 |
(...skipping 13620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13631 // Check that the function has a script associated with it. | 13631 // Check that the function has a script associated with it. |
13632 if (!script()->IsScript()) return false; | 13632 if (!script()->IsScript()) return false; |
13633 return !optimization_disabled(); | 13633 return !optimization_disabled(); |
13634 } | 13634 } |
13635 | 13635 |
13636 | 13636 |
13637 int SharedFunctionInfo::SourceSize() { | 13637 int SharedFunctionInfo::SourceSize() { |
13638 return end_position() - start_position(); | 13638 return end_position() - start_position(); |
13639 } | 13639 } |
13640 | 13640 |
13641 | 13641 void JSFunction::CalculateInstanceSizeHelper(InstanceType instance_type, |
13642 namespace { | 13642 int requested_internal_fields, |
13643 | 13643 int requested_in_object_properties, |
13644 void CalculateInstanceSizeHelper(InstanceType instance_type, | 13644 int* instance_size, |
13645 int requested_internal_fields, | 13645 int* in_object_properties) { |
13646 int requested_in_object_properties, | |
13647 int* instance_size, | |
13648 int* in_object_properties) { | |
13649 int header_size = JSObject::GetHeaderSize(instance_type); | 13646 int header_size = JSObject::GetHeaderSize(instance_type); |
13650 DCHECK_LE(requested_internal_fields, | 13647 DCHECK_LE(requested_internal_fields, |
13651 (JSObject::kMaxInstanceSize - header_size) >> kPointerSizeLog2); | 13648 (JSObject::kMaxInstanceSize - header_size) >> kPointerSizeLog2); |
13652 *instance_size = | 13649 *instance_size = |
13653 Min(header_size + | 13650 Min(header_size + |
13654 ((requested_internal_fields + requested_in_object_properties) | 13651 ((requested_internal_fields + requested_in_object_properties) |
13655 << kPointerSizeLog2), | 13652 << kPointerSizeLog2), |
13656 JSObject::kMaxInstanceSize); | 13653 JSObject::kMaxInstanceSize); |
13657 *in_object_properties = ((*instance_size - header_size) >> kPointerSizeLog2) - | 13654 *in_object_properties = ((*instance_size - header_size) >> kPointerSizeLog2) - |
13658 requested_internal_fields; | 13655 requested_internal_fields; |
13659 } | 13656 } |
13660 | 13657 |
13661 } // namespace | |
13662 | |
13663 | 13658 |
13664 void JSFunction::CalculateInstanceSize(InstanceType instance_type, | 13659 void JSFunction::CalculateInstanceSize(InstanceType instance_type, |
13665 int requested_internal_fields, | 13660 int requested_internal_fields, |
13666 int* instance_size, | 13661 int* instance_size, |
13667 int* in_object_properties) { | 13662 int* in_object_properties) { |
13668 CalculateInstanceSizeHelper(instance_type, requested_internal_fields, | 13663 CalculateInstanceSizeHelper(instance_type, requested_internal_fields, |
13669 shared()->expected_nof_properties(), | 13664 shared()->expected_nof_properties(), |
13670 instance_size, in_object_properties); | 13665 instance_size, in_object_properties); |
13671 } | 13666 } |
13672 | 13667 |
(...skipping 6173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
19846 if (cell->value() != *new_value) { | 19841 if (cell->value() != *new_value) { |
19847 cell->set_value(*new_value); | 19842 cell->set_value(*new_value); |
19848 Isolate* isolate = cell->GetIsolate(); | 19843 Isolate* isolate = cell->GetIsolate(); |
19849 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 19844 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
19850 isolate, DependentCode::kPropertyCellChangedGroup); | 19845 isolate, DependentCode::kPropertyCellChangedGroup); |
19851 } | 19846 } |
19852 } | 19847 } |
19853 | 19848 |
19854 } // namespace internal | 19849 } // namespace internal |
19855 } // namespace v8 | 19850 } // namespace v8 |
OLD | NEW |