Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 103 receiver_map, stub, isolate->factory()->empty_string(), ELEMENT); | 103 receiver_map, stub, isolate->factory()->empty_string(), ELEMENT); |
| 104 | 104 |
| 105 Map::UpdateCodeCache(receiver_map, name, code); | 105 Map::UpdateCodeCache(receiver_map, name, code); |
| 106 return code; | 106 return code; |
| 107 } | 107 } |
| 108 | 108 |
| 109 | 109 |
| 110 Handle<Code> PropertyICCompiler::ComputeKeyedLoadMonomorphicHandler( | 110 Handle<Code> PropertyICCompiler::ComputeKeyedLoadMonomorphicHandler( |
| 111 Handle<Map> receiver_map) { | 111 Handle<Map> receiver_map) { |
| 112 Isolate* isolate = receiver_map->GetIsolate(); | 112 Isolate* isolate = receiver_map->GetIsolate(); |
| 113 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE; | |
| 113 ElementsKind elements_kind = receiver_map->elements_kind(); | 114 ElementsKind elements_kind = receiver_map->elements_kind(); |
| 115 bool convert_hole_to_undefined = | |
|
Jakob Kummerow
2015/04/23 13:40:00
Checking for a pristine array prototype is pointle
mvstanton
2015/04/27 07:57:13
That's right, and good idea to comment that. Done.
| |
| 116 is_js_array && elements_kind == FAST_HOLEY_ELEMENTS && | |
| 117 *receiver_map == isolate->get_initial_js_array_map(elements_kind); | |
| 114 Handle<Code> stub; | 118 Handle<Code> stub; |
| 115 if (receiver_map->has_indexed_interceptor()) { | 119 if (receiver_map->has_indexed_interceptor()) { |
| 116 stub = LoadIndexedInterceptorStub(isolate).GetCode(); | 120 stub = LoadIndexedInterceptorStub(isolate).GetCode(); |
| 117 } else if (receiver_map->IsStringMap()) { | 121 } else if (receiver_map->IsStringMap()) { |
| 118 // We have a string. | 122 // We have a string. |
| 119 stub = LoadIndexedStringStub(isolate).GetCode(); | 123 stub = LoadIndexedStringStub(isolate).GetCode(); |
| 120 } else if (receiver_map->has_sloppy_arguments_elements()) { | 124 } else if (receiver_map->has_sloppy_arguments_elements()) { |
| 121 stub = KeyedLoadSloppyArgumentsStub(isolate).GetCode(); | 125 stub = KeyedLoadSloppyArgumentsStub(isolate).GetCode(); |
| 122 } else if (receiver_map->has_fast_elements() || | 126 } else if (receiver_map->has_fast_elements() || |
| 123 receiver_map->has_external_array_elements() || | 127 receiver_map->has_external_array_elements() || |
| 124 receiver_map->has_fixed_typed_array_elements()) { | 128 receiver_map->has_fixed_typed_array_elements()) { |
| 125 stub = LoadFastElementStub(isolate, | 129 stub = LoadFastElementStub(isolate, is_js_array, elements_kind, |
| 126 receiver_map->instance_type() == JS_ARRAY_TYPE, | 130 convert_hole_to_undefined).GetCode(); |
| 127 elements_kind).GetCode(); | |
| 128 } else { | 131 } else { |
| 129 stub = LoadDictionaryElementStub(isolate).GetCode(); | 132 stub = LoadDictionaryElementStub(isolate).GetCode(); |
| 130 } | 133 } |
| 131 return stub; | 134 return stub; |
| 132 } | 135 } |
| 133 | 136 |
| 134 | 137 |
| 135 Handle<Code> PropertyICCompiler::ComputeKeyedStoreMonomorphic( | 138 Handle<Code> PropertyICCompiler::ComputeKeyedStoreMonomorphic( |
| 136 Handle<Map> receiver_map, LanguageMode language_mode, | 139 Handle<Map> receiver_map, LanguageMode language_mode, |
| 137 KeyedAccessStoreMode store_mode) { | 140 KeyedAccessStoreMode store_mode) { |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 465 | 468 |
| 466 TailCallBuiltin(masm(), Builtins::kKeyedStoreIC_Miss); | 469 TailCallBuiltin(masm(), Builtins::kKeyedStoreIC_Miss); |
| 467 | 470 |
| 468 return GetCode(kind(), Code::NORMAL, factory()->empty_string()); | 471 return GetCode(kind(), Code::NORMAL, factory()->empty_string()); |
| 469 } | 472 } |
| 470 | 473 |
| 471 | 474 |
| 472 #undef __ | 475 #undef __ |
| 473 } | 476 } |
| 474 } // namespace v8::internal | 477 } // namespace v8::internal |
| OLD | NEW |