| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/api.h" | 8 #include "src/api.h" |
| 9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 934 Handle<JSFunction>::cast(object)->should_have_prototype() && | 934 Handle<JSFunction>::cast(object)->should_have_prototype() && |
| 935 !Handle<JSFunction>::cast(object)->map()->has_non_instance_prototype()) { | 935 !Handle<JSFunction>::cast(object)->map()->has_non_instance_prototype()) { |
| 936 Handle<Code> stub; | 936 Handle<Code> stub; |
| 937 FunctionPrototypeStub function_prototype_stub(isolate()); | 937 FunctionPrototypeStub function_prototype_stub(isolate()); |
| 938 return function_prototype_stub.GetCode(); | 938 return function_prototype_stub.GetCode(); |
| 939 } | 939 } |
| 940 | 940 |
| 941 Handle<HeapType> type = receiver_type(); | 941 Handle<HeapType> type = receiver_type(); |
| 942 Handle<JSObject> holder(lookup->holder()); | 942 Handle<JSObject> holder(lookup->holder()); |
| 943 bool receiver_is_holder = object.is_identical_to(holder); | 943 bool receiver_is_holder = object.is_identical_to(holder); |
| 944 NamedLoadHandlerCompiler compiler(isolate(), handler_kind(), kNoExtraICState, | 944 NamedLoadHandlerCompiler compiler(isolate(), cache_holder); |
| 945 cache_holder); | |
| 946 | 945 |
| 947 switch (lookup->type()) { | 946 switch (lookup->type()) { |
| 948 case FIELD: { | 947 case FIELD: { |
| 949 FieldIndex field = lookup->GetFieldIndex(); | 948 FieldIndex field = lookup->GetFieldIndex(); |
| 950 if (receiver_is_holder) { | 949 if (receiver_is_holder) { |
| 951 return SimpleFieldLoad(field); | 950 return SimpleFieldLoad(field); |
| 952 } | 951 } |
| 953 return compiler.CompileLoadField( | 952 return compiler.CompileLoadField( |
| 954 type, holder, name, field, lookup->representation()); | 953 type, holder, name, field, lookup->representation()); |
| 955 } | 954 } |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1385 Handle<Object> object, Handle<String> name, | 1384 Handle<Object> object, Handle<String> name, |
| 1386 Handle<Object> value, | 1385 Handle<Object> value, |
| 1387 CacheHolderFlag cache_holder) { | 1386 CacheHolderFlag cache_holder) { |
| 1388 if (object->IsAccessCheckNeeded()) return slow_stub(); | 1387 if (object->IsAccessCheckNeeded()) return slow_stub(); |
| 1389 ASSERT(cache_holder == kCacheOnReceiver || lookup->type() == CALLBACKS || | 1388 ASSERT(cache_holder == kCacheOnReceiver || lookup->type() == CALLBACKS || |
| 1390 (object->IsJSGlobalProxy() && lookup->holder()->IsJSGlobalObject())); | 1389 (object->IsJSGlobalProxy() && lookup->holder()->IsJSGlobalObject())); |
| 1391 // This is currently guaranteed by checks in StoreIC::Store. | 1390 // This is currently guaranteed by checks in StoreIC::Store. |
| 1392 Handle<JSObject> receiver = Handle<JSObject>::cast(object); | 1391 Handle<JSObject> receiver = Handle<JSObject>::cast(object); |
| 1393 | 1392 |
| 1394 Handle<JSObject> holder(lookup->holder()); | 1393 Handle<JSObject> holder(lookup->holder()); |
| 1395 NamedStoreHandlerCompiler compiler(isolate(), kind()); | 1394 NamedStoreHandlerCompiler compiler(isolate()); |
| 1396 | 1395 |
| 1397 if (lookup->IsTransition()) { | 1396 if (lookup->IsTransition()) { |
| 1398 // Explicitly pass in the receiver map since LookupForWrite may have | 1397 // Explicitly pass in the receiver map since LookupForWrite may have |
| 1399 // stored something else than the receiver in the holder. | 1398 // stored something else than the receiver in the holder. |
| 1400 Handle<Map> transition(lookup->GetTransitionTarget()); | 1399 Handle<Map> transition(lookup->GetTransitionTarget()); |
| 1401 PropertyDetails details = lookup->GetPropertyDetails(); | 1400 PropertyDetails details = lookup->GetPropertyDetails(); |
| 1402 | 1401 |
| 1403 if (details.type() != CALLBACKS && details.attributes() == NONE) { | 1402 if (details.type() != CALLBACKS && details.attributes() == NONE) { |
| 1404 return compiler.CompileStoreTransition( | 1403 return compiler.CompileStoreTransition( |
| 1405 receiver, lookup, transition, name); | 1404 receiver, lookup, transition, name); |
| (...skipping 1629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3035 #undef ADDR | 3034 #undef ADDR |
| 3036 }; | 3035 }; |
| 3037 | 3036 |
| 3038 | 3037 |
| 3039 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 3038 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
| 3040 return IC_utilities[id]; | 3039 return IC_utilities[id]; |
| 3041 } | 3040 } |
| 3042 | 3041 |
| 3043 | 3042 |
| 3044 } } // namespace v8::internal | 3043 } } // namespace v8::internal |
| OLD | NEW |