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

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

Issue 163363003: Don't mix handler flags into regular flag compuation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 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/type-info.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 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 if (probe->IsCode()) return Handle<Code>::cast(probe); 111 if (probe->IsCode()) return Handle<Code>::cast(probe);
112 return Handle<Code>::null(); 112 return Handle<Code>::null();
113 } 113 }
114 114
115 115
116 Handle<Code> StubCache::FindHandler(Handle<Name> name, 116 Handle<Code> StubCache::FindHandler(Handle<Name> name,
117 Handle<Map> stub_holder, 117 Handle<Map> stub_holder,
118 Code::Kind kind, 118 Code::Kind kind,
119 InlineCacheHolderFlag cache_holder) { 119 InlineCacheHolderFlag cache_holder) {
120 Code::Flags flags = Code::ComputeMonomorphicFlags( 120 Code::Flags flags = Code::ComputeMonomorphicFlags(
121 Code::HANDLER, kNoExtraICState, cache_holder, Code::NORMAL, kind); 121 Code::HANDLER, kNoExtraICState, cache_holder, Code::NORMAL);
122 122
123 Handle<Object> probe(stub_holder->FindInCodeCache(*name, flags), isolate_); 123 Handle<Object> probe(stub_holder->FindInCodeCache(*name, flags), isolate_);
124 if (probe->IsCode()) return Handle<Code>::cast(probe); 124 if (probe->IsCode()) return Handle<Code>::cast(probe);
125 return Handle<Code>::null(); 125 return Handle<Code>::null();
126 } 126 }
127 127
128 128
129 Handle<Code> StubCache::ComputeMonomorphicIC( 129 Handle<Code> StubCache::ComputeMonomorphicIC(
130 Code::Kind kind,
130 Handle<Name> name, 131 Handle<Name> name,
131 Handle<HeapType> type, 132 Handle<HeapType> type,
132 Handle<Code> handler, 133 Handle<Code> handler,
133 ExtraICState extra_ic_state) { 134 ExtraICState extra_ic_state) {
134 Code::Kind kind = handler->handler_kind();
135 InlineCacheHolderFlag flag = IC::GetCodeCacheFlag(*type); 135 InlineCacheHolderFlag flag = IC::GetCodeCacheFlag(*type);
136 136
137 Handle<Map> stub_holder; 137 Handle<Map> stub_holder;
138 Handle<Code> ic; 138 Handle<Code> ic;
139 // There are multiple string maps that all use the same prototype. That 139 // There are multiple string maps that all use the same prototype. That
140 // prototype cannot hold multiple handlers, one for each of the string maps, 140 // prototype cannot hold multiple handlers, one for each of the string maps,
141 // for a single name. Hence, turn off caching of the IC. 141 // for a single name. Hence, turn off caching of the IC.
142 bool can_be_cached = !type->Is(HeapType::String()); 142 bool can_be_cached = !type->Is(HeapType::String());
143 if (can_be_cached) { 143 if (can_be_cached) {
144 stub_holder = IC::GetCodeCacheHolder(flag, *type, isolate()); 144 stub_holder = IC::GetCodeCacheHolder(flag, *type, isolate());
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 &types, &handlers, factory()->empty_string(), Code::NORMAL, ELEMENT); 362 &types, &handlers, factory()->empty_string(), Code::NORMAL, ELEMENT);
363 363
364 isolate()->counters()->keyed_load_polymorphic_stubs()->Increment(); 364 isolate()->counters()->keyed_load_polymorphic_stubs()->Increment();
365 365
366 PolymorphicCodeCache::Update(cache, receiver_maps, flags, code); 366 PolymorphicCodeCache::Update(cache, receiver_maps, flags, code);
367 return code; 367 return code;
368 } 368 }
369 369
370 370
371 Handle<Code> StubCache::ComputePolymorphicIC( 371 Handle<Code> StubCache::ComputePolymorphicIC(
372 Code::Kind kind,
372 TypeHandleList* types, 373 TypeHandleList* types,
373 CodeHandleList* handlers, 374 CodeHandleList* handlers,
374 int number_of_valid_types, 375 int number_of_valid_types,
375 Handle<Name> name, 376 Handle<Name> name,
376 ExtraICState extra_ic_state) { 377 ExtraICState extra_ic_state) {
377
378 Handle<Code> handler = handlers->at(0); 378 Handle<Code> handler = handlers->at(0);
379 Code::Kind kind = handler->handler_kind();
380 Code::StubType type = number_of_valid_types == 1 ? handler->type() 379 Code::StubType type = number_of_valid_types == 1 ? handler->type()
381 : Code::NORMAL; 380 : Code::NORMAL;
382 if (kind == Code::LOAD_IC) { 381 if (kind == Code::LOAD_IC) {
383 LoadStubCompiler ic_compiler(isolate_, extra_ic_state); 382 LoadStubCompiler ic_compiler(isolate_, extra_ic_state);
384 return ic_compiler.CompilePolymorphicIC( 383 return ic_compiler.CompilePolymorphicIC(
385 types, handlers, name, type, PROPERTY); 384 types, handlers, name, type, PROPERTY);
386 } else { 385 } else {
387 ASSERT(kind == Code::STORE_IC); 386 ASSERT(kind == Code::STORE_IC);
388 StoreStubCompiler ic_compiler(isolate_, extra_ic_state); 387 StoreStubCompiler ic_compiler(isolate_, extra_ic_state);
389 return ic_compiler.CompilePolymorphicIC( 388 return ic_compiler.CompilePolymorphicIC(
(...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after
1229 Handle<Code> code = GetCodeWithFlags(flags, name); 1228 Handle<Code> code = GetCodeWithFlags(flags, name);
1230 PROFILE(isolate(), CodeCreateEvent(log_kind(code), *code, *name)); 1229 PROFILE(isolate(), CodeCreateEvent(log_kind(code), *code, *name));
1231 JitEvent(name, code); 1230 JitEvent(name, code);
1232 return code; 1231 return code;
1233 } 1232 }
1234 1233
1235 1234
1236 Handle<Code> BaseLoadStoreStubCompiler::GetCode(Code::Kind kind, 1235 Handle<Code> BaseLoadStoreStubCompiler::GetCode(Code::Kind kind,
1237 Code::StubType type, 1236 Code::StubType type,
1238 Handle<Name> name) { 1237 Handle<Name> name) {
1239 Code::Flags flags = Code::ComputeFlags( 1238 Code::Flags flags = Code::ComputeHandlerFlags(
1240 Code::HANDLER, MONOMORPHIC, extra_state(), type, kind, cache_holder_); 1239 kind, extra_state(), type, cache_holder_);
1241 Handle<Code> code = GetCodeWithFlags(flags, name); 1240 Handle<Code> code = GetCodeWithFlags(flags, name);
1242 PROFILE(isolate(), CodeCreateEvent(log_kind(code), *code, *name)); 1241 PROFILE(isolate(), CodeCreateEvent(log_kind(code), *code, *name));
1243 JitEvent(name, code); 1242 JitEvent(name, code);
1244 return code; 1243 return code;
1245 } 1244 }
1246 1245
1247 1246
1248 void KeyedLoadStubCompiler::CompileElementHandlers(MapHandleList* receiver_maps, 1247 void KeyedLoadStubCompiler::CompileElementHandlers(MapHandleList* receiver_maps,
1249 CodeHandleList* handlers) { 1248 CodeHandleList* handlers) {
1250 for (int i = 0; i < receiver_maps->length(); ++i) { 1249 for (int i = 0; i < receiver_maps->length(); ++i) {
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
1446 Handle<FunctionTemplateInfo>( 1445 Handle<FunctionTemplateInfo>(
1447 FunctionTemplateInfo::cast(signature->receiver())); 1446 FunctionTemplateInfo::cast(signature->receiver()));
1448 } 1447 }
1449 } 1448 }
1450 1449
1451 is_simple_api_call_ = true; 1450 is_simple_api_call_ = true;
1452 } 1451 }
1453 1452
1454 1453
1455 } } // namespace v8::internal 1454 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/stub-cache.h ('k') | src/type-info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698