Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1023)

Side by Side Diff: src/objects.cc

Issue 1422773007: Make JSFunction::BodyDescriptor the only single place that knows how to iterate JSFunction's body. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressing comments Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 10942 matching lines...) Expand 10 before | Expand all | Expand 10 after
10953 10953
10954 bool Map::EquivalentToForNormalization(Map* other, 10954 bool Map::EquivalentToForNormalization(Map* other,
10955 PropertyNormalizationMode mode) { 10955 PropertyNormalizationMode mode) {
10956 int properties = 10956 int properties =
10957 mode == CLEAR_INOBJECT_PROPERTIES ? 0 : other->GetInObjectProperties(); 10957 mode == CLEAR_INOBJECT_PROPERTIES ? 0 : other->GetInObjectProperties();
10958 return CheckEquivalent(this, other) && bit_field2() == other->bit_field2() && 10958 return CheckEquivalent(this, other) && bit_field2() == other->bit_field2() &&
10959 GetInObjectProperties() == properties; 10959 GetInObjectProperties() == properties;
10960 } 10960 }
10961 10961
10962 10962
10963 void JSFunction::JSFunctionIterateBody(int object_size, ObjectVisitor* v) {
10964 // Iterate over all fields in the body but take care in dealing with
10965 // the code entry.
10966 IteratePointers(v, kPropertiesOffset, kCodeEntryOffset);
10967 v->VisitCodeEntry(this->address() + kCodeEntryOffset);
10968 IteratePointers(v, kCodeEntryOffset + kPointerSize, object_size);
10969 }
10970
10971
10972 bool JSFunction::Inlines(SharedFunctionInfo* candidate) { 10963 bool JSFunction::Inlines(SharedFunctionInfo* candidate) {
10973 DisallowHeapAllocation no_gc; 10964 DisallowHeapAllocation no_gc;
10974 if (shared() == candidate) return true; 10965 if (shared() == candidate) return true;
10975 if (code()->kind() != Code::OPTIMIZED_FUNCTION) return false; 10966 if (code()->kind() != Code::OPTIMIZED_FUNCTION) return false;
10976 DeoptimizationInputData* const data = 10967 DeoptimizationInputData* const data =
10977 DeoptimizationInputData::cast(code()->deoptimization_data()); 10968 DeoptimizationInputData::cast(code()->deoptimization_data());
10978 if (data->length() == 0) return false; 10969 if (data->length() == 0) return false;
10979 FixedArray* const literals = data->LiteralArray(); 10970 FixedArray* const literals = data->LiteralArray();
10980 int const inlined_count = data->InlinedFunctionCount()->value(); 10971 int const inlined_count = data->InlinedFunctionCount()->value();
10981 for (int i = 0; i < inlined_count; ++i) { 10972 for (int i = 0; i < inlined_count; ++i) {
(...skipping 6898 matching lines...) Expand 10 before | Expand all | Expand 10 after
17880 if (cell->value() != *new_value) { 17871 if (cell->value() != *new_value) {
17881 cell->set_value(*new_value); 17872 cell->set_value(*new_value);
17882 Isolate* isolate = cell->GetIsolate(); 17873 Isolate* isolate = cell->GetIsolate();
17883 cell->dependent_code()->DeoptimizeDependentCodeGroup( 17874 cell->dependent_code()->DeoptimizeDependentCodeGroup(
17884 isolate, DependentCode::kPropertyCellChangedGroup); 17875 isolate, DependentCode::kPropertyCellChangedGroup);
17885 } 17876 }
17886 } 17877 }
17887 17878
17888 } // namespace internal 17879 } // namespace internal
17889 } // namespace v8 17880 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698