OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |