| 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/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/ast.h" | 7 #include "src/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/macro-assembler.h" | |
| 13 #include "src/type-info.h" | 12 #include "src/type-info.h" |
| 14 | 13 |
| 15 #include "src/objects-inl.h" | |
| 16 | |
| 17 namespace v8 { | 14 namespace v8 { |
| 18 namespace internal { | 15 namespace internal { |
| 19 | 16 |
| 20 | 17 |
| 21 TypeFeedbackOracle::TypeFeedbackOracle( | 18 TypeFeedbackOracle::TypeFeedbackOracle( |
| 22 Handle<Code> code, Handle<TypeFeedbackVector> feedback_vector, | 19 Handle<Code> code, Handle<TypeFeedbackVector> feedback_vector, |
| 23 Handle<Context> native_context, Zone* zone) | 20 Handle<Context> native_context, Zone* zone) |
| 24 : native_context_(native_context), zone_(zone) { | 21 : native_context_(native_context), zone_(zone) { |
| 25 BuildDictionary(code); | 22 BuildDictionary(code); |
| 26 DCHECK(dictionary_->IsDictionary()); | 23 DCHECK(dictionary_->IsDictionary()); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 | 71 |
| 75 | 72 |
| 76 bool TypeFeedbackOracle::StoreIsUninitialized(TypeFeedbackId ast_id) { | 73 bool TypeFeedbackOracle::StoreIsUninitialized(TypeFeedbackId ast_id) { |
| 77 Handle<Object> maybe_code = GetInfo(ast_id); | 74 Handle<Object> maybe_code = GetInfo(ast_id); |
| 78 if (!maybe_code->IsCode()) return false; | 75 if (!maybe_code->IsCode()) return false; |
| 79 Handle<Code> code = Handle<Code>::cast(maybe_code); | 76 Handle<Code> code = Handle<Code>::cast(maybe_code); |
| 80 return code->ic_state() == UNINITIALIZED; | 77 return code->ic_state() == UNINITIALIZED; |
| 81 } | 78 } |
| 82 | 79 |
| 83 | 80 |
| 84 bool TypeFeedbackOracle::StoreIsKeyedPolymorphic(TypeFeedbackId ast_id) { | |
| 85 Handle<Object> maybe_code = GetInfo(ast_id); | |
| 86 if (maybe_code->IsCode()) { | |
| 87 Handle<Code> code = Handle<Code>::cast(maybe_code); | |
| 88 return code->is_keyed_store_stub() && | |
| 89 code->ic_state() == POLYMORPHIC; | |
| 90 } | |
| 91 return false; | |
| 92 } | |
| 93 | |
| 94 | |
| 95 bool TypeFeedbackOracle::CallIsMonomorphic(int slot) { | 81 bool TypeFeedbackOracle::CallIsMonomorphic(int slot) { |
| 96 Handle<Object> value = GetInfo(slot); | 82 Handle<Object> value = GetInfo(slot); |
| 97 return value->IsAllocationSite() || value->IsJSFunction(); | 83 return value->IsAllocationSite() || value->IsJSFunction(); |
| 98 } | 84 } |
| 99 | 85 |
| 100 | 86 |
| 101 bool TypeFeedbackOracle::CallNewIsMonomorphic(int slot) { | 87 bool TypeFeedbackOracle::CallNewIsMonomorphic(int slot) { |
| 102 Handle<Object> info = GetInfo(slot); | 88 Handle<Object> info = GetInfo(slot); |
| 103 return FLAG_pretenuring_call_new | 89 return FLAG_pretenuring_call_new |
| 104 ? info->IsJSFunction() | 90 ? info->IsJSFunction() |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 UnseededNumberDictionary::kNotFound); | 447 UnseededNumberDictionary::kNotFound); |
| 462 // Dictionary has been allocated with sufficient size for all elements. | 448 // Dictionary has been allocated with sufficient size for all elements. |
| 463 DisallowHeapAllocation no_need_to_resize_dictionary; | 449 DisallowHeapAllocation no_need_to_resize_dictionary; |
| 464 HandleScope scope(isolate()); | 450 HandleScope scope(isolate()); |
| 465 USE(UnseededNumberDictionary::AtNumberPut( | 451 USE(UnseededNumberDictionary::AtNumberPut( |
| 466 dictionary_, IdToKey(ast_id), handle(target, isolate()))); | 452 dictionary_, IdToKey(ast_id), handle(target, isolate()))); |
| 467 } | 453 } |
| 468 | 454 |
| 469 | 455 |
| 470 } } // namespace v8::internal | 456 } } // namespace v8::internal |
| OLD | NEW |