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

Side by Side Diff: src/objects.cc

Issue 1145213005: [strong] cache strong object literal maps (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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
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 <iomanip> 5 #include <iomanip>
6 #include <sstream> 6 #include <sstream>
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/accessors.h" 10 #include "src/accessors.h"
(...skipping 10351 matching lines...) Expand 10 before | Expand all | Expand 10 after
10362 // updated initial maps (and transitioned versions) in the native context. 10362 // updated initial maps (and transitioned versions) in the native context.
10363 Handle<Context> native_context(function->context()->native_context(), 10363 Handle<Context> native_context(function->context()->native_context(),
10364 isolate); 10364 isolate);
10365 Handle<Object> array_function( 10365 Handle<Object> array_function(
10366 native_context->get(Context::ARRAY_FUNCTION_INDEX), isolate); 10366 native_context->get(Context::ARRAY_FUNCTION_INDEX), isolate);
10367 if (array_function->IsJSFunction() && 10367 if (array_function->IsJSFunction() &&
10368 *function == JSFunction::cast(*array_function)) { 10368 *function == JSFunction::cast(*array_function)) {
10369 CacheInitialJSArrayMaps(native_context, new_map); 10369 CacheInitialJSArrayMaps(native_context, new_map);
10370 Handle<Map> new_strong_map = 10370 Handle<Map> new_strong_map =
10371 Map::Copy(initial_map, "SetInstancePrototype"); 10371 Map::Copy(initial_map, "SetInstancePrototype");
10372 new_strong_map->set_is_strong(true); 10372 new_strong_map->set_is_strong();
10373 CacheInitialJSArrayMaps(native_context, new_strong_map); 10373 CacheInitialJSArrayMaps(native_context, new_strong_map);
10374 } 10374 }
10375 } 10375 }
10376 10376
10377 // Deoptimize all code that embeds the previous initial map. 10377 // Deoptimize all code that embeds the previous initial map.
10378 initial_map->dependent_code()->DeoptimizeDependentCodeGroup( 10378 initial_map->dependent_code()->DeoptimizeDependentCodeGroup(
10379 isolate, DependentCode::kInitialMapChangedGroup); 10379 isolate, DependentCode::kInitialMapChangedGroup);
10380 } else { 10380 } else {
10381 // Put the value in the initial map field until an initial map is 10381 // Put the value in the initial map field until an initial map is
10382 // needed. At that point, a new initial map is created and the 10382 // needed. At that point, a new initial map is created and the
(...skipping 6870 matching lines...) Expand 10 before | Expand all | Expand 10 after
17253 void PropertyCell::SetValueWithInvalidation(Handle<PropertyCell> cell, 17253 void PropertyCell::SetValueWithInvalidation(Handle<PropertyCell> cell,
17254 Handle<Object> new_value) { 17254 Handle<Object> new_value) {
17255 if (cell->value() != *new_value) { 17255 if (cell->value() != *new_value) {
17256 cell->set_value(*new_value); 17256 cell->set_value(*new_value);
17257 Isolate* isolate = cell->GetIsolate(); 17257 Isolate* isolate = cell->GetIsolate();
17258 cell->dependent_code()->DeoptimizeDependentCodeGroup( 17258 cell->dependent_code()->DeoptimizeDependentCodeGroup(
17259 isolate, DependentCode::kPropertyCellChangedGroup); 17259 isolate, DependentCode::kPropertyCellChangedGroup);
17260 } 17260 }
17261 } 17261 }
17262 } } // namespace v8::internal 17262 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | test/mjsunit/strong/literals.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698