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

Side by Side Diff: src/ast.h

Issue 6172001: Revert r6194: Clean up code for type feedback a bit.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 11 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 | « no previous file | src/ast.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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 1374 matching lines...) Expand 10 before | Expand all | Expand 10 after
1385 Expression* expression_; 1385 Expression* expression_;
1386 }; 1386 };
1387 1387
1388 1388
1389 class BinaryOperation: public Expression { 1389 class BinaryOperation: public Expression {
1390 public: 1390 public:
1391 BinaryOperation(Token::Value op, 1391 BinaryOperation(Token::Value op,
1392 Expression* left, 1392 Expression* left,
1393 Expression* right, 1393 Expression* right,
1394 int pos) 1394 int pos)
1395 : op_(op), left_(left), right_(right), pos_(pos) { 1395 : op_(op), left_(left), right_(right), pos_(pos), is_smi_only_(false) {
1396 ASSERT(Token::IsBinaryOp(op)); 1396 ASSERT(Token::IsBinaryOp(op));
1397 right_id_ = (op == Token::AND || op == Token::OR) 1397 right_id_ = (op == Token::AND || op == Token::OR)
1398 ? static_cast<int>(GetNextId()) 1398 ? static_cast<int>(GetNextId())
1399 : AstNode::kNoNumber; 1399 : AstNode::kNoNumber;
1400 } 1400 }
1401 1401
1402 // Create the binary operation corresponding to a compound assignment. 1402 // Create the binary operation corresponding to a compound assignment.
1403 explicit BinaryOperation(Assignment* assignment); 1403 explicit BinaryOperation(Assignment* assignment);
1404 1404
1405 DECLARE_NODE_TYPE(BinaryOperation) 1405 DECLARE_NODE_TYPE(BinaryOperation)
1406 1406
1407 virtual bool IsInlineable() const; 1407 virtual bool IsInlineable() const;
1408 1408
1409 virtual bool ResultOverwriteAllowed(); 1409 virtual bool ResultOverwriteAllowed();
1410 1410
1411 Token::Value op() const { return op_; } 1411 Token::Value op() const { return op_; }
1412 Expression* left() const { return left_; } 1412 Expression* left() const { return left_; }
1413 Expression* right() const { return right_; } 1413 Expression* right() const { return right_; }
1414 int position() const { return pos_; } 1414 int position() const { return pos_; }
1415 1415
1416 // Type feedback information.
1417 void RecordTypeFeedback(TypeFeedbackOracle* oracle);
1418 bool IsSmiOnly() const { return is_smi_only_; }
1419
1416 // Bailout support. 1420 // Bailout support.
1417 int RightId() const { return right_id_; } 1421 int RightId() const { return right_id_; }
1418 1422
1419 private: 1423 private:
1420 Token::Value op_; 1424 Token::Value op_;
1421 Expression* left_; 1425 Expression* left_;
1422 Expression* right_; 1426 Expression* right_;
1423 int pos_; 1427 int pos_;
1428 bool is_smi_only_;
1424 // The short-circuit logical operations have an AST ID for their 1429 // The short-circuit logical operations have an AST ID for their
1425 // right-hand subexpression. 1430 // right-hand subexpression.
1426 int right_id_; 1431 int right_id_;
1427 }; 1432 };
1428 1433
1429 1434
1430 class IncrementOperation: public Expression { 1435 class IncrementOperation: public Expression {
1431 public: 1436 public:
1432 IncrementOperation(Token::Value op, Expression* expr) 1437 IncrementOperation(Token::Value op, Expression* expr)
1433 : op_(op), expression_(expr) { 1438 : op_(op), expression_(expr) {
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after
2159 AST_NODE_LIST(DEF_VISIT) 2164 AST_NODE_LIST(DEF_VISIT)
2160 #undef DEF_VISIT 2165 #undef DEF_VISIT
2161 2166
2162 private: 2167 private:
2163 bool stack_overflow_; 2168 bool stack_overflow_;
2164 }; 2169 };
2165 2170
2166 } } // namespace v8::internal 2171 } } // namespace v8::internal
2167 2172
2168 #endif // V8_AST_H_ 2173 #endif // V8_AST_H_
OLDNEW
« no previous file with comments | « no previous file | src/ast.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698