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/code-stubs.h" | 5 #include "src/code-stubs.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/cpu-profiler.h" | 10 #include "src/cpu-profiler.h" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 masm.set_generating_stub(true); | 116 masm.set_generating_stub(true); |
117 // TODO(yangguo): remove this once we can serialize IC stubs. | 117 // TODO(yangguo): remove this once we can serialize IC stubs. |
118 masm.enable_serializer(); | 118 masm.enable_serializer(); |
119 NoCurrentFrameScope scope(&masm); | 119 NoCurrentFrameScope scope(&masm); |
120 Generate(&masm); | 120 Generate(&masm); |
121 } | 121 } |
122 | 122 |
123 // Create the code object. | 123 // Create the code object. |
124 CodeDesc desc; | 124 CodeDesc desc; |
125 masm.GetCode(&desc); | 125 masm.GetCode(&desc); |
126 | |
127 // Copy the generated code into a heap object. | 126 // Copy the generated code into a heap object. |
128 Code::Flags flags = Code::ComputeFlags( | 127 Code::Flags flags = Code::ComputeFlags( |
129 GetCodeKind(), | 128 GetCodeKind(), |
130 GetICState(), | 129 GetICState(), |
131 GetExtraICState(), | 130 GetExtraICState(), |
132 GetStubType()); | 131 GetStubType()); |
133 Handle<Code> new_object = factory->NewCode( | 132 Handle<Code> new_object = factory->NewCode( |
134 desc, flags, masm.CodeObject(), NeedsImmovableCode()); | 133 desc, flags, masm.CodeObject(), NeedsImmovableCode()); |
135 return new_object; | 134 return new_object; |
136 } | 135 } |
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
621 | 620 |
622 void LoadDictionaryElementStub::InitializeDescriptor( | 621 void LoadDictionaryElementStub::InitializeDescriptor( |
623 CodeStubDescriptor* descriptor) { | 622 CodeStubDescriptor* descriptor) { |
624 descriptor->Initialize(FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure)); | 623 descriptor->Initialize(FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure)); |
625 } | 624 } |
626 | 625 |
627 | 626 |
628 void KeyedLoadGenericStub::InitializeDescriptor( | 627 void KeyedLoadGenericStub::InitializeDescriptor( |
629 CodeStubDescriptor* descriptor) { | 628 CodeStubDescriptor* descriptor) { |
630 descriptor->Initialize( | 629 descriptor->Initialize( |
631 Runtime::FunctionForId(Runtime::kKeyedGetProperty)->entry); | 630 Runtime::FunctionForId(is_strong(language_mode()) |
| 631 ? Runtime::kKeyedGetPropertyStrong |
| 632 : Runtime::kKeyedGetProperty)->entry); |
632 } | 633 } |
633 | 634 |
634 | 635 |
635 void HandlerStub::InitializeDescriptor(CodeStubDescriptor* descriptor) { | 636 void HandlerStub::InitializeDescriptor(CodeStubDescriptor* descriptor) { |
636 if (kind() == Code::STORE_IC) { | 637 if (kind() == Code::STORE_IC) { |
637 descriptor->Initialize(FUNCTION_ADDR(StoreIC_MissFromStubFailure)); | 638 descriptor->Initialize(FUNCTION_ADDR(StoreIC_MissFromStubFailure)); |
638 } else if (kind() == Code::KEYED_LOAD_IC) { | 639 } else if (kind() == Code::KEYED_LOAD_IC) { |
639 descriptor->Initialize(FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure)); | 640 descriptor->Initialize(FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure)); |
640 } else if (kind() == Code::KEYED_STORE_IC) { | 641 } else if (kind() == Code::KEYED_STORE_IC) { |
641 descriptor->Initialize(FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure)); | 642 descriptor->Initialize(FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure)); |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1058 | 1059 |
1059 if (type->Is(Type::UntaggedPointer())) { | 1060 if (type->Is(Type::UntaggedPointer())) { |
1060 return Representation::External(); | 1061 return Representation::External(); |
1061 } | 1062 } |
1062 | 1063 |
1063 DCHECK(!type->Is(Type::Untagged())); | 1064 DCHECK(!type->Is(Type::Untagged())); |
1064 return Representation::Tagged(); | 1065 return Representation::Tagged(); |
1065 } | 1066 } |
1066 } // namespace internal | 1067 } // namespace internal |
1067 } // namespace v8 | 1068 } // namespace v8 |
OLD | NEW |