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

Side by Side Diff: src/ast.cc

Issue 17071002: Add soft-deopt for uninitialized assignment (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ast.h ('k') | src/hydrogen.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 Expression* value, 128 Expression* value,
129 int pos) 129 int pos)
130 : Expression(isolate), 130 : Expression(isolate),
131 op_(op), 131 op_(op),
132 target_(target), 132 target_(target),
133 value_(value), 133 value_(value),
134 pos_(pos), 134 pos_(pos),
135 binary_operation_(NULL), 135 binary_operation_(NULL),
136 assignment_id_(GetNextId(isolate)), 136 assignment_id_(GetNextId(isolate)),
137 is_monomorphic_(false), 137 is_monomorphic_(false),
138 is_uninitialized_(false),
138 store_mode_(STANDARD_STORE) { } 139 store_mode_(STANDARD_STORE) { }
139 140
140 141
141 Token::Value Assignment::binary_op() const { 142 Token::Value Assignment::binary_op() const {
142 switch (op_) { 143 switch (op_) {
143 case Token::ASSIGN_BIT_OR: return Token::BIT_OR; 144 case Token::ASSIGN_BIT_OR: return Token::BIT_OR;
144 case Token::ASSIGN_BIT_XOR: return Token::BIT_XOR; 145 case Token::ASSIGN_BIT_XOR: return Token::BIT_XOR;
145 case Token::ASSIGN_BIT_AND: return Token::BIT_AND; 146 case Token::ASSIGN_BIT_AND: return Token::BIT_AND;
146 case Token::ASSIGN_SHL: return Token::SHL; 147 case Token::ASSIGN_SHL: return Token::SHL;
147 case Token::ASSIGN_SAR: return Token::SAR; 148 case Token::ASSIGN_SAR: return Token::SAR;
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 oracle->CollectKeyedReceiverTypes(PropertyFeedbackId(), &receiver_types_); 459 oracle->CollectKeyedReceiverTypes(PropertyFeedbackId(), &receiver_types_);
459 } 460 }
460 } 461 }
461 462
462 463
463 void Assignment::RecordTypeFeedback(TypeFeedbackOracle* oracle, 464 void Assignment::RecordTypeFeedback(TypeFeedbackOracle* oracle,
464 Zone* zone) { 465 Zone* zone) {
465 Property* prop = target()->AsProperty(); 466 Property* prop = target()->AsProperty();
466 ASSERT(prop != NULL); 467 ASSERT(prop != NULL);
467 TypeFeedbackId id = AssignmentFeedbackId(); 468 TypeFeedbackId id = AssignmentFeedbackId();
469 is_uninitialized_ = oracle->StoreIsUninitialized(id);
470 if (is_uninitialized_) return;
468 is_monomorphic_ = oracle->StoreIsMonomorphicNormal(id); 471 is_monomorphic_ = oracle->StoreIsMonomorphicNormal(id);
469 receiver_types_.Clear(); 472 receiver_types_.Clear();
470 if (prop->key()->IsPropertyName()) { 473 if (prop->key()->IsPropertyName()) {
471 Literal* lit_key = prop->key()->AsLiteral(); 474 Literal* lit_key = prop->key()->AsLiteral();
472 ASSERT(lit_key != NULL && lit_key->handle()->IsString()); 475 ASSERT(lit_key != NULL && lit_key->handle()->IsString());
473 Handle<String> name = Handle<String>::cast(lit_key->handle()); 476 Handle<String> name = Handle<String>::cast(lit_key->handle());
474 oracle->StoreReceiverTypes(this, name, &receiver_types_); 477 oracle->StoreReceiverTypes(this, name, &receiver_types_);
475 } else if (is_monomorphic_) { 478 } else if (is_monomorphic_) {
476 // Record receiver type for monomorphic keyed stores. 479 // Record receiver type for monomorphic keyed stores.
477 receiver_types_.Add(oracle->StoreMonomorphicReceiverType(id), zone); 480 receiver_types_.Add(oracle->StoreMonomorphicReceiverType(id), zone);
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after
1175 OS::SNPrintF(buffer, "%d", Smi::cast(*handle_)->value()); 1178 OS::SNPrintF(buffer, "%d", Smi::cast(*handle_)->value());
1176 str = arr; 1179 str = arr;
1177 } else { 1180 } else {
1178 str = DoubleToCString(handle_->Number(), buffer); 1181 str = DoubleToCString(handle_->Number(), buffer);
1179 } 1182 }
1180 return factory->NewStringFromAscii(CStrVector(str)); 1183 return factory->NewStringFromAscii(CStrVector(str));
1181 } 1184 }
1182 1185
1183 1186
1184 } } // namespace v8::internal 1187 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ast.h ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698