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

Side by Side Diff: src/ast.h

Issue 298143004: Minor cleanups & trivial refactoring related to Ast. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebased Created 6 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/arm64/full-codegen-arm64.cc ('k') | 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 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 #ifndef V8_AST_H_ 5 #ifndef V8_AST_H_
6 #define V8_AST_H_ 6 #define V8_AST_H_
7 7
8 #include "v8.h" 8 #include "v8.h"
9 9
10 #include "assembler.h" 10 #include "assembler.h"
(...skipping 1334 matching lines...) Expand 10 before | Expand all | Expand 10 after
1345 return Handle<String>::cast(value_); 1345 return Handle<String>::cast(value_);
1346 } 1346 }
1347 1347
1348 virtual bool ToBooleanIsTrue() const V8_OVERRIDE { 1348 virtual bool ToBooleanIsTrue() const V8_OVERRIDE {
1349 return value_->BooleanValue(); 1349 return value_->BooleanValue();
1350 } 1350 }
1351 virtual bool ToBooleanIsFalse() const V8_OVERRIDE { 1351 virtual bool ToBooleanIsFalse() const V8_OVERRIDE {
1352 return !value_->BooleanValue(); 1352 return !value_->BooleanValue();
1353 } 1353 }
1354 1354
1355 // Identity testers.
1356 bool IsNull() const {
1357 ASSERT(!value_.is_null());
1358 return value_->IsNull();
1359 }
1360 bool IsTrue() const {
1361 ASSERT(!value_.is_null());
1362 return value_->IsTrue();
1363 }
1364 bool IsFalse() const {
1365 ASSERT(!value_.is_null());
1366 return value_->IsFalse();
1367 }
1368
1369 Handle<Object> value() const { return value_; } 1355 Handle<Object> value() const { return value_; }
1370 1356
1371 // Support for using Literal as a HashMap key. NOTE: Currently, this works 1357 // Support for using Literal as a HashMap key. NOTE: Currently, this works
1372 // only for string and number literals! 1358 // only for string and number literals!
1373 uint32_t Hash() { return ToString()->Hash(); } 1359 uint32_t Hash() { return ToString()->Hash(); }
1374 1360
1375 static bool Match(void* literal1, void* literal2) { 1361 static bool Match(void* literal1, void* literal2) {
1376 Handle<String> s1 = static_cast<Literal*>(literal1)->ToString(); 1362 Handle<String> s1 = static_cast<Literal*>(literal1)->ToString();
1377 Handle<String> s2 = static_cast<Literal*>(literal2)->ToString(); 1363 Handle<String> s2 = static_cast<Literal*>(literal2)->ToString();
1378 return String::Equals(s1, s2); 1364 return String::Equals(s1, s2);
(...skipping 1969 matching lines...) Expand 10 before | Expand all | Expand 10 after
3348 3334
3349 private: 3335 private:
3350 Zone* zone_; 3336 Zone* zone_;
3351 Visitor visitor_; 3337 Visitor visitor_;
3352 }; 3338 };
3353 3339
3354 3340
3355 } } // namespace v8::internal 3341 } } // namespace v8::internal
3356 3342
3357 #endif // V8_AST_H_ 3343 #endif // V8_AST_H_
OLDNEW
« no previous file with comments | « src/arm64/full-codegen-arm64.cc ('k') | src/ast.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698