Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(339)

Unified Diff: src/type-info.cc

Issue 6794050: Revert "[Arguments] Merge (7442,7496] from bleeding_edge." (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/arguments
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/type-info.h ('k') | src/v8.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/type-info.cc
diff --git a/src/type-info.cc b/src/type-info.cc
index 256f48a9ee26ca65b96794ea77ccc8d8f050b805..78f693c2b01b3884649a573ef05f5c495211c597 100644
--- a/src/type-info.cc
+++ b/src/type-info.cc
@@ -355,18 +355,6 @@ ZoneMapList* TypeFeedbackOracle::CollectReceiverTypes(int position,
}
-void TypeFeedbackOracle::SetInfo(int position, Object* target) {
- MaybeObject* maybe_result = dictionary_->AtNumberPut(position, target);
- USE(maybe_result);
-#ifdef DEBUG
- Object* result;
- // Dictionary has been allocated with sufficient size for all elements.
- ASSERT(maybe_result->ToObject(&result));
- ASSERT(*dictionary_ == result);
-#endif
-}
-
-
void TypeFeedbackOracle::PopulateMap(Handle<Code> code) {
Isolate* isolate = Isolate::Current();
HandleScope scope(isolate);
@@ -383,14 +371,14 @@ void TypeFeedbackOracle::PopulateMap(Handle<Code> code) {
int length = code_positions.length();
ASSERT(source_positions.length() == length);
for (int i = 0; i < length; i++) {
- AssertNoAllocation no_allocation;
+ HandleScope loop_scope(isolate);
RelocInfo info(code->instruction_start() + code_positions[i],
RelocInfo::CODE_TARGET, 0);
- Code* target = Code::GetCodeFromTargetAddress(info.target_address());
+ Handle<Code> target(Code::GetCodeFromTargetAddress(info.target_address()));
int position = source_positions[i];
InlineCacheState state = target->ic_state();
Code::Kind kind = target->kind();
-
+ Handle<Object> value;
if (kind == Code::BINARY_OP_IC ||
kind == Code::TYPE_RECORDING_BINARY_OP_IC ||
kind == Code::COMPARE_IC) {
@@ -399,28 +387,35 @@ void TypeFeedbackOracle::PopulateMap(Handle<Code> code) {
// recorded for all binary ICs.
int entry = dictionary_->FindEntry(position);
if (entry == NumberDictionary::kNotFound) {
- SetInfo(position, target);
+ value = target;
}
} else if (state == MONOMORPHIC) {
if (kind == Code::KEYED_EXTERNAL_ARRAY_LOAD_IC ||
kind == Code::KEYED_EXTERNAL_ARRAY_STORE_IC) {
- SetInfo(position, target);
+ value = target;
} else if (target->kind() != Code::CALL_IC ||
target->check_type() == RECEIVER_MAP_CHECK) {
Map* map = target->FindFirstMap();
if (map == NULL) {
- SetInfo(position, target);
+ value = target;
} else {
- SetInfo(position, map);
+ value = Handle<Map>(map);
}
} else {
ASSERT(target->kind() == Code::CALL_IC);
CheckType check = target->check_type();
ASSERT(check != RECEIVER_MAP_CHECK);
- SetInfo(position, Smi::FromInt(check));
+ value = Handle<Object>(Smi::FromInt(check));
}
} else if (state == MEGAMORPHIC) {
- SetInfo(position, target);
+ value = target;
+ }
+
+ if (!value.is_null()) {
+ Handle<NumberDictionary> new_dict =
+ isolate->factory()->DictionaryAtNumberPut(
+ dictionary_, position, value);
+ dictionary_ = loop_scope.CloseAndEscape(new_dict);
}
}
// Allocate handle in the parent scope.
« no previous file with comments | « src/type-info.h ('k') | src/v8.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698