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

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
« no previous file with comments | « src/objects.cc ('k') | src/runtime.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4234 matching lines...) Expand 10 before | Expand all | Expand 10 after
4245 4245
4246 MaybeObject* JSObject::SetHiddenPropertiesObject(Object* hidden_obj) { 4246 MaybeObject* JSObject::SetHiddenPropertiesObject(Object* hidden_obj) {
4247 ASSERT(!IsJSGlobalProxy()); 4247 ASSERT(!IsJSGlobalProxy());
4248 return SetPropertyPostInterceptor(GetHeap()->hidden_symbol(), 4248 return SetPropertyPostInterceptor(GetHeap()->hidden_symbol(),
4249 hidden_obj, 4249 hidden_obj,
4250 DONT_ENUM, 4250 DONT_ENUM,
4251 kNonStrictMode); 4251 kNonStrictMode);
4252 } 4252 }
4253 4253
4254 4254
4255 bool JSObject::HasHiddenProperties() {
4256 return !GetHiddenProperties(OMIT_CREATION)->ToObjectChecked()->IsUndefined();
4257 }
4258
4259
4255 bool JSObject::HasElement(uint32_t index) { 4260 bool JSObject::HasElement(uint32_t index) {
4256 return HasElementWithReceiver(this, index); 4261 return HasElementWithReceiver(this, index);
4257 } 4262 }
4258 4263
4259 4264
4260 bool AccessorInfo::all_can_read() { 4265 bool AccessorInfo::all_can_read() {
4261 return BooleanBit::get(flag(), kAllCanReadBit); 4266 return BooleanBit::get(flag(), kAllCanReadBit);
4262 } 4267 }
4263 4268
4264 4269
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
4360 uint32_t StringDictionaryShape::HashForObject(String* key, Object* other) { 4365 uint32_t StringDictionaryShape::HashForObject(String* key, Object* other) {
4361 return String::cast(other)->Hash(); 4366 return String::cast(other)->Hash();
4362 } 4367 }
4363 4368
4364 4369
4365 MaybeObject* StringDictionaryShape::AsObject(String* key) { 4370 MaybeObject* StringDictionaryShape::AsObject(String* key) {
4366 return key; 4371 return key;
4367 } 4372 }
4368 4373
4369 4374
4375 bool ObjectHashTableShape::IsMatch(JSObject* key, Object* other) {
4376 return key == JSObject::cast(other);
4377 }
4378
4379
4380 uint32_t ObjectHashTableShape::Hash(JSObject* key) {
4381 MaybeObject* maybe_hash = key->GetIdentityHash(JSObject::OMIT_CREATION);
4382 ASSERT(!maybe_hash->IsFailure());
4383 return Smi::cast(maybe_hash->ToObjectUnchecked())->value();
4384 }
4385
4386
4387 uint32_t ObjectHashTableShape::HashForObject(JSObject* key, Object* other) {
4388 MaybeObject* maybe_hash = JSObject::cast(other)->GetIdentityHash(
4389 JSObject::OMIT_CREATION);
4390 ASSERT(!maybe_hash->IsFailure());
4391 return Smi::cast(maybe_hash->ToObjectUnchecked())->value();
4392 }
4393
4394
4395 MaybeObject* ObjectHashTableShape::AsObject(JSObject* key) {
4396 return key;
4397 }
4398
4399
4370 void Map::ClearCodeCache(Heap* heap) { 4400 void Map::ClearCodeCache(Heap* heap) {
4371 // No write barrier is needed since empty_fixed_array is not in new space. 4401 // No write barrier is needed since empty_fixed_array is not in new space.
4372 // Please note this function is used during marking: 4402 // Please note this function is used during marking:
4373 // - MarkCompactCollector::MarkUnmarkedObject 4403 // - MarkCompactCollector::MarkUnmarkedObject
4374 ASSERT(!heap->InNewSpace(heap->raw_unchecked_empty_fixed_array())); 4404 ASSERT(!heap->InNewSpace(heap->raw_unchecked_empty_fixed_array()));
4375 WRITE_FIELD(this, kCodeCacheOffset, heap->raw_unchecked_empty_fixed_array()); 4405 WRITE_FIELD(this, kCodeCacheOffset, heap->raw_unchecked_empty_fixed_array());
4376 } 4406 }
4377 4407
4378 4408
4379 void JSArray::EnsureSize(int required_size) { 4409 void JSArray::EnsureSize(int required_size) {
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
4511 #undef WRITE_INT_FIELD 4541 #undef WRITE_INT_FIELD
4512 #undef READ_SHORT_FIELD 4542 #undef READ_SHORT_FIELD
4513 #undef WRITE_SHORT_FIELD 4543 #undef WRITE_SHORT_FIELD
4514 #undef READ_BYTE_FIELD 4544 #undef READ_BYTE_FIELD
4515 #undef WRITE_BYTE_FIELD 4545 #undef WRITE_BYTE_FIELD
4516 4546
4517 4547
4518 } } // namespace v8::internal 4548 } } // namespace v8::internal
4519 4549
4520 #endif // V8_OBJECTS_INL_H_ 4550 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698