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

Side by Side Diff: src/ast.cc

Issue 652183002: Always initialize key_type_ in AST nodes (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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/ic/ic.h » ('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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/ast.h" 5 #include "src/ast.h"
6 6
7 #include <cmath> // For isfinite. 7 #include <cmath> // For isfinite.
8 #include "src/builtins.h" 8 #include "src/builtins.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/contexts.h" 10 #include "src/contexts.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 98
99 99
100 Assignment::Assignment(Zone* zone, Token::Value op, Expression* target, 100 Assignment::Assignment(Zone* zone, Token::Value op, Expression* target,
101 Expression* value, int pos, IdGen* id_gen) 101 Expression* value, int pos, IdGen* id_gen)
102 : Expression(zone, pos, num_ids(), id_gen), 102 : Expression(zone, pos, num_ids(), id_gen),
103 op_(op), 103 op_(op),
104 target_(target), 104 target_(target),
105 value_(value), 105 value_(value),
106 binary_operation_(NULL), 106 binary_operation_(NULL),
107 is_uninitialized_(false), 107 is_uninitialized_(false),
108 key_type_(ELEMENT),
108 store_mode_(STANDARD_STORE) {} 109 store_mode_(STANDARD_STORE) {}
109 110
110 111
111 Token::Value Assignment::binary_op() const { 112 Token::Value Assignment::binary_op() const {
112 switch (op_) { 113 switch (op_) {
113 case Token::ASSIGN_BIT_OR: return Token::BIT_OR; 114 case Token::ASSIGN_BIT_OR: return Token::BIT_OR;
114 case Token::ASSIGN_BIT_XOR: return Token::BIT_XOR; 115 case Token::ASSIGN_BIT_XOR: return Token::BIT_XOR;
115 case Token::ASSIGN_BIT_AND: return Token::BIT_AND; 116 case Token::ASSIGN_BIT_AND: return Token::BIT_AND;
116 case Token::ASSIGN_SHL: return Token::SHL; 117 case Token::ASSIGN_SHL: return Token::SHL;
117 case Token::ASSIGN_SAR: return Token::SAR; 118 case Token::ASSIGN_SAR: return Token::SAR;
(...skipping 1024 matching lines...) Expand 10 before | Expand all | Expand 10 after
1142 // static 1143 // static
1143 bool Literal::Match(void* literal1, void* literal2) { 1144 bool Literal::Match(void* literal1, void* literal2) {
1144 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); 1145 const AstValue* x = static_cast<Literal*>(literal1)->raw_value();
1145 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); 1146 const AstValue* y = static_cast<Literal*>(literal2)->raw_value();
1146 return (x->IsString() && y->IsString() && *x->AsString() == *y->AsString()) || 1147 return (x->IsString() && y->IsString() && *x->AsString() == *y->AsString()) ||
1147 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); 1148 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber());
1148 } 1149 }
1149 1150
1150 1151
1151 } } // namespace v8::internal 1152 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ast.h ('k') | src/ic/ic.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698