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 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
693 ? GetCodeWithFlags(flags, Handle<String>::cast(name)->ToCString().get()) | 693 ? GetCodeWithFlags(flags, Handle<String>::cast(name)->ToCString().get()) |
694 : GetCodeWithFlags(flags, NULL); | 694 : GetCodeWithFlags(flags, NULL); |
695 } | 695 } |
696 | 696 |
697 | 697 |
698 void StubCompiler::LookupPostInterceptor(Handle<JSObject> holder, | 698 void StubCompiler::LookupPostInterceptor(Handle<JSObject> holder, |
699 Handle<Name> name, | 699 Handle<Name> name, |
700 LookupResult* lookup) { | 700 LookupResult* lookup) { |
701 holder->LookupOwnRealNamedProperty(name, lookup); | 701 holder->LookupOwnRealNamedProperty(name, lookup); |
702 if (lookup->IsFound()) return; | 702 if (lookup->IsFound()) return; |
703 if (holder->GetPrototype()->IsNull()) return; | 703 PrototypeIterator iter(holder->GetIsolate(), holder); |
704 holder->GetPrototype()->Lookup(name, lookup); | 704 if (iter.IsAtEnd()) return; |
| 705 PrototypeIterator::GetCurrent(iter)->Lookup(name, lookup); |
705 } | 706 } |
706 | 707 |
707 | 708 |
708 #define __ ACCESS_MASM(masm()) | 709 #define __ ACCESS_MASM(masm()) |
709 | 710 |
710 | 711 |
711 Register LoadStubCompiler::HandlerFrontendHeader( | 712 Register LoadStubCompiler::HandlerFrontendHeader( |
712 Handle<HeapType> type, | 713 Handle<HeapType> type, |
713 Register object_reg, | 714 Register object_reg, |
714 Handle<JSObject> holder, | 715 Handle<JSObject> holder, |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
964 Handle<JSObject> object, | 965 Handle<JSObject> object, |
965 LookupResult* lookup, | 966 LookupResult* lookup, |
966 Handle<Map> transition, | 967 Handle<Map> transition, |
967 Handle<Name> name) { | 968 Handle<Name> name) { |
968 Label miss, slow; | 969 Label miss, slow; |
969 | 970 |
970 // Ensure no transitions to deprecated maps are followed. | 971 // Ensure no transitions to deprecated maps are followed. |
971 __ CheckMapDeprecated(transition, scratch1(), &miss); | 972 __ CheckMapDeprecated(transition, scratch1(), &miss); |
972 | 973 |
973 // Check that we are allowed to write this. | 974 // Check that we are allowed to write this. |
974 if (object->GetPrototype()->IsJSObject()) { | 975 PrototypeIterator iter(object->GetIsolate(), object); |
| 976 if (!iter.IsAtEnd()) { |
975 Handle<JSObject> holder; | 977 Handle<JSObject> holder; |
976 // holder == object indicates that no property was found. | 978 // holder == object indicates that no property was found. |
977 if (lookup->holder() != *object) { | 979 if (lookup->holder() != *object) { |
978 holder = Handle<JSObject>(lookup->holder()); | 980 holder = Handle<JSObject>(lookup->holder()); |
979 } else { | 981 } else { |
980 // Find the top object. | 982 // Find the top object. |
981 holder = object; | |
982 do { | 983 do { |
983 holder = Handle<JSObject>(JSObject::cast(holder->GetPrototype())); | 984 holder = Handle<JSObject>::cast(PrototypeIterator::GetCurrent(iter)); |
984 } while (holder->GetPrototype()->IsJSObject()); | 985 iter.Advance(); |
| 986 } while (!iter.IsAtEnd()); |
985 } | 987 } |
986 | 988 |
987 Register holder_reg = HandlerFrontendHeader( | 989 Register holder_reg = HandlerFrontendHeader( |
988 IC::CurrentTypeOf(object, isolate()), receiver(), holder, name, &miss); | 990 IC::CurrentTypeOf(object, isolate()), receiver(), holder, name, &miss); |
989 | 991 |
990 // If no property was found, and the holder (the last object in the | 992 // If no property was found, and the holder (the last object in the |
991 // prototype chain) is in slow mode, we need to do a negative lookup on the | 993 // prototype chain) is in slow mode, we need to do a negative lookup on the |
992 // holder. | 994 // holder. |
993 if (lookup->holder() == *object) { | 995 if (lookup->holder() == *object) { |
994 GenerateNegativeHolderLookup(masm(), holder, holder_reg, name, &miss); | 996 GenerateNegativeHolderLookup(masm(), holder, holder_reg, name, &miss); |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1401 Handle<FunctionTemplateInfo>( | 1403 Handle<FunctionTemplateInfo>( |
1402 FunctionTemplateInfo::cast(signature->receiver())); | 1404 FunctionTemplateInfo::cast(signature->receiver())); |
1403 } | 1405 } |
1404 } | 1406 } |
1405 | 1407 |
1406 is_simple_api_call_ = true; | 1408 is_simple_api_call_ = true; |
1407 } | 1409 } |
1408 | 1410 |
1409 | 1411 |
1410 } } // namespace v8::internal | 1412 } } // namespace v8::internal |
OLD | NEW |