| Index: src/type-info.cc
|
| diff --git a/src/type-info.cc b/src/type-info.cc
|
| index 790d77cb19cd55b49a122d4ead43d4c69586e767..78627133aefb9c1e27c9929fe08ed3b8361f11c3 100644
|
| --- a/src/type-info.cc
|
| +++ b/src/type-info.cc
|
| @@ -140,6 +140,12 @@ bool TypeFeedbackOracle::CallIsMonomorphic(Call* expr) {
|
| }
|
|
|
|
|
| +bool TypeFeedbackOracle::CallNewIsMonomorphic(CallNew* expr) {
|
| + Handle<Object> value = GetInfo(expr->id());
|
| + return value->IsJSFunction();
|
| +}
|
| +
|
| +
|
| Handle<Map> TypeFeedbackOracle::LoadMonomorphicReceiverType(Property* expr) {
|
| ASSERT(LoadIsMonomorphicNormal(expr));
|
| Handle<Object> map_or_code = GetInfo(expr->id());
|
| @@ -541,6 +547,7 @@ void TypeFeedbackOracle::BuildDictionary(Handle<Code> code) {
|
| GetRelocInfos(code, &infos);
|
| CreateDictionary(code, &infos);
|
| ProcessRelocInfos(&infos);
|
| + ProcessCacheCells(code);
|
| // Allocate handle in the parent scope.
|
| dictionary_ = scope.CloseAndEscape(dictionary_);
|
| }
|
| @@ -619,18 +626,6 @@ void TypeFeedbackOracle::ProcessRelocInfos(ZoneList<RelocInfo>* infos) {
|
| SetInfo(ast_id, target);
|
| break;
|
|
|
| - case Code::STUB:
|
| - if (target->major_key() == CodeStub::CallFunction &&
|
| - target->has_function_cache()) {
|
| - Object* value = CallFunctionStub::GetCachedValue(reloc_entry.pc());
|
| - if (value->IsJSFunction() &&
|
| - !CanRetainOtherContext(JSFunction::cast(value),
|
| - *global_context_)) {
|
| - SetInfo(ast_id, value);
|
| - }
|
| - }
|
| - break;
|
| -
|
| default:
|
| break;
|
| }
|
| @@ -638,6 +633,20 @@ void TypeFeedbackOracle::ProcessRelocInfos(ZoneList<RelocInfo>* infos) {
|
| }
|
|
|
|
|
| +void TypeFeedbackOracle::ProcessCacheCells(Handle<Code> code) {
|
| + Handle<CacheCells> cache(code->cache_cells());
|
| + for (int i = 0; i < cache->CellCount(); i++) {
|
| + unsigned ast_id = cache->AstId(i)->value();
|
| + Object* value = cache->Cell(i)->value();
|
| + if (value->IsJSFunction() &&
|
| + !CanRetainOtherContext(JSFunction::cast(value),
|
| + *global_context_)) {
|
| + SetInfo(ast_id, value);
|
| + }
|
| + }
|
| +}
|
| +
|
| +
|
| void TypeFeedbackOracle::SetInfo(unsigned ast_id, Object* target) {
|
| ASSERT(dictionary_->FindEntry(ast_id) == NumberDictionary::kNotFound);
|
| MaybeObject* maybe_result = dictionary_->AtNumberPut(ast_id, target);
|
|
|