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

Side by Side Diff: src/ast.cc

Issue 12210083: Renamed "symbols" to "internalized strings" throughout the code base, (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed Yang's comments Created 7 years, 10 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/bootstrapper.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 // 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 int position) 90 int position)
91 : Expression(isolate), 91 : Expression(isolate),
92 name_(name), 92 name_(name),
93 var_(NULL), 93 var_(NULL),
94 is_this_(is_this), 94 is_this_(is_this),
95 is_trivial_(false), 95 is_trivial_(false),
96 is_lvalue_(false), 96 is_lvalue_(false),
97 position_(position), 97 position_(position),
98 interface_(interface) { 98 interface_(interface) {
99 // Names must be canonicalized for fast equality checks. 99 // Names must be canonicalized for fast equality checks.
100 ASSERT(name->IsSymbol()); 100 ASSERT(name->IsInternalizedString());
101 } 101 }
102 102
103 103
104 void VariableProxy::BindTo(Variable* var) { 104 void VariableProxy::BindTo(Variable* var) {
105 ASSERT(var_ == NULL); // must be bound only once 105 ASSERT(var_ == NULL); // must be bound only once
106 ASSERT(var != NULL); // must bind 106 ASSERT(var != NULL); // must bind
107 ASSERT(!FLAG_harmony_modules || interface_->IsUnified(var->interface())); 107 ASSERT(!FLAG_harmony_modules || interface_->IsUnified(var->interface()));
108 ASSERT((is_this() && var->is_this()) || name_.is_identical_to(var->name())); 108 ASSERT((is_this() && var->is_this()) || name_.is_identical_to(var->name()));
109 // Ideally CONST-ness should match. However, this is very hard to achieve 109 // Ideally CONST-ness should match. However, this is very hard to achieve
110 // because we don't know the exact semantics of conflicting (const and 110 // because we don't know the exact semantics of conflicting (const and
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 } 175 }
176 176
177 177
178 ObjectLiteral::Property::Property(Literal* key, 178 ObjectLiteral::Property::Property(Literal* key,
179 Expression* value, 179 Expression* value,
180 Isolate* isolate) { 180 Isolate* isolate) {
181 emit_store_ = true; 181 emit_store_ = true;
182 key_ = key; 182 key_ = key;
183 value_ = value; 183 value_ = value;
184 Object* k = *key->handle(); 184 Object* k = *key->handle();
185 if (k->IsSymbol() && 185 if (k->IsInternalizedString() &&
186 isolate->heap()->Proto_symbol()->Equals(String::cast(k))) { 186 isolate->heap()->proto_string()->Equals(String::cast(k))) {
187 kind_ = PROTOTYPE; 187 kind_ = PROTOTYPE;
188 } else if (value_->AsMaterializedLiteral() != NULL) { 188 } else if (value_->AsMaterializedLiteral() != NULL) {
189 kind_ = MATERIALIZED_LITERAL; 189 kind_ = MATERIALIZED_LITERAL;
190 } else if (value_->AsLiteral() != NULL) { 190 } else if (value_->AsLiteral() != NULL) {
191 kind_ = CONSTANT; 191 kind_ = CONSTANT;
192 } else { 192 } else {
193 kind_ = COMPUTED; 193 kind_ = COMPUTED;
194 } 194 }
195 } 195 }
196 196
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 oracle->CollectKeyedReceiverTypes(id, &receiver_types_); 476 oracle->CollectKeyedReceiverTypes(id, &receiver_types_);
477 } 477 }
478 } 478 }
479 479
480 480
481 void CaseClause::RecordTypeFeedback(TypeFeedbackOracle* oracle) { 481 void CaseClause::RecordTypeFeedback(TypeFeedbackOracle* oracle) {
482 TypeInfo info = oracle->SwitchType(this); 482 TypeInfo info = oracle->SwitchType(this);
483 if (info.IsUninitialized()) info = TypeInfo::Unknown(); 483 if (info.IsUninitialized()) info = TypeInfo::Unknown();
484 if (info.IsSmi()) { 484 if (info.IsSmi()) {
485 compare_type_ = SMI_ONLY; 485 compare_type_ = SMI_ONLY;
486 } else if (info.IsSymbol()) { 486 } else if (info.IsInternalizedString()) {
487 compare_type_ = SYMBOL_ONLY; 487 compare_type_ = NAME_ONLY;
488 } else if (info.IsNonSymbol()) { 488 } else if (info.IsNonInternalizedString()) {
489 compare_type_ = STRING_ONLY; 489 compare_type_ = STRING_ONLY;
490 } else if (info.IsNonPrimitive()) { 490 } else if (info.IsNonPrimitive()) {
491 compare_type_ = OBJECT_ONLY; 491 compare_type_ = OBJECT_ONLY;
492 } else { 492 } else {
493 ASSERT(compare_type_ == NONE); 493 ASSERT(compare_type_ == NONE);
494 } 494 }
495 } 495 }
496 496
497 497
498 bool Call::ComputeTarget(Handle<Map> type, Handle<String> name) { 498 bool Call::ComputeTarget(Handle<Map> type, Handle<String> name) {
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after
1114 OS::SNPrintF(buffer, "%d", Smi::cast(*handle_)->value()); 1114 OS::SNPrintF(buffer, "%d", Smi::cast(*handle_)->value());
1115 str = arr; 1115 str = arr;
1116 } else { 1116 } else {
1117 str = DoubleToCString(handle_->Number(), buffer); 1117 str = DoubleToCString(handle_->Number(), buffer);
1118 } 1118 }
1119 return FACTORY->NewStringFromAscii(CStrVector(str)); 1119 return FACTORY->NewStringFromAscii(CStrVector(str));
1120 } 1120 }
1121 1121
1122 1122
1123 } } // namespace v8::internal 1123 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ast.h ('k') | src/bootstrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698