OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 11930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11941 default: | 11941 default: |
11942 return false; | 11942 return false; |
11943 } | 11943 } |
11944 } | 11944 } |
11945 | 11945 |
11946 } // namespace | 11946 } // namespace |
11947 #endif | 11947 #endif |
11948 | 11948 |
11949 | 11949 |
11950 void JSFunction::EnsureHasInitialMap(Handle<JSFunction> function) { | 11950 void JSFunction::EnsureHasInitialMap(Handle<JSFunction> function) { |
11951 DCHECK(function->IsConstructor() || function->shared()->is_generator()); | 11951 DCHECK(function->IsConstructor() || function->shared()->is_resumable()); |
11952 if (function->has_initial_map()) return; | 11952 if (function->has_initial_map()) return; |
11953 Isolate* isolate = function->GetIsolate(); | 11953 Isolate* isolate = function->GetIsolate(); |
11954 | 11954 |
11955 // The constructor should be compiled for the optimization hints to be | 11955 // The constructor should be compiled for the optimization hints to be |
11956 // available. | 11956 // available. |
11957 Compiler::Compile(function, Compiler::CLEAR_EXCEPTION); | 11957 Compiler::Compile(function, Compiler::CLEAR_EXCEPTION); |
11958 | 11958 |
11959 // First create a new map with the size and number of in-object properties | 11959 // First create a new map with the size and number of in-object properties |
11960 // suggested by the function. | 11960 // suggested by the function. |
11961 InstanceType instance_type; | 11961 InstanceType instance_type; |
11962 if (function->shared()->is_generator()) { | 11962 if (function->shared()->is_resumable()) { |
11963 instance_type = JS_GENERATOR_OBJECT_TYPE; | 11963 instance_type = JS_GENERATOR_OBJECT_TYPE; |
11964 } else { | 11964 } else { |
11965 instance_type = JS_OBJECT_TYPE; | 11965 instance_type = JS_OBJECT_TYPE; |
11966 } | 11966 } |
11967 int instance_size; | 11967 int instance_size; |
11968 int in_object_properties; | 11968 int in_object_properties; |
11969 function->CalculateInstanceSize(instance_type, 0, &instance_size, | 11969 function->CalculateInstanceSize(instance_type, 0, &instance_size, |
11970 &in_object_properties); | 11970 &in_object_properties); |
11971 | 11971 |
11972 Handle<Map> map = isolate->factory()->NewMap(instance_type, instance_size); | 11972 Handle<Map> map = isolate->factory()->NewMap(instance_type, instance_size); |
(...skipping 6320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
18293 if (cell->value() != *new_value) { | 18293 if (cell->value() != *new_value) { |
18294 cell->set_value(*new_value); | 18294 cell->set_value(*new_value); |
18295 Isolate* isolate = cell->GetIsolate(); | 18295 Isolate* isolate = cell->GetIsolate(); |
18296 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 18296 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
18297 isolate, DependentCode::kPropertyCellChangedGroup); | 18297 isolate, DependentCode::kPropertyCellChangedGroup); |
18298 } | 18298 } |
18299 } | 18299 } |
18300 | 18300 |
18301 } // namespace internal | 18301 } // namespace internal |
18302 } // namespace v8 | 18302 } // namespace v8 |
OLD | NEW |