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 1481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1492 void SubStringStub::GenerateAssembly( | 1492 void SubStringStub::GenerateAssembly( |
1493 compiler::CodeAssemblerState* state) const { | 1493 compiler::CodeAssemblerState* state) const { |
1494 CodeStubAssembler assembler(state); | 1494 CodeStubAssembler assembler(state); |
1495 assembler.Return(Generate(&assembler, | 1495 assembler.Return(Generate(&assembler, |
1496 assembler.Parameter(Descriptor::kString), | 1496 assembler.Parameter(Descriptor::kString), |
1497 assembler.Parameter(Descriptor::kFrom), | 1497 assembler.Parameter(Descriptor::kFrom), |
1498 assembler.Parameter(Descriptor::kTo), | 1498 assembler.Parameter(Descriptor::kTo), |
1499 assembler.Parameter(Descriptor::kContext))); | 1499 assembler.Parameter(Descriptor::kContext))); |
1500 } | 1500 } |
1501 | 1501 |
1502 void LoadApiGetterStub::GenerateAssembly( | |
1503 compiler::CodeAssemblerState* state) const { | |
1504 typedef compiler::Node Node; | |
1505 CodeStubAssembler assembler(state); | |
1506 Node* context = assembler.Parameter(Descriptor::kContext); | |
1507 Node* receiver = assembler.Parameter(Descriptor::kReceiver); | |
1508 // For now we only support receiver_is_holder. | |
1509 DCHECK(receiver_is_holder()); | |
1510 Node* holder = receiver; | |
1511 Node* map = assembler.LoadMap(receiver); | |
1512 Node* descriptors = assembler.LoadMapDescriptors(map); | |
1513 Node* callback = assembler.LoadFixedArrayElement( | |
1514 descriptors, DescriptorArray::ToValueIndex(index())); | |
1515 assembler.TailCallStub(CodeFactory::ApiGetter(isolate()), context, receiver, | |
1516 holder, callback); | |
1517 } | |
1518 | |
1519 void StoreGlobalStub::GenerateAssembly( | 1502 void StoreGlobalStub::GenerateAssembly( |
1520 compiler::CodeAssemblerState* state) const { | 1503 compiler::CodeAssemblerState* state) const { |
1521 typedef CodeStubAssembler::Label Label; | 1504 typedef CodeStubAssembler::Label Label; |
1522 typedef compiler::Node Node; | 1505 typedef compiler::Node Node; |
1523 CodeStubAssembler assembler(state); | 1506 CodeStubAssembler assembler(state); |
1524 | 1507 |
1525 assembler.Comment( | 1508 assembler.Comment( |
1526 "StoreGlobalStub: cell_type=%d, constant_type=%d, check_global=%d", | 1509 "StoreGlobalStub: cell_type=%d, constant_type=%d, check_global=%d", |
1527 cell_type(), PropertyCellType::kConstantType == cell_type() | 1510 cell_type(), PropertyCellType::kConstantType == cell_type() |
1528 ? static_cast<int>(constant_type()) | 1511 ? static_cast<int>(constant_type()) |
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2069 CreateAllocationSiteStub stub(isolate); | 2052 CreateAllocationSiteStub stub(isolate); |
2070 stub.GetCode(); | 2053 stub.GetCode(); |
2071 } | 2054 } |
2072 | 2055 |
2073 | 2056 |
2074 void CreateWeakCellStub::GenerateAheadOfTime(Isolate* isolate) { | 2057 void CreateWeakCellStub::GenerateAheadOfTime(Isolate* isolate) { |
2075 CreateWeakCellStub stub(isolate); | 2058 CreateWeakCellStub stub(isolate); |
2076 stub.GetCode(); | 2059 stub.GetCode(); |
2077 } | 2060 } |
2078 | 2061 |
| 2062 void StoreSlowElementStub::GenerateAssembly( |
| 2063 compiler::CodeAssemblerState* state) const { |
| 2064 typedef compiler::Node Node; |
| 2065 CodeStubAssembler assembler(state); |
2079 | 2066 |
2080 void StoreElementStub::Generate(MacroAssembler* masm) { | 2067 Node* receiver = assembler.Parameter(Descriptor::kReceiver); |
2081 DCHECK_EQ(DICTIONARY_ELEMENTS, elements_kind()); | 2068 Node* name = assembler.Parameter(Descriptor::kName); |
2082 KeyedStoreIC::GenerateSlow(masm); | 2069 Node* value = assembler.Parameter(Descriptor::kValue); |
| 2070 Node* slot = assembler.Parameter(Descriptor::kSlot); |
| 2071 Node* vector = assembler.Parameter(Descriptor::kVector); |
| 2072 Node* context = assembler.Parameter(Descriptor::kContext); |
| 2073 |
| 2074 assembler.TailCallRuntime(Runtime::kKeyedStoreIC_Slow, context, value, slot, |
| 2075 vector, receiver, name); |
2083 } | 2076 } |
2084 | 2077 |
2085 void StoreFastElementStub::GenerateAssembly( | 2078 void StoreFastElementStub::GenerateAssembly( |
2086 compiler::CodeAssemblerState* state) const { | 2079 compiler::CodeAssemblerState* state) const { |
2087 typedef CodeStubAssembler::Label Label; | 2080 typedef CodeStubAssembler::Label Label; |
2088 typedef compiler::Node Node; | 2081 typedef compiler::Node Node; |
2089 CodeStubAssembler assembler(state); | 2082 CodeStubAssembler assembler(state); |
2090 | 2083 |
2091 assembler.Comment( | 2084 assembler.Comment( |
2092 "StoreFastElementStub: js_array=%d, elements_kind=%s, store_mode=%d", | 2085 "StoreFastElementStub: js_array=%d, elements_kind=%s, store_mode=%d", |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2371 } | 2364 } |
2372 | 2365 |
2373 ArrayConstructorStub::ArrayConstructorStub(Isolate* isolate) | 2366 ArrayConstructorStub::ArrayConstructorStub(Isolate* isolate) |
2374 : PlatformCodeStub(isolate) {} | 2367 : PlatformCodeStub(isolate) {} |
2375 | 2368 |
2376 InternalArrayConstructorStub::InternalArrayConstructorStub(Isolate* isolate) | 2369 InternalArrayConstructorStub::InternalArrayConstructorStub(Isolate* isolate) |
2377 : PlatformCodeStub(isolate) {} | 2370 : PlatformCodeStub(isolate) {} |
2378 | 2371 |
2379 } // namespace internal | 2372 } // namespace internal |
2380 } // namespace v8 | 2373 } // namespace v8 |
OLD | NEW |