Index: src/runtime.cc |
=================================================================== |
--- src/runtime.cc (revision 485) |
+++ src/runtime.cc (working copy) |
@@ -1453,6 +1453,29 @@ |
} |
+ |
+// KeyedStringGetProperty is called from KeyedLoadIC::GenerateGeneric |
+static Object* Runtime_KeyedGetProperty(Arguments args) { |
+ NoHandleAllocation ha; |
+ ASSERT(args.length() == 2); |
+ |
+ Object* receiver = args[0]; |
+ Object* key = args[1]; |
+ if (receiver->IsJSObject() |
+ && key->IsString() |
Kasper Lund
2008/10/10 09:32:06
Why not have the && on the previous line?
|
+ && !JSObject::cast(receiver)->HasFastProperties()) { |
Kasper Lund
2008/10/10 09:32:06
Ditto.
|
+ Dictionary* dictionary = JSObject::cast(receiver)->property_dictionary(); |
+ int entry = dictionary->FindStringEntry(String::cast(key)); |
+ if ((entry != DescriptorArray::kNotFound) |
+ && (dictionary->DetailsAt(entry).type() == NORMAL)) { |
Kasper Lund
2008/10/10 09:32:06
Ditto.
|
+ return dictionary->ValueAt(entry); |
+ } |
+ } |
+ return Runtime::GetObjectProperty(args.at<Object>(0), |
+ args.at<Object>(1)); |
+} |
+ |
+ |
Object* Runtime::SetObjectProperty(Handle<Object> object, |
Handle<Object> key, |
Handle<Object> value, |