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

Side by Side Diff: src/objects.cc

Issue 238263003: Reland r20772 "Handlifying clients of StringTable, step 1." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: The fix 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 unified diff | Download patch | Annotate | Revision Log
« src/heap.cc ('K') | « src/objects.h ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 10375 matching lines...) Expand 10 before | Expand all | Expand 10 after
10386 return true; 10386 return true;
10387 } 10387 }
10388 if (filter[filter.length() - 1] == '*' && 10388 if (filter[filter.length() - 1] == '*' &&
10389 name->IsUtf8EqualTo(filter.SubVector(0, filter.length() - 1), true)) { 10389 name->IsUtf8EqualTo(filter.SubVector(0, filter.length() - 1), true)) {
10390 return true; 10390 return true;
10391 } 10391 }
10392 return false; 10392 return false;
10393 } 10393 }
10394 10394
10395 10395
10396 MaybeObject* Oddball::Initialize(Heap* heap, 10396 void Oddball::Initialize(Isolate* isolate,
10397 const char* to_string, 10397 Handle<Oddball> oddball,
10398 Object* to_number, 10398 const char* to_string,
10399 byte kind) { 10399 Handle<Object> to_number,
10400 String* internalized_to_string; 10400 byte kind) {
10401 { MaybeObject* maybe_string = 10401 Handle<String> internalized_to_string =
10402 heap->InternalizeUtf8String( 10402 isolate->factory()->InternalizeUtf8String(CStrVector(to_string));
10403 CStrVector(to_string)); 10403 oddball->set_to_string(*internalized_to_string);
10404 if (!maybe_string->To(&internalized_to_string)) return maybe_string; 10404 oddball->set_to_number(*to_number);
10405 } 10405 oddball->set_kind(kind);
10406 set_to_string(internalized_to_string);
10407 set_to_number(to_number);
10408 set_kind(kind);
10409 return this;
10410 } 10406 }
10411 10407
10412 10408
10413 void Script::InitLineEnds(Handle<Script> script) { 10409 void Script::InitLineEnds(Handle<Script> script) {
10414 if (!script->line_ends()->IsUndefined()) return; 10410 if (!script->line_ends()->IsUndefined()) return;
10415 10411
10416 Isolate* isolate = script->GetIsolate(); 10412 Isolate* isolate = script->GetIsolate();
10417 10413
10418 if (!script->source()->IsString()) { 10414 if (!script->source()->IsString()) {
10419 ASSERT(script->source()->IsUndefined()); 10415 ASSERT(script->source()->IsUndefined());
(...skipping 4447 matching lines...) Expand 10 before | Expand all | Expand 10 after
14867 Dictionary<SeededNumberDictionary, SeededNumberDictionaryShape, uint32_t>:: 14863 Dictionary<SeededNumberDictionary, SeededNumberDictionaryShape, uint32_t>::
14868 Allocate(Heap* heap, int at_least_space_for, PretenureFlag pretenure); 14864 Allocate(Heap* heap, int at_least_space_for, PretenureFlag pretenure);
14869 14865
14870 template MaybeObject* 14866 template MaybeObject*
14871 Dictionary<UnseededNumberDictionary, UnseededNumberDictionaryShape, uint32_t>:: 14867 Dictionary<UnseededNumberDictionary, UnseededNumberDictionaryShape, uint32_t>::
14872 Allocate(Heap* heap, int at_least_space_for, PretenureFlag pretenure); 14868 Allocate(Heap* heap, int at_least_space_for, PretenureFlag pretenure);
14873 14869
14874 template MaybeObject* Dictionary<NameDictionary, NameDictionaryShape, Name*>:: 14870 template MaybeObject* Dictionary<NameDictionary, NameDictionaryShape, Name*>::
14875 Allocate(Heap* heap, int n, PretenureFlag pretenure); 14871 Allocate(Heap* heap, int n, PretenureFlag pretenure);
14876 14872
14873 template Handle<NameDictionary>
14874 Dictionary<NameDictionary, NameDictionaryShape, Name*>::
14875 New(Isolate* isolate, int n, PretenureFlag pretenure);
14876
14877 template MaybeObject* 14877 template MaybeObject*
14878 Dictionary<SeededNumberDictionary, SeededNumberDictionaryShape, uint32_t>:: 14878 Dictionary<SeededNumberDictionary, SeededNumberDictionaryShape, uint32_t>::
14879 AtPut(uint32_t, Object*); 14879 AtPut(uint32_t, Object*);
14880 14880
14881 template MaybeObject* 14881 template MaybeObject*
14882 Dictionary<UnseededNumberDictionary, UnseededNumberDictionaryShape, uint32_t>:: 14882 Dictionary<UnseededNumberDictionary, UnseededNumberDictionaryShape, uint32_t>::
14883 AtPut(uint32_t, Object*); 14883 AtPut(uint32_t, Object*);
14884 14884
14885 template Object* 14885 template Object*
14886 Dictionary<SeededNumberDictionary, SeededNumberDictionaryShape, uint32_t>:: 14886 Dictionary<SeededNumberDictionary, SeededNumberDictionaryShape, uint32_t>::
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
14921 Dictionary<SeededNumberDictionary, SeededNumberDictionaryShape, uint32_t>:: 14921 Dictionary<SeededNumberDictionary, SeededNumberDictionaryShape, uint32_t>::
14922 DeleteProperty( 14922 DeleteProperty(
14923 Handle<Dictionary<SeededNumberDictionary, 14923 Handle<Dictionary<SeededNumberDictionary,
14924 SeededNumberDictionaryShape, 14924 SeededNumberDictionaryShape,
14925 uint32_t> >, 14925 uint32_t> >,
14926 int, 14926 int,
14927 JSObject::DeleteMode); 14927 JSObject::DeleteMode);
14928 14928
14929 template Handle<NameDictionary> 14929 template Handle<NameDictionary>
14930 HashTable<NameDictionary, NameDictionaryShape, Name*>:: 14930 HashTable<NameDictionary, NameDictionaryShape, Name*>::
14931 New(Isolate*, int, MinimumCapacity, PretenureFlag);
14932
14933 template Handle<NameDictionary>
14934 HashTable<NameDictionary, NameDictionaryShape, Name*>::
14931 Shrink(Handle<NameDictionary>, Name* n); 14935 Shrink(Handle<NameDictionary>, Name* n);
14932 14936
14933 template Handle<SeededNumberDictionary> 14937 template Handle<SeededNumberDictionary>
14934 HashTable<SeededNumberDictionary, SeededNumberDictionaryShape, uint32_t>:: 14938 HashTable<SeededNumberDictionary, SeededNumberDictionaryShape, uint32_t>::
14935 Shrink(Handle<SeededNumberDictionary>, uint32_t); 14939 Shrink(Handle<SeededNumberDictionary>, uint32_t);
14936 14940
14937 template void Dictionary<NameDictionary, NameDictionaryShape, Name*>:: 14941 template void Dictionary<NameDictionary, NameDictionaryShape, Name*>::
14938 CopyKeysTo( 14942 CopyKeysTo(
14939 FixedArray*, 14943 FixedArray*,
14940 int, 14944 int,
(...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after
15781 pretenure); 15785 pretenure);
15782 if (!maybe_obj->ToObject(&obj)) return maybe_obj; 15786 if (!maybe_obj->ToObject(&obj)) return maybe_obj;
15783 } 15787 }
15784 // Initialize the next enumeration index. 15788 // Initialize the next enumeration index.
15785 Dictionary::cast(obj)-> 15789 Dictionary::cast(obj)->
15786 SetNextEnumerationIndex(PropertyDetails::kInitialIndex); 15790 SetNextEnumerationIndex(PropertyDetails::kInitialIndex);
15787 return obj; 15791 return obj;
15788 } 15792 }
15789 15793
15790 15794
15795 template<typename Derived, typename Shape, typename Key>
15796 Handle<Derived> Dictionary<Derived, Shape, Key>::New(
15797 Isolate* isolate,
15798 int at_least_space_for,
15799 PretenureFlag pretenure) {
15800 Handle<Derived> dict = DerivedHashTable::New(isolate,
15801 at_least_space_for,
15802 USE_DEFAULT_MINIMUM_CAPACITY,
15803 pretenure);
15804
15805 // Initialize the next enumeration index.
15806 dict->SetNextEnumerationIndex(PropertyDetails::kInitialIndex);
15807 return dict;
15808 }
15809
15810
15811
15791 void NameDictionary::DoGenerateNewEnumerationIndices( 15812 void NameDictionary::DoGenerateNewEnumerationIndices(
15792 Handle<NameDictionary> dictionary) { 15813 Handle<NameDictionary> dictionary) {
15793 CALL_HEAP_FUNCTION_VOID(dictionary->GetIsolate(), 15814 CALL_HEAP_FUNCTION_VOID(dictionary->GetIsolate(),
15794 dictionary->GenerateNewEnumerationIndices()); 15815 dictionary->GenerateNewEnumerationIndices());
15795 } 15816 }
15796 15817
15797 template<typename Derived, typename Shape, typename Key> 15818 template<typename Derived, typename Shape, typename Key>
15798 MaybeObject* Dictionary<Derived, Shape, Key>::GenerateNewEnumerationIndices() { 15819 MaybeObject* Dictionary<Derived, Shape, Key>::GenerateNewEnumerationIndices() {
15799 Heap* heap = Dictionary::GetHeap(); 15820 Heap* heap = Dictionary::GetHeap();
15800 int length = DerivedHashTable::NumberOfElements(); 15821 int length = DerivedHashTable::NumberOfElements();
(...skipping 1296 matching lines...) Expand 10 before | Expand all | Expand 10 after
17097 #define ERROR_MESSAGES_TEXTS(C, T) T, 17118 #define ERROR_MESSAGES_TEXTS(C, T) T,
17098 static const char* error_messages_[] = { 17119 static const char* error_messages_[] = {
17099 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) 17120 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)
17100 }; 17121 };
17101 #undef ERROR_MESSAGES_TEXTS 17122 #undef ERROR_MESSAGES_TEXTS
17102 return error_messages_[reason]; 17123 return error_messages_[reason];
17103 } 17124 }
17104 17125
17105 17126
17106 } } // namespace v8::internal 17127 } } // namespace v8::internal
OLDNEW
« src/heap.cc ('K') | « src/objects.h ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698