OLD | NEW |
---|---|
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 1435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1446 NoHandleAllocation ha; | 1446 NoHandleAllocation ha; |
1447 ASSERT(args.length() == 2); | 1447 ASSERT(args.length() == 2); |
1448 | 1448 |
1449 Handle<Object> object = args.at<Object>(0); | 1449 Handle<Object> object = args.at<Object>(0); |
1450 Handle<Object> key = args.at<Object>(1); | 1450 Handle<Object> key = args.at<Object>(1); |
1451 | 1451 |
1452 return Runtime::GetObjectProperty(object, key); | 1452 return Runtime::GetObjectProperty(object, key); |
1453 } | 1453 } |
1454 | 1454 |
1455 | 1455 |
1456 | |
1457 // KeyedStringGetProperty is called from KeyedLoadIC::GenerateGeneric | |
1458 static Object* Runtime_KeyedGetProperty(Arguments args) { | |
1459 NoHandleAllocation ha; | |
1460 ASSERT(args.length() == 2); | |
1461 | |
1462 Object* receiver = args[0]; | |
1463 Object* key = args[1]; | |
1464 if (receiver->IsJSObject() | |
1465 && key->IsString() | |
Kasper Lund
2008/10/10 09:32:06
Why not have the && on the previous line?
| |
1466 && !JSObject::cast(receiver)->HasFastProperties()) { | |
Kasper Lund
2008/10/10 09:32:06
Ditto.
| |
1467 Dictionary* dictionary = JSObject::cast(receiver)->property_dictionary(); | |
1468 int entry = dictionary->FindStringEntry(String::cast(key)); | |
1469 if ((entry != DescriptorArray::kNotFound) | |
1470 && (dictionary->DetailsAt(entry).type() == NORMAL)) { | |
Kasper Lund
2008/10/10 09:32:06
Ditto.
| |
1471 return dictionary->ValueAt(entry); | |
1472 } | |
1473 } | |
1474 return Runtime::GetObjectProperty(args.at<Object>(0), | |
1475 args.at<Object>(1)); | |
1476 } | |
1477 | |
1478 | |
1456 Object* Runtime::SetObjectProperty(Handle<Object> object, | 1479 Object* Runtime::SetObjectProperty(Handle<Object> object, |
1457 Handle<Object> key, | 1480 Handle<Object> key, |
1458 Handle<Object> value, | 1481 Handle<Object> value, |
1459 PropertyAttributes attr) { | 1482 PropertyAttributes attr) { |
1460 HandleScope scope; | 1483 HandleScope scope; |
1461 | 1484 |
1462 if (object->IsUndefined() || object->IsNull()) { | 1485 if (object->IsUndefined() || object->IsNull()) { |
1463 Handle<Object> args[2] = { key, object }; | 1486 Handle<Object> args[2] = { key, object }; |
1464 Handle<Object> error = | 1487 Handle<Object> error = |
1465 Factory::NewTypeError("non_object_property_store", | 1488 Factory::NewTypeError("non_object_property_store", |
(...skipping 3733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5199 | 5222 |
5200 void Runtime::PerformGC(Object* result) { | 5223 void Runtime::PerformGC(Object* result) { |
5201 Failure* failure = Failure::cast(result); | 5224 Failure* failure = Failure::cast(result); |
5202 // Try to do a garbage collection; ignore it if it fails. The C | 5225 // Try to do a garbage collection; ignore it if it fails. The C |
5203 // entry stub will throw an out-of-memory exception in that case. | 5226 // entry stub will throw an out-of-memory exception in that case. |
5204 Heap::CollectGarbage(failure->requested(), failure->allocation_space()); | 5227 Heap::CollectGarbage(failure->requested(), failure->allocation_space()); |
5205 } | 5228 } |
5206 | 5229 |
5207 | 5230 |
5208 } } // namespace v8::internal | 5231 } } // namespace v8::internal |
OLD | NEW |