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

Side by Side Diff: src/objects.cc

Issue 955433002: Prototype objects never share their map, and hence cannot be in deprecated state. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 months 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') | no next file » | 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 <sstream> 5 #include <sstream>
6 6
7 #include "src/v8.h" 7 #include "src/v8.h"
8 8
9 #include "src/accessors.h" 9 #include "src/accessors.h"
10 #include "src/allocation-site-scopes.h" 10 #include "src/allocation-site-scopes.h"
(...skipping 2913 matching lines...) Expand 10 before | Expand all | Expand 10 after
2924 map = ReconfigureProperty(map, i, kData, details.attributes(), 2924 map = ReconfigureProperty(map, i, kData, details.attributes(),
2925 Representation::Tagged(), 2925 Representation::Tagged(),
2926 HeapType::Any(map->GetIsolate()), FORCE_FIELD); 2926 HeapType::Any(map->GetIsolate()), FORCE_FIELD);
2927 } 2927 }
2928 } 2928 }
2929 return map; 2929 return map;
2930 } 2930 }
2931 2931
2932 2932
2933 // static 2933 // static
2934 MaybeHandle<Map> Map::TryUpdate(Handle<Map> map) { 2934 MaybeHandle<Map> Map::TryUpdate(Handle<Map> old_map) {
2935 Handle<Map> proto_map(map);
2936 while (proto_map->prototype()->IsJSObject()) {
2937 Handle<JSObject> holder(JSObject::cast(proto_map->prototype()));
2938 proto_map = Handle<Map>(holder->map());
2939 if (proto_map->is_deprecated() && JSObject::TryMigrateInstance(holder)) {
2940 proto_map = Handle<Map>(holder->map());
2941 }
2942 }
2943 return TryUpdateInternal(map);
2944 }
2945
2946
2947 // static
2948 Handle<Map> Map::Update(Handle<Map> map) {
2949 if (!map->is_deprecated()) return map;
2950 return ReconfigureProperty(map, -1, kData, NONE, Representation::None(),
2951 HeapType::None(map->GetIsolate()),
2952 ALLOW_IN_DESCRIPTOR);
2953 }
2954
2955
2956 // static
2957 MaybeHandle<Map> Map::TryUpdateInternal(Handle<Map> old_map) {
2958 DisallowHeapAllocation no_allocation; 2935 DisallowHeapAllocation no_allocation;
2959 DisallowDeoptimization no_deoptimization(old_map->GetIsolate()); 2936 DisallowDeoptimization no_deoptimization(old_map->GetIsolate());
2960 2937
2961 if (!old_map->is_deprecated()) return old_map; 2938 if (!old_map->is_deprecated()) return old_map;
2962 2939
2963 // Check the state of the root map. 2940 // Check the state of the root map.
2964 Map* root_map = old_map->FindRootMap(); 2941 Map* root_map = old_map->FindRootMap();
2965 if (!old_map->EquivalentToForTransition(root_map)) return MaybeHandle<Map>(); 2942 if (!old_map->EquivalentToForTransition(root_map)) return MaybeHandle<Map>();
2966 int root_nof = root_map->NumberOfOwnDescriptors(); 2943 int root_nof = root_map->NumberOfOwnDescriptors();
2967 2944
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
3011 return MaybeHandle<Map>(); 2988 return MaybeHandle<Map>();
3012 } 2989 }
3013 break; 2990 break;
3014 } 2991 }
3015 } 2992 }
3016 if (new_map->NumberOfOwnDescriptors() != old_nof) return MaybeHandle<Map>(); 2993 if (new_map->NumberOfOwnDescriptors() != old_nof) return MaybeHandle<Map>();
3017 return handle(new_map); 2994 return handle(new_map);
3018 } 2995 }
3019 2996
3020 2997
2998 // static
2999 Handle<Map> Map::Update(Handle<Map> map) {
3000 if (!map->is_deprecated()) return map;
3001 return ReconfigureProperty(map, -1, kData, NONE, Representation::None(),
3002 HeapType::None(map->GetIsolate()),
3003 ALLOW_IN_DESCRIPTOR);
3004 }
3005
3006
3021 MaybeHandle<Object> JSObject::SetPropertyWithInterceptor(LookupIterator* it, 3007 MaybeHandle<Object> JSObject::SetPropertyWithInterceptor(LookupIterator* it,
3022 Handle<Object> value) { 3008 Handle<Object> value) {
3023 Handle<Name> name = it->name(); 3009 Handle<Name> name = it->name();
3024 Handle<JSObject> holder = it->GetHolder<JSObject>(); 3010 Handle<JSObject> holder = it->GetHolder<JSObject>();
3025 Handle<InterceptorInfo> interceptor(holder->GetNamedInterceptor()); 3011 Handle<InterceptorInfo> interceptor(holder->GetNamedInterceptor());
3026 if (interceptor->setter()->IsUndefined() || 3012 if (interceptor->setter()->IsUndefined() ||
3027 (name->IsSymbol() && !interceptor->can_intercept_symbols())) { 3013 (name->IsSymbol() && !interceptor->can_intercept_symbols())) {
3028 return MaybeHandle<Object>(); 3014 return MaybeHandle<Object>();
3029 } 3015 }
3030 3016
(...skipping 14313 matching lines...) Expand 10 before | Expand all | Expand 10 after
17344 CompilationInfo* info) { 17330 CompilationInfo* info) {
17345 Handle<DependentCode> codes = DependentCode::InsertCompilationInfo( 17331 Handle<DependentCode> codes = DependentCode::InsertCompilationInfo(
17346 handle(cell->dependent_code(), info->isolate()), 17332 handle(cell->dependent_code(), info->isolate()),
17347 DependentCode::kPropertyCellChangedGroup, info->object_wrapper()); 17333 DependentCode::kPropertyCellChangedGroup, info->object_wrapper());
17348 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); 17334 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes);
17349 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( 17335 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add(
17350 cell, info->zone()); 17336 cell, info->zone());
17351 } 17337 }
17352 17338
17353 } } // namespace v8::internal 17339 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698