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

Unified Diff: src/ast.cc

Issue 17576005: Rename Literal::handle to Literal::value (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ast.h ('k') | src/codegen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast.cc
diff --git a/src/ast.cc b/src/ast.cc
index f2ec67f69b7efb899e937089759f2f5d6a6c9cb5..21c38d59dfc481ef24d989029ea80e375d3201e4 100644
--- a/src/ast.cc
+++ b/src/ast.cc
@@ -57,22 +57,22 @@ AST_NODE_LIST(DECL_ACCEPT)
bool Expression::IsSmiLiteral() {
- return AsLiteral() != NULL && AsLiteral()->handle()->IsSmi();
+ return AsLiteral() != NULL && AsLiteral()->value()->IsSmi();
}
bool Expression::IsStringLiteral() {
- return AsLiteral() != NULL && AsLiteral()->handle()->IsString();
+ return AsLiteral() != NULL && AsLiteral()->value()->IsString();
}
bool Expression::IsNullLiteral() {
- return AsLiteral() != NULL && AsLiteral()->handle()->IsNull();
+ return AsLiteral() != NULL && AsLiteral()->value()->IsNull();
}
bool Expression::IsUndefinedLiteral() {
- return AsLiteral() != NULL && AsLiteral()->handle()->IsUndefined();
+ return AsLiteral() != NULL && AsLiteral()->value()->IsUndefined();
}
@@ -189,7 +189,7 @@ ObjectLiteralProperty::ObjectLiteralProperty(Literal* key,
emit_store_ = true;
key_ = key;
value_ = value;
- Object* k = *key->handle();
+ Object* k = *key->value();
if (k->IsInternalizedString() &&
isolate->heap()->proto_string()->Equals(String::cast(k))) {
kind_ = PROTOTYPE;
@@ -263,7 +263,7 @@ void ObjectLiteral::CalculateEmitStore(Zone* zone) {
for (int i = properties()->length() - 1; i >= 0; i--) {
ObjectLiteral::Property* property = properties()->at(i);
Literal* literal = property->key();
- if (literal->handle()->IsNull()) continue;
+ if (literal->value()->IsNull()) continue;
uint32_t hash = literal->Hash();
// If the key of a computed property is in the table, do not emit
// a store for the property later.
@@ -338,7 +338,7 @@ static bool MatchLiteralCompareTypeof(Expression* left,
Handle<String>* check) {
if (IsTypeof(left) && right->IsStringLiteral() && Token::IsEqualityOp(op)) {
*expr = left->AsUnaryOperation()->expression();
- *check = Handle<String>::cast(right->AsLiteral()->handle());
+ *check = Handle<String>::cast(right->AsLiteral()->value());
return true;
}
return false;
@@ -449,8 +449,8 @@ void Property::RecordTypeFeedback(TypeFeedbackOracle* oracle,
is_function_prototype_ = true;
} else {
Literal* lit_key = key()->AsLiteral();
- ASSERT(lit_key != NULL && lit_key->handle()->IsString());
- Handle<String> name = Handle<String>::cast(lit_key->handle());
+ ASSERT(lit_key != NULL && lit_key->value()->IsString());
+ Handle<String> name = Handle<String>::cast(lit_key->value());
oracle->LoadReceiverTypes(this, name, &receiver_types_);
}
} else if (oracle->LoadIsBuiltin(this, Builtins::kKeyedLoadIC_String)) {
@@ -476,8 +476,8 @@ void Assignment::RecordTypeFeedback(TypeFeedbackOracle* oracle,
receiver_types_.Clear();
if (prop->key()->IsPropertyName()) {
Literal* lit_key = prop->key()->AsLiteral();
- ASSERT(lit_key != NULL && lit_key->handle()->IsString());
- Handle<String> name = Handle<String>::cast(lit_key->handle());
+ ASSERT(lit_key != NULL && lit_key->value()->IsString());
+ Handle<String> name = Handle<String>::cast(lit_key->value());
oracle->StoreReceiverTypes(this, name, &receiver_types_);
} else if (is_monomorphic_) {
// Record receiver type for monomorphic keyed stores.
@@ -619,8 +619,8 @@ void Call::RecordTypeFeedback(TypeFeedbackOracle* oracle,
} else {
// Method call. Specialize for the receiver types seen at runtime.
Literal* key = property->key()->AsLiteral();
- ASSERT(key != NULL && key->handle()->IsString());
- Handle<String> name = Handle<String>::cast(key->handle());
+ ASSERT(key != NULL && key->value()->IsString());
+ Handle<String> name = Handle<String>::cast(key->value());
receiver_types_.Clear();
oracle->CallReceiverTypes(this, name, call_kind, &receiver_types_);
#ifdef DEBUG
@@ -1152,18 +1152,18 @@ void AstConstructionVisitor::VisitCallRuntime(CallRuntime* node) {
Handle<String> Literal::ToString() {
- if (handle_->IsString()) return Handle<String>::cast(handle_);
+ if (value_->IsString()) return Handle<String>::cast(value_);
Factory* factory = Isolate::Current()->factory();
- ASSERT(handle_->IsNumber());
+ ASSERT(value_->IsNumber());
char arr[100];
Vector<char> buffer(arr, ARRAY_SIZE(arr));
const char* str;
- if (handle_->IsSmi()) {
+ if (value_->IsSmi()) {
// Optimization only, the heap number case would subsume this.
- OS::SNPrintF(buffer, "%d", Smi::cast(*handle_)->value());
+ OS::SNPrintF(buffer, "%d", Smi::cast(*value_)->value());
str = arr;
} else {
- str = DoubleToCString(handle_->Number(), buffer);
+ str = DoubleToCString(value_->Number(), buffer);
}
return factory->NewStringFromAscii(CStrVector(str));
}
« no previous file with comments | « src/ast.h ('k') | src/codegen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698