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

Unified Diff: src/ast.cc

Issue 112863002: Merge bleeding_edge 18021:18297 (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 7 years 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/ast.h ('k') | src/bootstrapper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast.cc
diff --git a/src/ast.cc b/src/ast.cc
index 3ca1449409466af29bca87c184efa14b6c381a4b..aeb767ef0c983293cb1b28fb94b1a6efb5aaff44 100644
--- a/src/ast.cc
+++ b/src/ast.cc
@@ -575,101 +575,11 @@ bool FunctionDeclaration::IsInlineable() const {
// once we use the common type field in the AST consistently.
-void ForInStatement::RecordTypeFeedback(TypeFeedbackOracle* oracle) {
- for_in_type_ = static_cast<ForInType>(oracle->ForInType(this));
-}
-
-
void Expression::RecordToBooleanTypeFeedback(TypeFeedbackOracle* oracle) {
to_boolean_types_ = oracle->ToBooleanTypes(test_id());
}
-void Property::RecordTypeFeedback(TypeFeedbackOracle* oracle,
- Zone* zone) {
- // Record type feedback from the oracle in the AST.
- is_uninitialized_ = oracle->LoadIsUninitialized(this);
- if (is_uninitialized_) return;
-
- is_pre_monomorphic_ = oracle->LoadIsPreMonomorphic(this);
- is_monomorphic_ = oracle->LoadIsMonomorphicNormal(this);
- ASSERT(!is_pre_monomorphic_ || !is_monomorphic_);
- receiver_types_.Clear();
- if (key()->IsPropertyName()) {
- FunctionPrototypeStub proto_stub(Code::LOAD_IC);
- if (oracle->LoadIsStub(this, &proto_stub)) {
- is_function_prototype_ = true;
- } else {
- Literal* lit_key = key()->AsLiteral();
- ASSERT(lit_key != NULL && lit_key->value()->IsString());
- Handle<String> name = Handle<String>::cast(lit_key->value());
- oracle->LoadReceiverTypes(this, name, &receiver_types_);
- }
- } else if (oracle->LoadIsBuiltin(this, Builtins::kKeyedLoadIC_String)) {
- is_string_access_ = true;
- } else if (is_monomorphic_) {
- receiver_types_.Add(oracle->LoadMonomorphicReceiverType(this), zone);
- } else if (oracle->LoadIsPolymorphic(this)) {
- receiver_types_.Reserve(kMaxKeyedPolymorphism, zone);
- oracle->CollectKeyedReceiverTypes(PropertyFeedbackId(), &receiver_types_);
- }
-}
-
-
-void Assignment::RecordTypeFeedback(TypeFeedbackOracle* oracle,
- Zone* zone) {
- Property* prop = target()->AsProperty();
- ASSERT(prop != NULL);
- TypeFeedbackId id = AssignmentFeedbackId();
- is_uninitialized_ = oracle->StoreIsUninitialized(id);
- if (is_uninitialized_) return;
-
- is_pre_monomorphic_ = oracle->StoreIsPreMonomorphic(id);
- is_monomorphic_ = oracle->StoreIsMonomorphicNormal(id);
- ASSERT(!is_pre_monomorphic_ || !is_monomorphic_);
- receiver_types_.Clear();
- if (prop->key()->IsPropertyName()) {
- Literal* lit_key = prop->key()->AsLiteral();
- ASSERT(lit_key != NULL && lit_key->value()->IsString());
- Handle<String> name = Handle<String>::cast(lit_key->value());
- oracle->StoreReceiverTypes(this, name, &receiver_types_);
- } else if (is_monomorphic_) {
- // Record receiver type for monomorphic keyed stores.
- receiver_types_.Add(oracle->StoreMonomorphicReceiverType(id), zone);
- store_mode_ = oracle->GetStoreMode(id);
- } else if (oracle->StoreIsKeyedPolymorphic(id)) {
- receiver_types_.Reserve(kMaxKeyedPolymorphism, zone);
- oracle->CollectKeyedReceiverTypes(id, &receiver_types_);
- store_mode_ = oracle->GetStoreMode(id);
- }
-}
-
-
-void CountOperation::RecordTypeFeedback(TypeFeedbackOracle* oracle,
- Zone* zone) {
- TypeFeedbackId id = CountStoreFeedbackId();
- is_monomorphic_ = oracle->StoreIsMonomorphicNormal(id);
- receiver_types_.Clear();
- if (is_monomorphic_) {
- // Record receiver type for monomorphic keyed stores.
- receiver_types_.Add(
- oracle->StoreMonomorphicReceiverType(id), zone);
- } else if (oracle->StoreIsKeyedPolymorphic(id)) {
- receiver_types_.Reserve(kMaxKeyedPolymorphism, zone);
- oracle->CollectKeyedReceiverTypes(id, &receiver_types_);
- } else {
- oracle->CollectPolymorphicStoreReceiverTypes(id, &receiver_types_);
- }
- store_mode_ = oracle->GetStoreMode(id);
- type_ = oracle->IncrementType(this);
-}
-
-
-void CaseClause::RecordTypeFeedback(TypeFeedbackOracle* oracle) {
- compare_type_ = oracle->ClauseType(CompareId());
-}
-
-
bool Call::ComputeTarget(Handle<Map> type, Handle<String> name) {
// If there is an interceptor, we can't compute the target for a direct call.
if (type->has_named_interceptor()) return false;
@@ -772,20 +682,21 @@ Handle<JSObject> Call::GetPrototypeForPrimitiveCheck(
void Call::RecordTypeFeedback(TypeFeedbackOracle* oracle,
CallKind call_kind) {
- is_monomorphic_ = oracle->CallIsMonomorphic(this);
+ is_monomorphic_ = oracle->CallIsMonomorphic(CallFeedbackId());
Property* property = expression()->AsProperty();
if (property == NULL) {
// Function call. Specialize for monomorphic calls.
- if (is_monomorphic_) target_ = oracle->GetCallTarget(this);
+ if (is_monomorphic_) target_ = oracle->GetCallTarget(CallFeedbackId());
} else if (property->key()->IsPropertyName()) {
// Method call. Specialize for the receiver types seen at runtime.
Literal* key = property->key()->AsLiteral();
ASSERT(key != NULL && key->value()->IsString());
Handle<String> name = Handle<String>::cast(key->value());
- check_type_ = oracle->GetCallCheckType(this);
+ check_type_ = oracle->GetCallCheckType(CallFeedbackId());
receiver_types_.Clear();
if (check_type_ == RECEIVER_MAP_CHECK) {
- oracle->CallReceiverTypes(this, name, call_kind, &receiver_types_);
+ oracle->CallReceiverTypes(CallFeedbackId(),
+ name, arguments()->length(), call_kind, &receiver_types_);
is_monomorphic_ = is_monomorphic_ && receiver_types_.length() > 0;
} else {
holder_ = GetPrototypeForPrimitiveCheck(check_type_, oracle->isolate());
@@ -806,17 +717,19 @@ void Call::RecordTypeFeedback(TypeFeedbackOracle* oracle,
}
} else {
if (is_monomorphic_) {
- keyed_array_call_is_holey_ = oracle->KeyedArrayCallIsHoley(this);
+ keyed_array_call_is_holey_ =
+ oracle->KeyedArrayCallIsHoley(CallFeedbackId());
}
}
}
void CallNew::RecordTypeFeedback(TypeFeedbackOracle* oracle) {
- allocation_info_cell_ = oracle->GetCallNewAllocationInfoCell(this);
- is_monomorphic_ = oracle->CallNewIsMonomorphic(this);
+ allocation_info_cell_ =
+ oracle->GetCallNewAllocationInfoCell(CallNewFeedbackId());
+ is_monomorphic_ = oracle->CallNewIsMonomorphic(CallNewFeedbackId());
if (is_monomorphic_) {
- target_ = oracle->GetCallNewTarget(this);
+ target_ = oracle->GetCallNewTarget(CallNewFeedbackId());
Object* value = allocation_info_cell_->value();
ASSERT(!value->IsTheHole());
if (value->IsAllocationSite()) {
@@ -828,9 +741,9 @@ void CallNew::RecordTypeFeedback(TypeFeedbackOracle* oracle) {
void ObjectLiteral::Property::RecordTypeFeedback(TypeFeedbackOracle* oracle) {
- receiver_type_ = oracle->ObjectLiteralStoreIsMonomorphic(this)
- ? oracle->GetObjectLiteralStoreMap(this)
- : Handle<Map>::null();
+ TypeFeedbackId id = key()->LiteralFeedbackId();
+ receiver_type_ = oracle->ObjectLiteralStoreIsMonomorphic(id)
+ ? oracle->GetObjectLiteralStoreMap(id) : Handle<Map>::null();
}
« no previous file with comments | « src/ast.h ('k') | src/bootstrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698