| 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/api.h" | 7 #include "src/api.h" |
| 8 #include "src/arguments.h" | 8 #include "src/arguments.h" |
| 9 #include "src/ast.h" | 9 #include "src/ast.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 835 DCHECK(holder().is_null() || | 835 DCHECK(holder().is_null() || |
| 836 holder()->property_dictionary()->FindEntry(name) == | 836 holder()->property_dictionary()->FindEntry(name) == |
| 837 NameDictionary::kNotFound); | 837 NameDictionary::kNotFound); |
| 838 GenerateDictionaryNegativeLookup(masm(), miss, holder_reg, name, scratch1, | 838 GenerateDictionaryNegativeLookup(masm(), miss, holder_reg, name, scratch1, |
| 839 scratch2); | 839 scratch2); |
| 840 } | 840 } |
| 841 } | 841 } |
| 842 } | 842 } |
| 843 | 843 |
| 844 | 844 |
| 845 Handle<Code> NamedLoadHandlerCompiler::CompileLoadField( | 845 Handle<Code> NamedLoadHandlerCompiler::CompileLoadField(Handle<Name> name, |
| 846 Handle<Name> name, FieldIndex field, Representation representation) { | 846 FieldIndex field) { |
| 847 Register reg = Frontend(receiver(), name); | 847 Register reg = Frontend(receiver(), name); |
| 848 GenerateLoadField(reg, field, representation); | 848 __ Move(receiver(), reg); |
| 849 LoadFieldStub stub(isolate(), field); |
| 850 GenerateTailCall(masm(), stub.GetCode()); |
| 849 return GetCode(kind(), Code::FAST, name); | 851 return GetCode(kind(), Code::FAST, name); |
| 850 } | 852 } |
| 851 | 853 |
| 852 | 854 |
| 853 Handle<Code> NamedLoadHandlerCompiler::CompileLoadConstant( | 855 Handle<Code> NamedLoadHandlerCompiler::CompileLoadConstant(Handle<Name> name, |
| 854 Handle<Name> name, Handle<Object> value) { | 856 int constant_index) { |
| 855 Frontend(receiver(), name); | 857 Register reg = Frontend(receiver(), name); |
| 856 GenerateLoadConstant(value); | 858 __ Move(receiver(), reg); |
| 859 LoadConstantStub stub(isolate(), constant_index); |
| 860 GenerateTailCall(masm(), stub.GetCode()); |
| 857 return GetCode(kind(), Code::FAST, name); | 861 return GetCode(kind(), Code::FAST, name); |
| 858 } | 862 } |
| 859 | 863 |
| 860 | 864 |
| 861 Handle<Code> NamedLoadHandlerCompiler::CompileLoadNonexistent( | 865 Handle<Code> NamedLoadHandlerCompiler::CompileLoadNonexistent( |
| 862 Handle<Name> name) { | 866 Handle<Name> name) { |
| 863 Label miss; | 867 Label miss; |
| 864 NonexistentFrontendHeader(name, &miss, scratch2(), scratch3()); | 868 NonexistentFrontendHeader(name, &miss, scratch2(), scratch3()); |
| 865 GenerateLoadConstant(isolate()->factory()->undefined_value()); | 869 GenerateLoadConstant(isolate()->factory()->undefined_value()); |
| 866 FrontendFooter(name, &miss); | 870 FrontendFooter(name, &miss); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 910 | 914 |
| 911 void NamedLoadHandlerCompiler::GenerateLoadPostInterceptor( | 915 void NamedLoadHandlerCompiler::GenerateLoadPostInterceptor( |
| 912 Register interceptor_reg, Handle<Name> name, LookupResult* lookup) { | 916 Register interceptor_reg, Handle<Name> name, LookupResult* lookup) { |
| 913 Handle<JSObject> real_named_property_holder(lookup->holder()); | 917 Handle<JSObject> real_named_property_holder(lookup->holder()); |
| 914 | 918 |
| 915 set_type_for_object(holder()); | 919 set_type_for_object(holder()); |
| 916 set_holder(real_named_property_holder); | 920 set_holder(real_named_property_holder); |
| 917 Register reg = Frontend(interceptor_reg, name); | 921 Register reg = Frontend(interceptor_reg, name); |
| 918 | 922 |
| 919 if (lookup->IsField()) { | 923 if (lookup->IsField()) { |
| 920 GenerateLoadField(reg, lookup->GetFieldIndex(), lookup->representation()); | 924 __ Move(receiver(), reg); |
| 925 LoadFieldStub stub(isolate(), lookup->GetFieldIndex()); |
| 926 GenerateTailCall(masm(), stub.GetCode()); |
| 921 } else { | 927 } else { |
| 922 DCHECK(lookup->type() == CALLBACKS); | 928 DCHECK(lookup->type() == CALLBACKS); |
| 923 Handle<ExecutableAccessorInfo> callback( | 929 Handle<ExecutableAccessorInfo> callback( |
| 924 ExecutableAccessorInfo::cast(lookup->GetCallbackObject())); | 930 ExecutableAccessorInfo::cast(lookup->GetCallbackObject())); |
| 925 DCHECK(callback->getter() != NULL); | 931 DCHECK(callback->getter() != NULL); |
| 926 GenerateLoadCallback(reg, callback); | 932 GenerateLoadCallback(reg, callback); |
| 927 } | 933 } |
| 928 } | 934 } |
| 929 | 935 |
| 930 | 936 |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1285 Handle<FunctionTemplateInfo>( | 1291 Handle<FunctionTemplateInfo>( |
| 1286 FunctionTemplateInfo::cast(signature->receiver())); | 1292 FunctionTemplateInfo::cast(signature->receiver())); |
| 1287 } | 1293 } |
| 1288 } | 1294 } |
| 1289 | 1295 |
| 1290 is_simple_api_call_ = true; | 1296 is_simple_api_call_ = true; |
| 1291 } | 1297 } |
| 1292 | 1298 |
| 1293 | 1299 |
| 1294 } } // namespace v8::internal | 1300 } } // namespace v8::internal |
| OLD | NEW |