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 #ifndef V8_CODE_STUBS_H_ | 5 #ifndef V8_CODE_STUBS_H_ |
6 #define V8_CODE_STUBS_H_ | 6 #define V8_CODE_STUBS_H_ |
7 | 7 |
8 #include "allocation.h" | 8 #include "allocation.h" |
9 #include "assembler.h" | 9 #include "assembler.h" |
10 #include "codegen.h" | 10 #include "codegen.h" |
11 #include "globals.h" | 11 #include "globals.h" |
12 #include "macro-assembler.h" | 12 #include "macro-assembler.h" |
13 | 13 |
14 namespace v8 { | 14 namespace v8 { |
15 namespace internal { | 15 namespace internal { |
16 | 16 |
17 // List of code stubs used on all platforms. | 17 // List of code stubs used on all platforms. |
18 #define CODE_STUB_LIST_ALL_PLATFORMS(V) \ | 18 #define CODE_STUB_LIST_ALL_PLATFORMS(V) \ |
| 19 V(ArrayShift) \ |
19 V(CallFunction) \ | 20 V(CallFunction) \ |
20 V(CallConstruct) \ | 21 V(CallConstruct) \ |
21 V(BinaryOpIC) \ | 22 V(BinaryOpIC) \ |
22 V(BinaryOpICWithAllocationSite) \ | 23 V(BinaryOpICWithAllocationSite) \ |
23 V(BinaryOpWithAllocationSite) \ | 24 V(BinaryOpWithAllocationSite) \ |
24 V(StringAdd) \ | 25 V(StringAdd) \ |
25 V(SubString) \ | 26 V(SubString) \ |
26 V(StringCompare) \ | 27 V(StringCompare) \ |
27 V(Compare) \ | 28 V(Compare) \ |
28 V(CompareIC) \ | 29 V(CompareIC) \ |
(...skipping 2430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2459 | 2460 |
2460 ElementsKind from_kind_; | 2461 ElementsKind from_kind_; |
2461 ElementsKind to_kind_; | 2462 ElementsKind to_kind_; |
2462 bool is_jsarray_; | 2463 bool is_jsarray_; |
2463 KeyedAccessStoreMode store_mode_; | 2464 KeyedAccessStoreMode store_mode_; |
2464 | 2465 |
2465 DISALLOW_COPY_AND_ASSIGN(ElementsTransitionAndStoreStub); | 2466 DISALLOW_COPY_AND_ASSIGN(ElementsTransitionAndStoreStub); |
2466 }; | 2467 }; |
2467 | 2468 |
2468 | 2469 |
| 2470 class ArrayShiftStub V8_FINAL : public HydrogenCodeStub { |
| 2471 public: |
| 2472 ArrayShiftStub(Isolate* isolate, ElementsKind kind) |
| 2473 : HydrogenCodeStub(isolate), kind_(kind) { } |
| 2474 |
| 2475 ElementsKind kind() const { return kind_; } |
| 2476 |
| 2477 virtual Handle<Code> GenerateCode() V8_OVERRIDE; |
| 2478 |
| 2479 virtual void InitializeInterfaceDescriptor( |
| 2480 CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE; |
| 2481 |
| 2482 // Inline Array.shift() for arrays up to this length. |
| 2483 static const int kInlineThreshold = 16; |
| 2484 |
| 2485 // Parameters accessed via CodeStubGraphBuilder::GetParameter() |
| 2486 static const int kReceiver = 0; |
| 2487 |
| 2488 private: |
| 2489 Major MajorKey() { return ArrayShift; } |
| 2490 int NotMissMinorKey() { |
| 2491 return kind_; |
| 2492 } |
| 2493 |
| 2494 ElementsKind kind_; |
| 2495 |
| 2496 DISALLOW_COPY_AND_ASSIGN(ArrayShiftStub); |
| 2497 }; |
| 2498 |
| 2499 |
2469 class StoreArrayLiteralElementStub : public PlatformCodeStub { | 2500 class StoreArrayLiteralElementStub : public PlatformCodeStub { |
2470 public: | 2501 public: |
2471 explicit StoreArrayLiteralElementStub(Isolate* isolate) | 2502 explicit StoreArrayLiteralElementStub(Isolate* isolate) |
2472 : PlatformCodeStub(isolate), fp_registers_(CanUseFPRegisters()) { } | 2503 : PlatformCodeStub(isolate), fp_registers_(CanUseFPRegisters()) { } |
2473 | 2504 |
2474 private: | 2505 private: |
2475 class FPRegisters: public BitField<bool, 0, 1> {}; | 2506 class FPRegisters: public BitField<bool, 0, 1> {}; |
2476 | 2507 |
2477 Major MajorKey() { return StoreArrayLiteralElement; } | 2508 Major MajorKey() { return StoreArrayLiteralElement; } |
2478 int MinorKey() { return FPRegisters::encode(fp_registers_); } | 2509 int MinorKey() { return FPRegisters::encode(fp_registers_); } |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2538 | 2569 |
2539 | 2570 |
2540 class CallDescriptors { | 2571 class CallDescriptors { |
2541 public: | 2572 public: |
2542 static void InitializeForIsolate(Isolate* isolate); | 2573 static void InitializeForIsolate(Isolate* isolate); |
2543 }; | 2574 }; |
2544 | 2575 |
2545 } } // namespace v8::internal | 2576 } } // namespace v8::internal |
2546 | 2577 |
2547 #endif // V8_CODE_STUBS_H_ | 2578 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |