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/ast/ast.h" | 9 #include "src/ast/ast.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 1869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1880 compiler::CodeAssemblerState* state) const { | 1880 compiler::CodeAssemblerState* state) const { |
1881 typedef compiler::Node Node; | 1881 typedef compiler::Node Node; |
1882 CodeStubAssembler assembler(state); | 1882 CodeStubAssembler assembler(state); |
1883 Node* context = assembler.Parameter(Descriptor::kContext); | 1883 Node* context = assembler.Parameter(Descriptor::kContext); |
1884 Node* receiver = assembler.Parameter(Descriptor::kReceiver); | 1884 Node* receiver = assembler.Parameter(Descriptor::kReceiver); |
1885 // For now we only support receiver_is_holder. | 1885 // For now we only support receiver_is_holder. |
1886 DCHECK(receiver_is_holder()); | 1886 DCHECK(receiver_is_holder()); |
1887 Node* holder = receiver; | 1887 Node* holder = receiver; |
1888 Node* map = assembler.LoadMap(receiver); | 1888 Node* map = assembler.LoadMap(receiver); |
1889 Node* descriptors = assembler.LoadMapDescriptors(map); | 1889 Node* descriptors = assembler.LoadMapDescriptors(map); |
1890 Node* value_index = | |
1891 assembler.IntPtrConstant(DescriptorArray::ToValueIndex(index())); | |
1892 Node* callback = assembler.LoadFixedArrayElement( | 1890 Node* callback = assembler.LoadFixedArrayElement( |
1893 descriptors, value_index, 0, CodeStubAssembler::INTPTR_PARAMETERS); | 1891 descriptors, DescriptorArray::ToValueIndex(index())); |
1894 assembler.TailCallStub(CodeFactory::ApiGetter(isolate()), context, receiver, | 1892 assembler.TailCallStub(CodeFactory::ApiGetter(isolate()), context, receiver, |
1895 holder, callback); | 1893 holder, callback); |
1896 } | 1894 } |
1897 | 1895 |
1898 void StoreFieldStub::GenerateAssembly( | 1896 void StoreFieldStub::GenerateAssembly( |
1899 compiler::CodeAssemblerState* state) const { | 1897 compiler::CodeAssemblerState* state) const { |
1900 typedef CodeStubAssembler::Label Label; | 1898 typedef CodeStubAssembler::Label Label; |
1901 typedef compiler::Node Node; | 1899 typedef compiler::Node Node; |
1902 CodeStubAssembler assembler(state); | 1900 CodeStubAssembler assembler(state); |
1903 | 1901 |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2084 compiler::CodeAssemblerState* state) const { | 2082 compiler::CodeAssemblerState* state) const { |
2085 typedef compiler::Node Node; | 2083 typedef compiler::Node Node; |
2086 CodeStubAssembler assembler(state); | 2084 CodeStubAssembler assembler(state); |
2087 | 2085 |
2088 assembler.Comment("LoadScriptContextFieldStub: context_index=%d, slot=%d", | 2086 assembler.Comment("LoadScriptContextFieldStub: context_index=%d, slot=%d", |
2089 context_index(), slot_index()); | 2087 context_index(), slot_index()); |
2090 | 2088 |
2091 Node* context = assembler.Parameter(Descriptor::kContext); | 2089 Node* context = assembler.Parameter(Descriptor::kContext); |
2092 | 2090 |
2093 Node* script_context = assembler.LoadScriptContext(context, context_index()); | 2091 Node* script_context = assembler.LoadScriptContext(context, context_index()); |
2094 Node* result = assembler.LoadFixedArrayElement( | 2092 Node* result = assembler.LoadFixedArrayElement(script_context, slot_index()); |
2095 script_context, assembler.IntPtrConstant(slot_index()), 0, | |
2096 CodeStubAssembler::INTPTR_PARAMETERS); | |
2097 assembler.Return(result); | 2093 assembler.Return(result); |
2098 } | 2094 } |
2099 | 2095 |
2100 void StoreScriptContextFieldStub::GenerateAssembly( | 2096 void StoreScriptContextFieldStub::GenerateAssembly( |
2101 compiler::CodeAssemblerState* state) const { | 2097 compiler::CodeAssemblerState* state) const { |
2102 typedef compiler::Node Node; | 2098 typedef compiler::Node Node; |
2103 CodeStubAssembler assembler(state); | 2099 CodeStubAssembler assembler(state); |
2104 | 2100 |
2105 assembler.Comment("StoreScriptContextFieldStub: context_index=%d, slot=%d", | 2101 assembler.Comment("StoreScriptContextFieldStub: context_index=%d, slot=%d", |
2106 context_index(), slot_index()); | 2102 context_index(), slot_index()); |
(...skipping 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3206 } | 3202 } |
3207 | 3203 |
3208 ArrayConstructorStub::ArrayConstructorStub(Isolate* isolate) | 3204 ArrayConstructorStub::ArrayConstructorStub(Isolate* isolate) |
3209 : PlatformCodeStub(isolate) {} | 3205 : PlatformCodeStub(isolate) {} |
3210 | 3206 |
3211 InternalArrayConstructorStub::InternalArrayConstructorStub(Isolate* isolate) | 3207 InternalArrayConstructorStub::InternalArrayConstructorStub(Isolate* isolate) |
3212 : PlatformCodeStub(isolate) {} | 3208 : PlatformCodeStub(isolate) {} |
3213 | 3209 |
3214 } // namespace internal | 3210 } // namespace internal |
3215 } // namespace v8 | 3211 } // namespace v8 |
OLD | NEW |