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 <memory> | 9 #include <memory> |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 12100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12111 void JSFunction::EnsureLiterals(Handle<JSFunction> function) { | 12111 void JSFunction::EnsureLiterals(Handle<JSFunction> function) { |
12112 Handle<SharedFunctionInfo> shared(function->shared()); | 12112 Handle<SharedFunctionInfo> shared(function->shared()); |
12113 Isolate* isolate = shared->GetIsolate(); | 12113 Isolate* isolate = shared->GetIsolate(); |
12114 | 12114 |
12115 FeedbackVectorState state = function->GetFeedbackVectorState(isolate); | 12115 FeedbackVectorState state = function->GetFeedbackVectorState(isolate); |
12116 switch (state) { | 12116 switch (state) { |
12117 case TOP_LEVEL_SCRIPT_NEEDS_VECTOR: { | 12117 case TOP_LEVEL_SCRIPT_NEEDS_VECTOR: { |
12118 // A top level script didn't get it's literals installed. | 12118 // A top level script didn't get it's literals installed. |
12119 Handle<FeedbackVector> feedback_vector = | 12119 Handle<FeedbackVector> feedback_vector = |
12120 FeedbackVector::New(isolate, shared); | 12120 FeedbackVector::New(isolate, shared); |
12121 Handle<Cell> new_cell = isolate->factory()->NewCell(feedback_vector); | 12121 Handle<Cell> new_cell = |
| 12122 isolate->factory()->NewOneClosureCell(feedback_vector); |
12122 function->set_feedback_vector_cell(*new_cell); | 12123 function->set_feedback_vector_cell(*new_cell); |
12123 break; | 12124 break; |
12124 } | 12125 } |
12125 case NEEDS_VECTOR: { | 12126 case NEEDS_VECTOR: { |
12126 Handle<FeedbackVector> feedback_vector = | 12127 Handle<FeedbackVector> feedback_vector = |
12127 FeedbackVector::New(isolate, shared); | 12128 FeedbackVector::New(isolate, shared); |
12128 function->feedback_vector_cell()->set_value(*feedback_vector); | 12129 function->feedback_vector_cell()->set_value(*feedback_vector); |
12129 break; | 12130 break; |
12130 } | 12131 } |
12131 case HAS_VECTOR: | 12132 case HAS_VECTOR: |
(...skipping 8061 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
20193 // depend on this. | 20194 // depend on this. |
20194 return DICTIONARY_ELEMENTS; | 20195 return DICTIONARY_ELEMENTS; |
20195 } | 20196 } |
20196 DCHECK_LE(kind, LAST_ELEMENTS_KIND); | 20197 DCHECK_LE(kind, LAST_ELEMENTS_KIND); |
20197 return kind; | 20198 return kind; |
20198 } | 20199 } |
20199 } | 20200 } |
20200 | 20201 |
20201 } // namespace internal | 20202 } // namespace internal |
20202 } // namespace v8 | 20203 } // namespace v8 |
OLD | NEW |