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

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

Issue 1262583002: Reland of "Remove ExternalArray, derived types, and element kinds" (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 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
« no previous file with comments | « src/ic/ic.cc ('k') | src/lookup.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/cpu-profiler.h" 7 #include "src/cpu-profiler.h"
8 #include "src/ic/handler-compiler.h" 8 #include "src/ic/handler-compiler.h"
9 #include "src/ic/ic-inl.h" 9 #include "src/ic/ic-inl.h"
10 #include "src/ic/ic-compiler.h" 10 #include "src/ic/ic-compiler.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 !(is_strong(LoadICState::GetLanguageMode(extra_ic_state))); 102 !(is_strong(LoadICState::GetLanguageMode(extra_ic_state)));
103 Handle<Code> stub; 103 Handle<Code> stub;
104 if (receiver_map->has_indexed_interceptor()) { 104 if (receiver_map->has_indexed_interceptor()) {
105 stub = LoadIndexedInterceptorStub(isolate).GetCode(); 105 stub = LoadIndexedInterceptorStub(isolate).GetCode();
106 } else if (receiver_map->IsStringMap()) { 106 } else if (receiver_map->IsStringMap()) {
107 // We have a string. 107 // We have a string.
108 stub = LoadIndexedStringStub(isolate).GetCode(); 108 stub = LoadIndexedStringStub(isolate).GetCode();
109 } else if (receiver_map->has_sloppy_arguments_elements()) { 109 } else if (receiver_map->has_sloppy_arguments_elements()) {
110 stub = KeyedLoadSloppyArgumentsStub(isolate).GetCode(); 110 stub = KeyedLoadSloppyArgumentsStub(isolate).GetCode();
111 } else if (receiver_map->has_fast_elements() || 111 } else if (receiver_map->has_fast_elements() ||
112 receiver_map->has_external_array_elements() ||
113 receiver_map->has_fixed_typed_array_elements()) { 112 receiver_map->has_fixed_typed_array_elements()) {
114 stub = LoadFastElementStub(isolate, is_js_array, elements_kind, 113 stub = LoadFastElementStub(isolate, is_js_array, elements_kind,
115 convert_hole_to_undefined).GetCode(); 114 convert_hole_to_undefined).GetCode();
116 } else { 115 } else {
117 stub = LoadDictionaryElementStub(isolate, LoadICState(extra_ic_state)) 116 stub = LoadDictionaryElementStub(isolate, LoadICState(extra_ic_state))
118 .GetCode(); 117 .GetCode();
119 } 118 }
120 return stub; 119 return stub;
121 } 120 }
122 121
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 cached_stub = 361 cached_stub =
363 ElementsTransitionAndStoreStub(isolate(), elements_kind, 362 ElementsTransitionAndStoreStub(isolate(), elements_kind,
364 transitioned_map->elements_kind(), 363 transitioned_map->elements_kind(),
365 is_js_array, store_mode).GetCode(); 364 is_js_array, store_mode).GetCode();
366 } else if (receiver_map->instance_type() < FIRST_JS_RECEIVER_TYPE) { 365 } else if (receiver_map->instance_type() < FIRST_JS_RECEIVER_TYPE) {
367 cached_stub = isolate()->builtins()->KeyedStoreIC_Slow(); 366 cached_stub = isolate()->builtins()->KeyedStoreIC_Slow();
368 } else { 367 } else {
369 if (IsSloppyArgumentsElements(elements_kind)) { 368 if (IsSloppyArgumentsElements(elements_kind)) {
370 cached_stub = KeyedStoreSloppyArgumentsStub(isolate()).GetCode(); 369 cached_stub = KeyedStoreSloppyArgumentsStub(isolate()).GetCode();
371 } else if (receiver_map->has_fast_elements() || 370 } else if (receiver_map->has_fast_elements() ||
372 receiver_map->has_external_array_elements() ||
373 receiver_map->has_fixed_typed_array_elements()) { 371 receiver_map->has_fixed_typed_array_elements()) {
374 cached_stub = StoreFastElementStub(isolate(), is_js_array, 372 cached_stub = StoreFastElementStub(isolate(), is_js_array,
375 elements_kind, store_mode).GetCode(); 373 elements_kind, store_mode).GetCode();
376 } else { 374 } else {
377 cached_stub = StoreElementStub(isolate(), elements_kind).GetCode(); 375 cached_stub = StoreElementStub(isolate(), elements_kind).GetCode();
378 } 376 }
379 } 377 }
380 DCHECK(!cached_stub.is_null()); 378 DCHECK(!cached_stub.is_null());
381 handlers.Add(cached_stub); 379 handlers.Add(cached_stub);
382 transitioned_maps.Add(transitioned_map); 380 transitioned_maps.Add(transitioned_map);
(...skipping 11 matching lines...) Expand all
394 392
395 393
396 Handle<Code> PropertyICCompiler::CompileKeyedStoreMonomorphic( 394 Handle<Code> PropertyICCompiler::CompileKeyedStoreMonomorphic(
397 Handle<Map> receiver_map, KeyedAccessStoreMode store_mode) { 395 Handle<Map> receiver_map, KeyedAccessStoreMode store_mode) {
398 ElementsKind elements_kind = receiver_map->elements_kind(); 396 ElementsKind elements_kind = receiver_map->elements_kind();
399 bool is_jsarray = receiver_map->instance_type() == JS_ARRAY_TYPE; 397 bool is_jsarray = receiver_map->instance_type() == JS_ARRAY_TYPE;
400 Handle<Code> stub; 398 Handle<Code> stub;
401 if (receiver_map->has_sloppy_arguments_elements()) { 399 if (receiver_map->has_sloppy_arguments_elements()) {
402 stub = KeyedStoreSloppyArgumentsStub(isolate()).GetCode(); 400 stub = KeyedStoreSloppyArgumentsStub(isolate()).GetCode();
403 } else if (receiver_map->has_fast_elements() || 401 } else if (receiver_map->has_fast_elements() ||
404 receiver_map->has_external_array_elements() ||
405 receiver_map->has_fixed_typed_array_elements()) { 402 receiver_map->has_fixed_typed_array_elements()) {
406 stub = StoreFastElementStub(isolate(), is_jsarray, elements_kind, 403 stub = StoreFastElementStub(isolate(), is_jsarray, elements_kind,
407 store_mode).GetCode(); 404 store_mode).GetCode();
408 } else { 405 } else {
409 stub = StoreElementStub(isolate(), elements_kind).GetCode(); 406 stub = StoreElementStub(isolate(), elements_kind).GetCode();
410 } 407 }
411 408
412 Handle<WeakCell> cell = Map::WeakCellForMap(receiver_map); 409 Handle<WeakCell> cell = Map::WeakCellForMap(receiver_map);
413 410
414 __ DispatchWeakMap(receiver(), scratch1(), scratch2(), cell, stub, 411 __ DispatchWeakMap(receiver(), scratch1(), scratch2(), cell, stub,
415 DO_SMI_CHECK); 412 DO_SMI_CHECK);
416 413
417 TailCallBuiltin(masm(), Builtins::kKeyedStoreIC_Miss); 414 TailCallBuiltin(masm(), Builtins::kKeyedStoreIC_Miss);
418 415
419 return GetCode(kind(), Code::NORMAL, factory()->empty_string()); 416 return GetCode(kind(), Code::NORMAL, factory()->empty_string());
420 } 417 }
421 418
422 419
423 #undef __ 420 #undef __
424 } // namespace internal 421 } // namespace internal
425 } // namespace v8 422 } // namespace v8
OLDNEW
« no previous file with comments | « src/ic/ic.cc ('k') | src/lookup.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698