| 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/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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 DCHECK(holder_reg.is(scratch1())); | 263 DCHECK(holder_reg.is(scratch1())); |
| 264 PopVectorAndSlot(scratch2(), scratch3()); | 264 PopVectorAndSlot(scratch2(), scratch3()); |
| 265 } | 265 } |
| 266 } | 266 } |
| 267 } | 267 } |
| 268 } | 268 } |
| 269 | 269 |
| 270 | 270 |
| 271 Handle<Code> NamedLoadHandlerCompiler::CompileLoadInterceptor( | 271 Handle<Code> NamedLoadHandlerCompiler::CompileLoadInterceptor( |
| 272 LookupIterator* it) { | 272 LookupIterator* it) { |
| 273 // So far the most popular follow ups for interceptor loads are FIELD and | 273 // So far the most popular follow ups for interceptor loads are DATA and |
| 274 // ExecutableAccessorInfo, so inline only them. Other cases may be added | 274 // ExecutableAccessorInfo, so inline only them. Other cases may be added |
| 275 // later. | 275 // later. |
| 276 bool inline_followup = false; | 276 bool inline_followup = false; |
| 277 switch (it->state()) { | 277 switch (it->state()) { |
| 278 case LookupIterator::TRANSITION: | 278 case LookupIterator::TRANSITION: |
| 279 UNREACHABLE(); | 279 UNREACHABLE(); |
| 280 case LookupIterator::ACCESS_CHECK: | 280 case LookupIterator::ACCESS_CHECK: |
| 281 case LookupIterator::INTERCEPTOR: | 281 case LookupIterator::INTERCEPTOR: |
| 282 case LookupIterator::JSPROXY: | 282 case LookupIterator::JSPROXY: |
| 283 case LookupIterator::NOT_FOUND: | 283 case LookupIterator::NOT_FOUND: |
| 284 break; | 284 break; |
| 285 case LookupIterator::DATA: | 285 case LookupIterator::DATA: |
| 286 inline_followup = | 286 inline_followup = |
| 287 it->property_details().type() == FIELD && !it->is_dictionary_holder(); | 287 it->property_details().type() == DATA && !it->is_dictionary_holder(); |
| 288 break; | 288 break; |
| 289 case LookupIterator::ACCESSOR: { | 289 case LookupIterator::ACCESSOR: { |
| 290 Handle<Object> accessors = it->GetAccessors(); | 290 Handle<Object> accessors = it->GetAccessors(); |
| 291 inline_followup = accessors->IsExecutableAccessorInfo(); | 291 inline_followup = accessors->IsExecutableAccessorInfo(); |
| 292 if (!inline_followup) break; | 292 if (!inline_followup) break; |
| 293 Handle<ExecutableAccessorInfo> info = | 293 Handle<ExecutableAccessorInfo> info = |
| 294 Handle<ExecutableAccessorInfo>::cast(accessors); | 294 Handle<ExecutableAccessorInfo>::cast(accessors); |
| 295 inline_followup = info->getter() != NULL && | 295 inline_followup = info->getter() != NULL && |
| 296 ExecutableAccessorInfo::IsCompatibleReceiverType( | 296 ExecutableAccessorInfo::IsCompatibleReceiverType( |
| 297 isolate(), info, type()); | 297 isolate(), info, type()); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 InterceptorVectorSlotPop(reg, DISCARD); | 330 InterceptorVectorSlotPop(reg, DISCARD); |
| 331 | 331 |
| 332 switch (it->state()) { | 332 switch (it->state()) { |
| 333 case LookupIterator::ACCESS_CHECK: | 333 case LookupIterator::ACCESS_CHECK: |
| 334 case LookupIterator::INTERCEPTOR: | 334 case LookupIterator::INTERCEPTOR: |
| 335 case LookupIterator::JSPROXY: | 335 case LookupIterator::JSPROXY: |
| 336 case LookupIterator::NOT_FOUND: | 336 case LookupIterator::NOT_FOUND: |
| 337 case LookupIterator::TRANSITION: | 337 case LookupIterator::TRANSITION: |
| 338 UNREACHABLE(); | 338 UNREACHABLE(); |
| 339 case LookupIterator::DATA: { | 339 case LookupIterator::DATA: { |
| 340 DCHECK_EQ(FIELD, it->property_details().type()); | 340 DCHECK_EQ(DATA, it->property_details().type()); |
| 341 __ Move(receiver(), reg); | 341 __ Move(receiver(), reg); |
| 342 LoadFieldStub stub(isolate(), it->GetFieldIndex()); | 342 LoadFieldStub stub(isolate(), it->GetFieldIndex()); |
| 343 GenerateTailCall(masm(), stub.GetCode()); | 343 GenerateTailCall(masm(), stub.GetCode()); |
| 344 break; | 344 break; |
| 345 } | 345 } |
| 346 case LookupIterator::ACCESSOR: | 346 case LookupIterator::ACCESSOR: |
| 347 Handle<ExecutableAccessorInfo> info = | 347 Handle<ExecutableAccessorInfo> info = |
| 348 Handle<ExecutableAccessorInfo>::cast(it->GetAccessors()); | 348 Handle<ExecutableAccessorInfo>::cast(it->GetAccessors()); |
| 349 DCHECK_NE(NULL, info->getter()); | 349 DCHECK_NE(NULL, info->getter()); |
| 350 GenerateLoadCallback(reg, info); | 350 GenerateLoadCallback(reg, info); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 int descriptor = transition->LastAdded(); | 385 int descriptor = transition->LastAdded(); |
| 386 Handle<DescriptorArray> descriptors(transition->instance_descriptors()); | 386 Handle<DescriptorArray> descriptors(transition->instance_descriptors()); |
| 387 PropertyDetails details = descriptors->GetDetails(descriptor); | 387 PropertyDetails details = descriptors->GetDetails(descriptor); |
| 388 Representation representation = details.representation(); | 388 Representation representation = details.representation(); |
| 389 DCHECK(!representation.IsNone()); | 389 DCHECK(!representation.IsNone()); |
| 390 | 390 |
| 391 // Stub is never generated for objects that require access checks. | 391 // Stub is never generated for objects that require access checks. |
| 392 DCHECK(!transition->is_access_check_needed()); | 392 DCHECK(!transition->is_access_check_needed()); |
| 393 | 393 |
| 394 // Call to respective StoreTransitionStub. | 394 // Call to respective StoreTransitionStub. |
| 395 if (details.type() == CONSTANT) { | 395 if (details.type() == DATA_CONSTANT) { |
| 396 GenerateRestoreMap(transition, scratch2(), &miss); | 396 GenerateRestoreMap(transition, scratch2(), &miss); |
| 397 DCHECK(descriptors->GetValue(descriptor)->IsJSFunction()); | 397 DCHECK(descriptors->GetValue(descriptor)->IsJSFunction()); |
| 398 Register map_reg = StoreTransitionDescriptor::MapRegister(); | 398 Register map_reg = StoreTransitionDescriptor::MapRegister(); |
| 399 GenerateConstantCheck(map_reg, descriptor, value(), scratch2(), &miss); | 399 GenerateConstantCheck(map_reg, descriptor, value(), scratch2(), &miss); |
| 400 GenerateRestoreName(name); | 400 GenerateRestoreName(name); |
| 401 StoreTransitionStub stub(isolate()); | 401 StoreTransitionStub stub(isolate()); |
| 402 GenerateTailCall(masm(), stub.GetCode()); | 402 GenerateTailCall(masm(), stub.GetCode()); |
| 403 | 403 |
| 404 } else { | 404 } else { |
| 405 if (representation.IsHeapObject()) { | 405 if (representation.IsHeapObject()) { |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 DCHECK(elements_kind == DICTIONARY_ELEMENTS); | 489 DCHECK(elements_kind == DICTIONARY_ELEMENTS); |
| 490 cached_stub = LoadDictionaryElementStub(isolate()).GetCode(); | 490 cached_stub = LoadDictionaryElementStub(isolate()).GetCode(); |
| 491 } | 491 } |
| 492 } | 492 } |
| 493 | 493 |
| 494 handlers->Add(cached_stub); | 494 handlers->Add(cached_stub); |
| 495 } | 495 } |
| 496 } | 496 } |
| 497 } | 497 } |
| 498 } // namespace v8::internal | 498 } // namespace v8::internal |
| OLD | NEW |