| Index: src/ast.cc
|
| diff --git a/src/ast.cc b/src/ast.cc
|
| index b98d2a654ea9ebab3284a142b587b22517270c8b..481414eb2c2802f0d0922fb6b2f31c8e07361954 100644
|
| --- a/src/ast.cc
|
| +++ b/src/ast.cc
|
| @@ -82,14 +82,13 @@ bool Expression::IsUndefinedLiteral(Isolate* isolate) {
|
| }
|
|
|
|
|
| -VariableProxy::VariableProxy(Isolate* isolate, Variable* var)
|
| - : Expression(isolate),
|
| +VariableProxy::VariableProxy(Isolate* isolate, Variable* var, int position)
|
| + : Expression(isolate, position),
|
| name_(var->name()),
|
| var_(NULL), // Will be set by the call to BindTo.
|
| is_this_(var->is_this()),
|
| is_trivial_(false),
|
| is_lvalue_(false),
|
| - position_(RelocInfo::kNoPosition),
|
| interface_(var->interface()) {
|
| BindTo(var);
|
| }
|
| @@ -100,13 +99,12 @@ VariableProxy::VariableProxy(Isolate* isolate,
|
| bool is_this,
|
| Interface* interface,
|
| int position)
|
| - : Expression(isolate),
|
| + : Expression(isolate, position),
|
| name_(name),
|
| var_(NULL),
|
| is_this_(is_this),
|
| is_trivial_(false),
|
| is_lvalue_(false),
|
| - position_(position),
|
| interface_(interface) {
|
| // Names must be canonicalized for fast equality checks.
|
| ASSERT(name->IsInternalizedString());
|
| @@ -133,15 +131,15 @@ Assignment::Assignment(Isolate* isolate,
|
| Expression* target,
|
| Expression* value,
|
| int pos)
|
| - : Expression(isolate),
|
| + : Expression(isolate, pos),
|
| op_(op),
|
| target_(target),
|
| value_(value),
|
| - pos_(pos),
|
| binary_operation_(NULL),
|
| assignment_id_(GetNextId(isolate)),
|
| is_monomorphic_(false),
|
| is_uninitialized_(false),
|
| + is_pre_monomorphic_(false),
|
| store_mode_(STANDARD_STORE) { }
|
|
|
|
|
| @@ -234,33 +232,6 @@ bool ObjectLiteral::Property::emit_store() {
|
| }
|
|
|
|
|
| -bool IsEqualString(void* first, void* second) {
|
| - ASSERT((*reinterpret_cast<String**>(first))->IsString());
|
| - ASSERT((*reinterpret_cast<String**>(second))->IsString());
|
| - Handle<String> h1(reinterpret_cast<String**>(first));
|
| - Handle<String> h2(reinterpret_cast<String**>(second));
|
| - return (*h1)->Equals(*h2);
|
| -}
|
| -
|
| -
|
| -bool IsEqualNumber(void* first, void* second) {
|
| - ASSERT((*reinterpret_cast<Object**>(first))->IsNumber());
|
| - ASSERT((*reinterpret_cast<Object**>(second))->IsNumber());
|
| -
|
| - Handle<Object> h1(reinterpret_cast<Object**>(first));
|
| - Handle<Object> h2(reinterpret_cast<Object**>(second));
|
| - if (h1->IsSmi()) {
|
| - return h2->IsSmi() && *h1 == *h2;
|
| - }
|
| - if (h2->IsSmi()) return false;
|
| - Handle<HeapNumber> n1 = Handle<HeapNumber>::cast(h1);
|
| - Handle<HeapNumber> n2 = Handle<HeapNumber>::cast(h2);
|
| - ASSERT(std::isfinite(n1->value()));
|
| - ASSERT(std::isfinite(n2->value()));
|
| - return n1->value() == n2->value();
|
| -}
|
| -
|
| -
|
| void ObjectLiteral::CalculateEmitStore(Zone* zone) {
|
| ZoneAllocationPolicy allocator(zone);
|
|
|
| @@ -456,7 +427,9 @@ void Property::RecordTypeFeedback(TypeFeedbackOracle* oracle,
|
| 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);
|
| @@ -471,8 +444,7 @@ void Property::RecordTypeFeedback(TypeFeedbackOracle* oracle,
|
| } else if (oracle->LoadIsBuiltin(this, Builtins::kKeyedLoadIC_String)) {
|
| is_string_access_ = true;
|
| } else if (is_monomorphic_) {
|
| - receiver_types_.Add(oracle->LoadMonomorphicReceiverType(this),
|
| - zone);
|
| + receiver_types_.Add(oracle->LoadMonomorphicReceiverType(this), zone);
|
| } else if (oracle->LoadIsPolymorphic(this)) {
|
| receiver_types_.Reserve(kMaxKeyedPolymorphism, zone);
|
| oracle->CollectKeyedReceiverTypes(PropertyFeedbackId(), &receiver_types_);
|
| @@ -487,7 +459,10 @@ void Assignment::RecordTypeFeedback(TypeFeedbackOracle* oracle,
|
| 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();
|
| @@ -1064,9 +1039,9 @@ CaseClause::CaseClause(Isolate* isolate,
|
| Expression* label,
|
| ZoneList<Statement*>* statements,
|
| int pos)
|
| - : label_(label),
|
| + : AstNode(pos),
|
| + label_(label),
|
| statements_(statements),
|
| - position_(pos),
|
| compare_type_(Type::None(), isolate),
|
| compare_id_(AstNode::GetNextId(isolate)),
|
| entry_id_(AstNode::GetNextId(isolate)) {
|
| @@ -1108,6 +1083,7 @@ REGULAR_NODE(ContinueStatement)
|
| REGULAR_NODE(BreakStatement)
|
| REGULAR_NODE(ReturnStatement)
|
| REGULAR_NODE(SwitchStatement)
|
| +REGULAR_NODE(CaseClause)
|
| REGULAR_NODE(Conditional)
|
| REGULAR_NODE(Literal)
|
| REGULAR_NODE(ArrayLiteral)
|
|
|