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

Side by Side Diff: src/ast.cc

Issue 7383013: Avoid TLS load in AstNode constructor. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 5 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/parser.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 binary_operation_(NULL), 131 binary_operation_(NULL),
132 compound_load_id_(kNoNumber), 132 compound_load_id_(kNoNumber),
133 assignment_id_(GetNextId()), 133 assignment_id_(GetNextId()),
134 block_start_(false), 134 block_start_(false),
135 block_end_(false), 135 block_end_(false),
136 is_monomorphic_(false), 136 is_monomorphic_(false),
137 receiver_types_(NULL) { 137 receiver_types_(NULL) {
138 ASSERT(Token::IsAssignmentOp(op)); 138 ASSERT(Token::IsAssignmentOp(op));
139 if (is_compound()) { 139 if (is_compound()) {
140 binary_operation_ = 140 binary_operation_ =
141 new BinaryOperation(binary_op(), target, value, pos + 1); 141 new(ZONE) BinaryOperation(binary_op(), target, value, pos + 1);
142 compound_load_id_ = GetNextId(); 142 compound_load_id_ = GetNextId();
143 } 143 }
144 } 144 }
145 145
146 146
147 Token::Value Assignment::binary_op() const { 147 Token::Value Assignment::binary_op() const {
148 switch (op_) { 148 switch (op_) {
149 case Token::ASSIGN_BIT_OR: return Token::BIT_OR; 149 case Token::ASSIGN_BIT_OR: return Token::BIT_OR;
150 case Token::ASSIGN_BIT_XOR: return Token::BIT_XOR; 150 case Token::ASSIGN_BIT_XOR: return Token::BIT_XOR;
151 case Token::ASSIGN_BIT_AND: return Token::BIT_AND; 151 case Token::ASSIGN_BIT_AND: return Token::BIT_AND;
(...skipping 28 matching lines...) Expand all
180 } else if (value_->AsLiteral() != NULL) { 180 } else if (value_->AsLiteral() != NULL) {
181 kind_ = CONSTANT; 181 kind_ = CONSTANT;
182 } else { 182 } else {
183 kind_ = COMPUTED; 183 kind_ = COMPUTED;
184 } 184 }
185 } 185 }
186 186
187 187
188 ObjectLiteral::Property::Property(bool is_getter, FunctionLiteral* value) { 188 ObjectLiteral::Property::Property(bool is_getter, FunctionLiteral* value) {
189 emit_store_ = true; 189 emit_store_ = true;
190 key_ = new Literal(value->name()); 190 key_ = new(ZONE) Literal(value->name());
191 value_ = value; 191 value_ = value;
192 kind_ = is_getter ? GETTER : SETTER; 192 kind_ = is_getter ? GETTER : SETTER;
193 } 193 }
194 194
195 195
196 bool ObjectLiteral::Property::IsCompileTimeValue() { 196 bool ObjectLiteral::Property::IsCompileTimeValue() {
197 return kind_ == CONSTANT || 197 return kind_ == CONSTANT ||
198 (kind_ == MATERIALIZED_LITERAL && 198 (kind_ == MATERIALIZED_LITERAL &&
199 CompileTimeValue::IsCompileTimeValue(value_)); 199 CompileTimeValue::IsCompileTimeValue(value_));
200 } 200 }
(...skipping 994 matching lines...) Expand 10 before | Expand all | Expand 10 after
1195 int pos) 1195 int pos)
1196 : label_(label), 1196 : label_(label),
1197 statements_(statements), 1197 statements_(statements),
1198 position_(pos), 1198 position_(pos),
1199 compare_type_(NONE), 1199 compare_type_(NONE),
1200 compare_id_(AstNode::GetNextId()), 1200 compare_id_(AstNode::GetNextId()),
1201 entry_id_(AstNode::GetNextId()) { 1201 entry_id_(AstNode::GetNextId()) {
1202 } 1202 }
1203 1203
1204 } } // namespace v8::internal 1204 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ast.h ('k') | src/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698