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

Side by Side Diff: src/objects-inl.h

Issue 7385006: Reintroduced dictionary that can use objects as keys. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Incorporated review by Vitaly Repeshko. Created 9 years, 4 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
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 4338 matching lines...) Expand 10 before | Expand all | Expand 10 after
4349 uint32_t StringDictionaryShape::HashForObject(String* key, Object* other) { 4349 uint32_t StringDictionaryShape::HashForObject(String* key, Object* other) {
4350 return String::cast(other)->Hash(); 4350 return String::cast(other)->Hash();
4351 } 4351 }
4352 4352
4353 4353
4354 MaybeObject* StringDictionaryShape::AsObject(String* key) { 4354 MaybeObject* StringDictionaryShape::AsObject(String* key) {
4355 return key; 4355 return key;
4356 } 4356 }
4357 4357
4358 4358
4359 bool ObjectHashTableShape::IsMatch(JSObject* key, Object* other) {
4360 return key == JSObject::cast(other);
4361 }
4362
4363
4364 uint32_t ObjectHashTableShape::Hash(JSObject* key) {
4365 MaybeObject* maybe_hash = key->GetIdentityHash(JSObject::OMIT_CREATION);
4366 ASSERT(!maybe_hash->IsFailure());
4367 return Smi::cast(maybe_hash->ToObjectUnchecked())->value();
4368 }
4369
4370
4371 uint32_t ObjectHashTableShape::HashForObject(JSObject* key, Object* other) {
4372 MaybeObject* maybe_hash = JSObject::cast(other)->GetIdentityHash(
4373 JSObject::OMIT_CREATION);
4374 ASSERT(!maybe_hash->IsFailure());
4375 return Smi::cast(maybe_hash->ToObjectUnchecked())->value();
4376 }
4377
4378
4379 MaybeObject* ObjectHashTableShape::AsObject(JSObject* key) {
4380 return key;
4381 }
4382
4383
4359 void Map::ClearCodeCache(Heap* heap) { 4384 void Map::ClearCodeCache(Heap* heap) {
4360 // No write barrier is needed since empty_fixed_array is not in new space. 4385 // No write barrier is needed since empty_fixed_array is not in new space.
4361 // Please note this function is used during marking: 4386 // Please note this function is used during marking:
4362 // - MarkCompactCollector::MarkUnmarkedObject 4387 // - MarkCompactCollector::MarkUnmarkedObject
4363 ASSERT(!heap->InNewSpace(heap->raw_unchecked_empty_fixed_array())); 4388 ASSERT(!heap->InNewSpace(heap->raw_unchecked_empty_fixed_array()));
4364 WRITE_FIELD(this, kCodeCacheOffset, heap->raw_unchecked_empty_fixed_array()); 4389 WRITE_FIELD(this, kCodeCacheOffset, heap->raw_unchecked_empty_fixed_array());
4365 } 4390 }
4366 4391
4367 4392
4368 void JSArray::EnsureSize(int required_size) { 4393 void JSArray::EnsureSize(int required_size) {
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
4500 #undef WRITE_INT_FIELD 4525 #undef WRITE_INT_FIELD
4501 #undef READ_SHORT_FIELD 4526 #undef READ_SHORT_FIELD
4502 #undef WRITE_SHORT_FIELD 4527 #undef WRITE_SHORT_FIELD
4503 #undef READ_BYTE_FIELD 4528 #undef READ_BYTE_FIELD
4504 #undef WRITE_BYTE_FIELD 4529 #undef WRITE_BYTE_FIELD
4505 4530
4506 4531
4507 } } // namespace v8::internal 4532 } } // namespace v8::internal
4508 4533
4509 #endif // V8_OBJECTS_INL_H_ 4534 #endif // V8_OBJECTS_INL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698