OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/type-info.h" | 5 #include "src/type-info.h" |
6 | 6 |
7 #include "src/ast/ast.h" | 7 #include "src/ast/ast.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/compiler.h" | 9 #include "src/compiler.h" |
10 #include "src/ic/ic.h" | 10 #include "src/ic/ic.h" |
11 #include "src/ic/stub-cache.h" | 11 #include "src/ic/stub-cache.h" |
12 #include "src/objects-inl.h" | 12 #include "src/objects-inl.h" |
13 | 13 |
14 namespace v8 { | 14 namespace v8 { |
15 namespace internal { | 15 namespace internal { |
16 | 16 |
17 | 17 |
18 TypeFeedbackOracle::TypeFeedbackOracle( | 18 TypeFeedbackOracle::TypeFeedbackOracle( |
19 Isolate* isolate, Zone* zone, Handle<Code> code, | 19 Isolate* isolate, Zone* zone, Handle<Code> code, |
20 Handle<TypeFeedbackVector> feedback_vector, Handle<Context> native_context) | 20 Handle<TypeFeedbackVector> feedback_vector, Handle<Context> native_context) |
21 : native_context_(native_context), isolate_(isolate), zone_(zone) { | 21 : native_context_(native_context), isolate_(isolate), zone_(zone) { |
22 BuildDictionary(code); | 22 BuildDictionary(code); |
23 DCHECK(dictionary_->IsDictionary()); | 23 DCHECK(dictionary_->IsUnseededNumberDictionary()); |
24 // We make a copy of the feedback vector because a GC could clear | 24 // We make a copy of the feedback vector because a GC could clear |
25 // the type feedback info contained therein. | 25 // the type feedback info contained therein. |
26 // TODO(mvstanton): revisit the decision to copy when we weakly | 26 // TODO(mvstanton): revisit the decision to copy when we weakly |
27 // traverse the feedback vector at GC time. | 27 // traverse the feedback vector at GC time. |
28 feedback_vector_ = TypeFeedbackVector::Copy(isolate, feedback_vector); | 28 feedback_vector_ = TypeFeedbackVector::Copy(isolate, feedback_vector); |
29 } | 29 } |
30 | 30 |
31 | 31 |
32 static uint32_t IdToKey(TypeFeedbackId ast_id) { | 32 static uint32_t IdToKey(TypeFeedbackId ast_id) { |
33 return static_cast<uint32_t>(ast_id.ToInt()); | 33 return static_cast<uint32_t>(ast_id.ToInt()); |
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 // Dictionary has been allocated with sufficient size for all elements. | 467 // Dictionary has been allocated with sufficient size for all elements. |
468 DisallowHeapAllocation no_need_to_resize_dictionary; | 468 DisallowHeapAllocation no_need_to_resize_dictionary; |
469 HandleScope scope(isolate()); | 469 HandleScope scope(isolate()); |
470 USE(UnseededNumberDictionary::AtNumberPut( | 470 USE(UnseededNumberDictionary::AtNumberPut( |
471 dictionary_, IdToKey(ast_id), handle(target, isolate()))); | 471 dictionary_, IdToKey(ast_id), handle(target, isolate()))); |
472 } | 472 } |
473 | 473 |
474 | 474 |
475 } // namespace internal | 475 } // namespace internal |
476 } // namespace v8 | 476 } // namespace v8 |
OLD | NEW |