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

Unified Diff: src/ic.cc

Issue 225823003: Implement handlified String::Equals and Name::Equals. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: refactored StringToDouble Created 6 years, 8 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/ia32/lithium-codegen-ia32.cc ('k') | src/json-parser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic.cc
diff --git a/src/ic.cc b/src/ic.cc
index a00df8537c0724e5c1726d127f76641989809850..06e68ec091f083eaf8b99b1a08b31673cf5d0ad3 100644
--- a/src/ic.cc
+++ b/src/ic.cc
@@ -547,7 +547,7 @@ MaybeObject* LoadIC::Load(Handle<Object> object,
if (FLAG_use_ic) {
// Use specialized code for getting prototype of functions.
if (object->IsJSFunction() &&
- name->Equals(isolate()->heap()->prototype_string()) &&
+ String::Equals(isolate()->factory()->prototype_string(), name) &&
Handle<JSFunction>::cast(object)->should_have_prototype()) {
Handle<Code> stub;
if (state() == UNINITIALIZED) {
@@ -889,13 +889,14 @@ Handle<Code> LoadIC::CompileHandler(LookupResult* lookup,
Handle<String> name,
Handle<Object> unused,
InlineCacheHolderFlag cache_holder) {
- if (object->IsString() && name->Equals(isolate()->heap()->length_string())) {
+ if (object->IsString() &&
+ String::Equals(isolate()->factory()->length_string(), name)) {
int length_index = String::kLengthOffset / kPointerSize;
return SimpleFieldLoad(length_index);
}
if (object->IsStringWrapper() &&
- name->Equals(isolate()->heap()->length_string())) {
+ String::Equals(isolate()->factory()->length_string(), name)) {
if (kind() == Code::LOAD_IC) {
StringLengthStub string_length_stub;
return string_length_stub.GetCode(isolate());
@@ -1213,7 +1214,7 @@ MaybeObject* StoreIC::Store(Handle<Object> object,
// The length property of string values is read-only. Throw in strict mode.
if (strict_mode() == STRICT && object->IsString() &&
- name->Equals(isolate()->heap()->length_string())) {
+ String::Equals(isolate()->factory()->length_string(), name)) {
return TypeError("strict_read_only_property", object, name);
}
@@ -1400,7 +1401,7 @@ Handle<Code> StoreIC::CompileHandler(LookupResult* lookup,
// properties. Slow properties might indicate redefinition of the length
// property.
if (receiver->IsJSArray() &&
- name->Equals(isolate()->heap()->length_string()) &&
+ String::Equals(isolate()->factory()->length_string(), name) &&
Handle<JSArray>::cast(receiver)->AllowsSetElementsLength() &&
receiver->HasFastProperties()) {
return compiler.CompileStoreArrayLength(receiver, lookup, name);
« no previous file with comments | « src/ia32/lithium-codegen-ia32.cc ('k') | src/json-parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698