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

Side by Side Diff: src/ast-value-factory.h

Issue 422923004: Track usage of "this" and "arguments" in Scope (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebase and fix parser instantiation after r23600 Created 6 years, 3 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/preparser.h » ('j') | src/preparser.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 bool is_one_byte() const { return is_one_byte_; } 81 bool is_one_byte() const { return is_one_byte_; }
82 bool IsOneByteEqualTo(const char* data) const; 82 bool IsOneByteEqualTo(const char* data) const;
83 uint16_t FirstCharacter() const { 83 uint16_t FirstCharacter() const {
84 if (is_one_byte_) 84 if (is_one_byte_)
85 return literal_bytes_[0]; 85 return literal_bytes_[0];
86 const uint16_t* c = 86 const uint16_t* c =
87 reinterpret_cast<const uint16_t*>(literal_bytes_.start()); 87 reinterpret_cast<const uint16_t*>(literal_bytes_.start());
88 return *c; 88 return *c;
89 } 89 }
90 90
91 V8_INLINE bool IsArguments(AstValueFactory* ast_value_factory) const;
92
91 // For storing AstRawStrings in a hash map. 93 // For storing AstRawStrings in a hash map.
92 uint32_t hash() const { 94 uint32_t hash() const {
93 return hash_; 95 return hash_;
94 } 96 }
95 static bool Compare(void* a, void* b); 97 static bool Compare(void* a, void* b);
96 98
97 private: 99 private:
98 friend class AstValueFactory; 100 friend class AstValueFactory;
99 friend class AstRawStringInternalizationKey; 101 friend class AstRawStringInternalizationKey;
100 102
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 Isolate* isolate_; 332 Isolate* isolate_;
331 333
332 uint32_t hash_seed_; 334 uint32_t hash_seed_;
333 335
334 #define F(name, str) \ 336 #define F(name, str) \
335 const AstRawString* name##_string_; 337 const AstRawString* name##_string_;
336 STRING_CONSTANTS(F) 338 STRING_CONSTANTS(F)
337 #undef F 339 #undef F
338 }; 340 };
339 341
342
343 bool AstRawString::IsArguments(AstValueFactory* ast_value_factory) const {
344 return ast_value_factory->arguments_string() == this;
345 }
346
340 } } // namespace v8::internal 347 } } // namespace v8::internal
341 348
342 #undef STRING_CONSTANTS 349 #undef STRING_CONSTANTS
343 350
344 #endif // V8_AST_VALUE_FACTORY_H_ 351 #endif // V8_AST_VALUE_FACTORY_H_
OLDNEW
« no previous file with comments | « no previous file | src/preparser.h » ('j') | src/preparser.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698