Index: src/type-info.cc |
=================================================================== |
--- src/type-info.cc (revision 7267) |
+++ src/type-info.cc (working copy) |
@@ -73,7 +73,7 @@ |
int entry = dictionary_->FindEntry(pos); |
return entry != NumberDictionary::kNotFound |
? Handle<Object>(dictionary_->ValueAt(entry)) |
- : Factory::undefined_value(); |
+ : Isolate::Current()->factory()->undefined_value(); |
} |
@@ -207,7 +207,8 @@ |
bool TypeFeedbackOracle::LoadIsBuiltin(Property* expr, Builtins::Name id) { |
- return *GetInfo(expr->position()) == Builtins::builtin(id); |
+ return *GetInfo(expr->position()) == |
+ Isolate::Current()->builtins()->builtin(id); |
} |
@@ -330,10 +331,11 @@ |
ZoneMapList* TypeFeedbackOracle::CollectReceiverTypes(int position, |
Handle<String> name, |
Code::Flags flags) { |
+ Isolate* isolate = Isolate::Current(); |
Handle<Object> object = GetInfo(position); |
if (object->IsUndefined() || object->IsSmi()) return NULL; |
- if (*object == Builtins::builtin(Builtins::StoreIC_GlobalProxy)) { |
+ if (*object == isolate->builtins()->builtin(Builtins::StoreIC_GlobalProxy)) { |
// TODO(fschneider): We could collect the maps and signal that |
// we need a generic store (or load) here. |
ASSERT(Handle<Code>::cast(object)->ic_state() == MEGAMORPHIC); |
@@ -345,7 +347,7 @@ |
} else if (Handle<Code>::cast(object)->ic_state() == MEGAMORPHIC) { |
ZoneMapList* types = new ZoneMapList(4); |
ASSERT(object->IsCode()); |
- StubCache::CollectMatchingMaps(types, *name, flags); |
+ isolate->stub_cache()->CollectMatchingMaps(types, *name, flags); |
return types->length() > 0 ? types : NULL; |
} else { |
return NULL; |
@@ -354,7 +356,8 @@ |
void TypeFeedbackOracle::PopulateMap(Handle<Code> code) { |
- HandleScope scope; |
+ Isolate* isolate = Isolate::Current(); |
+ HandleScope scope(isolate); |
const int kInitialCapacity = 16; |
List<int> code_positions(kInitialCapacity); |
@@ -362,12 +365,13 @@ |
CollectPositions(*code, &code_positions, &source_positions); |
ASSERT(dictionary_.is_null()); // Only initialize once. |
- dictionary_ = Factory::NewNumberDictionary(code_positions.length()); |
+ dictionary_ = isolate->factory()->NewNumberDictionary( |
+ code_positions.length()); |
int length = code_positions.length(); |
ASSERT(source_positions.length() == length); |
for (int i = 0; i < length; i++) { |
- HandleScope loop_scope; |
+ HandleScope loop_scope(isolate); |
RelocInfo info(code->instruction_start() + code_positions[i], |
RelocInfo::CODE_TARGET, 0); |
Handle<Code> target(Code::GetCodeFromTargetAddress(info.target_address())); |
@@ -389,13 +393,13 @@ |
if (kind == Code::KEYED_EXTERNAL_ARRAY_LOAD_IC || |
kind == Code::KEYED_EXTERNAL_ARRAY_STORE_IC) { |
value = target; |
- } else if (kind != Code::CALL_IC || |
- target->check_type() == RECEIVER_MAP_CHECK) { |
- Handle<Map> map = Handle<Map>(target->FindFirstMap()); |
- if (*map == NULL) { |
+ } else if (target->kind() != Code::CALL_IC || |
+ target->check_type() == RECEIVER_MAP_CHECK) { |
+ Map* map = target->FindFirstMap(); |
+ if (map == NULL) { |
value = target; |
} else { |
- value = map; |
+ value = Handle<Map>(map); |
} |
} else { |
ASSERT(target->kind() == Code::CALL_IC); |
@@ -409,7 +413,8 @@ |
if (!value.is_null()) { |
Handle<NumberDictionary> new_dict = |
- Factory::DictionaryAtNumberPut(dictionary_, position, value); |
+ isolate->factory()->DictionaryAtNumberPut( |
+ dictionary_, position, value); |
dictionary_ = loop_scope.CloseAndEscape(new_dict); |
} |
} |