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

Side by Side Diff: src/stub-cache.cc

Issue 196133017: Experimental parser: merge r19949 (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 6 years, 9 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/stub-cache.h ('k') | src/token.h » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 Handle<HeapType> type) { 172 Handle<HeapType> type) {
173 InlineCacheHolderFlag flag = IC::GetCodeCacheFlag(*type); 173 InlineCacheHolderFlag flag = IC::GetCodeCacheFlag(*type);
174 Handle<Map> stub_holder = IC::GetCodeCacheHolder(flag, *type, isolate()); 174 Handle<Map> stub_holder = IC::GetCodeCacheHolder(flag, *type, isolate());
175 // If no dictionary mode objects are present in the prototype chain, the load 175 // If no dictionary mode objects are present in the prototype chain, the load
176 // nonexistent IC stub can be shared for all names for a given map and we use 176 // nonexistent IC stub can be shared for all names for a given map and we use
177 // the empty string for the map cache in that case. If there are dictionary 177 // the empty string for the map cache in that case. If there are dictionary
178 // mode objects involved, we need to do negative lookups in the stub and 178 // mode objects involved, we need to do negative lookups in the stub and
179 // therefore the stub will be specific to the name. 179 // therefore the stub will be specific to the name.
180 Handle<Map> current_map = stub_holder; 180 Handle<Map> current_map = stub_holder;
181 Handle<Name> cache_name = current_map->is_dictionary_map() 181 Handle<Name> cache_name = current_map->is_dictionary_map()
182 ? name : Handle<Name>::cast(isolate()->factory()->empty_string()); 182 ? name : Handle<Name>::cast(isolate()->factory()->nonexistent_symbol());
183 Handle<Object> next(current_map->prototype(), isolate()); 183 Handle<Object> next(current_map->prototype(), isolate());
184 Handle<JSObject> last = Handle<JSObject>::null(); 184 Handle<JSObject> last = Handle<JSObject>::null();
185 while (!next->IsNull()) { 185 while (!next->IsNull()) {
186 last = Handle<JSObject>::cast(next); 186 last = Handle<JSObject>::cast(next);
187 next = handle(current_map->prototype(), isolate()); 187 next = handle(current_map->prototype(), isolate());
188 current_map = handle(Handle<HeapObject>::cast(next)->map()); 188 current_map = handle(Handle<HeapObject>::cast(next)->map());
189 if (current_map->is_dictionary_map()) cache_name = name; 189 if (current_map->is_dictionary_map()) cache_name = name;
190 } 190 }
191 191
192 // Compile the stub that is either shared for all names or 192 // Compile the stub that is either shared for all names or
(...skipping 22 matching lines...) Expand all
215 KeyedLoadStubCompiler compiler(isolate()); 215 KeyedLoadStubCompiler compiler(isolate());
216 Handle<Code> code = compiler.CompileLoadElement(receiver_map); 216 Handle<Code> code = compiler.CompileLoadElement(receiver_map);
217 217
218 Map::UpdateCodeCache(receiver_map, name, code); 218 Map::UpdateCodeCache(receiver_map, name, code);
219 return code; 219 return code;
220 } 220 }
221 221
222 222
223 Handle<Code> StubCache::ComputeKeyedStoreElement( 223 Handle<Code> StubCache::ComputeKeyedStoreElement(
224 Handle<Map> receiver_map, 224 Handle<Map> receiver_map,
225 StrictModeFlag strict_mode, 225 StrictMode strict_mode,
226 KeyedAccessStoreMode store_mode) { 226 KeyedAccessStoreMode store_mode) {
227 ExtraICState extra_state = 227 ExtraICState extra_state =
228 KeyedStoreIC::ComputeExtraICState(strict_mode, store_mode); 228 KeyedStoreIC::ComputeExtraICState(strict_mode, store_mode);
229 Code::Flags flags = Code::ComputeMonomorphicFlags( 229 Code::Flags flags = Code::ComputeMonomorphicFlags(
230 Code::KEYED_STORE_IC, extra_state); 230 Code::KEYED_STORE_IC, extra_state);
231 231
232 ASSERT(store_mode == STANDARD_STORE || 232 ASSERT(store_mode == STANDARD_STORE ||
233 store_mode == STORE_AND_GROW_NO_TRANSITION || 233 store_mode == STORE_AND_GROW_NO_TRANSITION ||
234 store_mode == STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS || 234 store_mode == STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS ||
235 store_mode == STORE_NO_TRANSITION_HANDLE_COW); 235 store_mode == STORE_NO_TRANSITION_HANDLE_COW);
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 StoreStubCompiler ic_compiler(isolate_, extra_ic_state); 389 StoreStubCompiler ic_compiler(isolate_, extra_ic_state);
390 return ic_compiler.CompilePolymorphicIC( 390 return ic_compiler.CompilePolymorphicIC(
391 types, handlers, name, type, PROPERTY); 391 types, handlers, name, type, PROPERTY);
392 } 392 }
393 } 393 }
394 394
395 395
396 Handle<Code> StubCache::ComputeStoreElementPolymorphic( 396 Handle<Code> StubCache::ComputeStoreElementPolymorphic(
397 MapHandleList* receiver_maps, 397 MapHandleList* receiver_maps,
398 KeyedAccessStoreMode store_mode, 398 KeyedAccessStoreMode store_mode,
399 StrictModeFlag strict_mode) { 399 StrictMode strict_mode) {
400 ASSERT(store_mode == STANDARD_STORE || 400 ASSERT(store_mode == STANDARD_STORE ||
401 store_mode == STORE_AND_GROW_NO_TRANSITION || 401 store_mode == STORE_AND_GROW_NO_TRANSITION ||
402 store_mode == STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS || 402 store_mode == STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS ||
403 store_mode == STORE_NO_TRANSITION_HANDLE_COW); 403 store_mode == STORE_NO_TRANSITION_HANDLE_COW);
404 Handle<PolymorphicCodeCache> cache = 404 Handle<PolymorphicCodeCache> cache =
405 isolate_->factory()->polymorphic_code_cache(); 405 isolate_->factory()->polymorphic_code_cache();
406 ExtraICState extra_state = KeyedStoreIC::ComputeExtraICState( 406 ExtraICState extra_state = KeyedStoreIC::ComputeExtraICState(
407 strict_mode, store_mode); 407 strict_mode, store_mode);
408 Code::Flags flags = 408 Code::Flags flags =
409 Code::ComputeFlags(Code::KEYED_STORE_IC, POLYMORPHIC, extra_state); 409 Code::ComputeFlags(Code::KEYED_STORE_IC, POLYMORPHIC, extra_state);
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
715 Handle<Code> code = GetCodeWithFlags(flags, "CompileStorePreMonomorphic"); 715 Handle<Code> code = GetCodeWithFlags(flags, "CompileStorePreMonomorphic");
716 PROFILE(isolate(), 716 PROFILE(isolate(),
717 CodeCreateEvent(Logger::STORE_PREMONOMORPHIC_TAG, *code, 0)); 717 CodeCreateEvent(Logger::STORE_PREMONOMORPHIC_TAG, *code, 0));
718 GDBJIT(AddCode(GDBJITInterface::STORE_IC, *code)); 718 GDBJIT(AddCode(GDBJITInterface::STORE_IC, *code));
719 return code; 719 return code;
720 } 720 }
721 721
722 722
723 Handle<Code> StubCompiler::CompileStoreGeneric(Code::Flags flags) { 723 Handle<Code> StubCompiler::CompileStoreGeneric(Code::Flags flags) {
724 ExtraICState extra_state = Code::ExtractExtraICStateFromFlags(flags); 724 ExtraICState extra_state = Code::ExtractExtraICStateFromFlags(flags);
725 StrictModeFlag strict_mode = StoreIC::GetStrictMode(extra_state); 725 StrictMode strict_mode = StoreIC::GetStrictMode(extra_state);
726 StoreIC::GenerateRuntimeSetProperty(masm(), strict_mode); 726 StoreIC::GenerateRuntimeSetProperty(masm(), strict_mode);
727 Handle<Code> code = GetCodeWithFlags(flags, "CompileStoreGeneric"); 727 Handle<Code> code = GetCodeWithFlags(flags, "CompileStoreGeneric");
728 PROFILE(isolate(), 728 PROFILE(isolate(),
729 CodeCreateEvent(Logger::STORE_GENERIC_TAG, *code, 0)); 729 CodeCreateEvent(Logger::STORE_GENERIC_TAG, *code, 0));
730 GDBJIT(AddCode(GDBJITInterface::STORE_IC, *code)); 730 GDBJIT(AddCode(GDBJITInterface::STORE_IC, *code));
731 return code; 731 return code;
732 } 732 }
733 733
734 734
735 Handle<Code> StubCompiler::CompileStoreMegamorphic(Code::Flags flags) { 735 Handle<Code> StubCompiler::CompileStoreMegamorphic(Code::Flags flags) {
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
1118 } 1118 }
1119 1119
1120 1120
1121 Handle<Code> StoreStubCompiler::CompileStoreViaSetter( 1121 Handle<Code> StoreStubCompiler::CompileStoreViaSetter(
1122 Handle<JSObject> object, 1122 Handle<JSObject> object,
1123 Handle<JSObject> holder, 1123 Handle<JSObject> holder,
1124 Handle<Name> name, 1124 Handle<Name> name,
1125 Handle<JSFunction> setter) { 1125 Handle<JSFunction> setter) {
1126 Handle<HeapType> type = IC::CurrentTypeOf(object, isolate()); 1126 Handle<HeapType> type = IC::CurrentTypeOf(object, isolate());
1127 HandlerFrontend(type, receiver(), holder, name); 1127 HandlerFrontend(type, receiver(), holder, name);
1128 GenerateStoreViaSetter(masm(), type, setter); 1128 GenerateStoreViaSetter(masm(), type, receiver(), setter);
1129 1129
1130 return GetCode(kind(), Code::FAST, name); 1130 return GetCode(kind(), Code::FAST, name);
1131 } 1131 }
1132 1132
1133 1133
1134 Handle<Code> StoreStubCompiler::CompileStoreCallback( 1134 Handle<Code> StoreStubCompiler::CompileStoreCallback(
1135 Handle<JSObject> object, 1135 Handle<JSObject> object,
1136 Handle<JSObject> holder, 1136 Handle<JSObject> holder,
1137 Handle<Name> name, 1137 Handle<Name> name,
1138 const CallOptimization& call_optimization) { 1138 const CallOptimization& call_optimization) {
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
1462 Handle<FunctionTemplateInfo>( 1462 Handle<FunctionTemplateInfo>(
1463 FunctionTemplateInfo::cast(signature->receiver())); 1463 FunctionTemplateInfo::cast(signature->receiver()));
1464 } 1464 }
1465 } 1465 }
1466 1466
1467 is_simple_api_call_ = true; 1467 is_simple_api_call_ = true;
1468 } 1468 }
1469 1469
1470 1470
1471 } } // namespace v8::internal 1471 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/stub-cache.h ('k') | src/token.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698