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

Side by Side Diff: src/objects.cc

Issue 1490003003: Don't EnsureHasInitialMap on non-constructors (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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/crankshaft/hydrogen.cc ('k') | test/mjsunit/regress/regress-ensure-initial-map.js » ('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 12185 matching lines...) Expand 10 before | Expand all | Expand 10 after
12196 default: 12196 default:
12197 return false; 12197 return false;
12198 } 12198 }
12199 } 12199 }
12200 12200
12201 } // namespace 12201 } // namespace
12202 #endif 12202 #endif
12203 12203
12204 12204
12205 void JSFunction::EnsureHasInitialMap(Handle<JSFunction> function) { 12205 void JSFunction::EnsureHasInitialMap(Handle<JSFunction> function) {
12206 DCHECK(function->IsConstructor() || function->shared()->is_generator());
12206 if (function->has_initial_map()) return; 12207 if (function->has_initial_map()) return;
12207 Isolate* isolate = function->GetIsolate(); 12208 Isolate* isolate = function->GetIsolate();
12208 12209
12209 // First create a new map with the size and number of in-object properties 12210 // First create a new map with the size and number of in-object properties
12210 // suggested by the function. 12211 // suggested by the function.
12211 InstanceType instance_type; 12212 InstanceType instance_type;
12212 if (function->shared()->is_generator()) { 12213 if (function->shared()->is_generator()) {
12213 instance_type = JS_GENERATOR_OBJECT_TYPE; 12214 instance_type = JS_GENERATOR_OBJECT_TYPE;
12214 } else { 12215 } else {
12215 instance_type = JS_OBJECT_TYPE; 12216 instance_type = JS_OBJECT_TYPE;
(...skipping 6431 matching lines...) Expand 10 before | Expand all | Expand 10 after
18647 if (cell->value() != *new_value) { 18648 if (cell->value() != *new_value) {
18648 cell->set_value(*new_value); 18649 cell->set_value(*new_value);
18649 Isolate* isolate = cell->GetIsolate(); 18650 Isolate* isolate = cell->GetIsolate();
18650 cell->dependent_code()->DeoptimizeDependentCodeGroup( 18651 cell->dependent_code()->DeoptimizeDependentCodeGroup(
18651 isolate, DependentCode::kPropertyCellChangedGroup); 18652 isolate, DependentCode::kPropertyCellChangedGroup);
18652 } 18653 }
18653 } 18654 }
18654 18655
18655 } // namespace internal 18656 } // namespace internal
18656 } // namespace v8 18657 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/hydrogen.cc ('k') | test/mjsunit/regress/regress-ensure-initial-map.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698