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

Side by Side Diff: src/ic/handler-compiler.cc

Issue 602773003: Eliminate special keyed load string stub in favor of uniform handlers. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE and ports. Created 6 years, 2 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/ic/arm64/ic-arm64.cc ('k') | src/ic/ia32/ic-ia32.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/ic/call-optimization.h" 7 #include "src/ic/call-optimization.h"
8 #include "src/ic/handler-compiler.h" 8 #include "src/ic/handler-compiler.h"
9 #include "src/ic/ic.h" 9 #include "src/ic/ic.h"
10 #include "src/ic/ic-inl.h" 10 #include "src/ic/ic-inl.h"
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 408
409 #undef __ 409 #undef __
410 410
411 411
412 void ElementHandlerCompiler::CompileElementHandlers( 412 void ElementHandlerCompiler::CompileElementHandlers(
413 MapHandleList* receiver_maps, CodeHandleList* handlers) { 413 MapHandleList* receiver_maps, CodeHandleList* handlers) {
414 for (int i = 0; i < receiver_maps->length(); ++i) { 414 for (int i = 0; i < receiver_maps->length(); ++i) {
415 Handle<Map> receiver_map = receiver_maps->at(i); 415 Handle<Map> receiver_map = receiver_maps->at(i);
416 Handle<Code> cached_stub; 416 Handle<Code> cached_stub;
417 417
418 if ((receiver_map->instance_type() & kNotStringTag) == 0) { 418 if (receiver_map->IsStringMap()) {
419 cached_stub = isolate()->builtins()->KeyedLoadIC_String(); 419 cached_stub = LoadIndexedStringStub(isolate()).GetCode();
420 } else if (receiver_map->instance_type() < FIRST_JS_RECEIVER_TYPE) { 420 } else if (receiver_map->instance_type() < FIRST_JS_RECEIVER_TYPE) {
421 cached_stub = isolate()->builtins()->KeyedLoadIC_Slow(); 421 cached_stub = isolate()->builtins()->KeyedLoadIC_Slow();
422 } else { 422 } else {
423 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE; 423 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE;
424 ElementsKind elements_kind = receiver_map->elements_kind(); 424 ElementsKind elements_kind = receiver_map->elements_kind();
425 if (receiver_map->has_indexed_interceptor()) { 425 if (receiver_map->has_indexed_interceptor()) {
426 cached_stub = LoadIndexedInterceptorStub(isolate()).GetCode(); 426 cached_stub = LoadIndexedInterceptorStub(isolate()).GetCode();
427 } else if (IsSloppyArgumentsElements(elements_kind)) { 427 } else if (IsSloppyArgumentsElements(elements_kind)) {
428 cached_stub = KeyedLoadSloppyArgumentsStub(isolate()).GetCode(); 428 cached_stub = KeyedLoadSloppyArgumentsStub(isolate()).GetCode();
429 } else if (IsFastElementsKind(elements_kind) || 429 } else if (IsFastElementsKind(elements_kind) ||
430 IsExternalArrayElementsKind(elements_kind) || 430 IsExternalArrayElementsKind(elements_kind) ||
431 IsFixedTypedArrayElementsKind(elements_kind)) { 431 IsFixedTypedArrayElementsKind(elements_kind)) {
432 cached_stub = LoadFastElementStub(isolate(), is_js_array, elements_kind) 432 cached_stub = LoadFastElementStub(isolate(), is_js_array, elements_kind)
433 .GetCode(); 433 .GetCode();
434 } else { 434 } else {
435 DCHECK(elements_kind == DICTIONARY_ELEMENTS); 435 DCHECK(elements_kind == DICTIONARY_ELEMENTS);
436 cached_stub = LoadDictionaryElementStub(isolate()).GetCode(); 436 cached_stub = LoadDictionaryElementStub(isolate()).GetCode();
437 } 437 }
438 } 438 }
439 439
440 handlers->Add(cached_stub); 440 handlers->Add(cached_stub);
441 } 441 }
442 } 442 }
443 } 443 }
444 } // namespace v8::internal 444 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ic/arm64/ic-arm64.cc ('k') | src/ic/ia32/ic-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698