Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Side by Side Diff: src/code-stubs.h

Issue 308793010: Inline Array.shift() fast path instead of using a code stub. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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) \
20 V(CallFunction) \ 19 V(CallFunction) \
21 V(CallConstruct) \ 20 V(CallConstruct) \
22 V(BinaryOpIC) \ 21 V(BinaryOpIC) \
23 V(BinaryOpICWithAllocationSite) \ 22 V(BinaryOpICWithAllocationSite) \
24 V(BinaryOpWithAllocationSite) \ 23 V(BinaryOpWithAllocationSite) \
25 V(StringAdd) \ 24 V(StringAdd) \
26 V(SubString) \ 25 V(SubString) \
27 V(StringCompare) \ 26 V(StringCompare) \
28 V(Compare) \ 27 V(Compare) \
29 V(CompareIC) \ 28 V(CompareIC) \
(...skipping 2375 matching lines...) Expand 10 before | Expand all | Expand 10 after
2405 2404
2406 ElementsKind from_kind_; 2405 ElementsKind from_kind_;
2407 ElementsKind to_kind_; 2406 ElementsKind to_kind_;
2408 bool is_jsarray_; 2407 bool is_jsarray_;
2409 KeyedAccessStoreMode store_mode_; 2408 KeyedAccessStoreMode store_mode_;
2410 2409
2411 DISALLOW_COPY_AND_ASSIGN(ElementsTransitionAndStoreStub); 2410 DISALLOW_COPY_AND_ASSIGN(ElementsTransitionAndStoreStub);
2412 }; 2411 };
2413 2412
2414 2413
2415 class ArrayShiftStub V8_FINAL : public HydrogenCodeStub {
2416 public:
2417 ArrayShiftStub(Isolate* isolate, ElementsKind kind)
2418 : HydrogenCodeStub(isolate), kind_(kind) { }
2419
2420 ElementsKind kind() const { return kind_; }
2421
2422 virtual Handle<Code> GenerateCode() V8_OVERRIDE;
2423
2424 virtual void InitializeInterfaceDescriptor(
2425 CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE;
2426
2427 // Inline Array.shift() for arrays up to this length.
2428 static const int kInlineThreshold = 16;
2429
2430 // Parameters accessed via CodeStubGraphBuilder::GetParameter()
2431 static const int kReceiver = 0;
2432
2433 private:
2434 Major MajorKey() { return ArrayShift; }
2435 int NotMissMinorKey() {
2436 return kind_;
2437 }
2438
2439 ElementsKind kind_;
2440
2441 DISALLOW_COPY_AND_ASSIGN(ArrayShiftStub);
2442 };
2443
2444
2445 class StoreArrayLiteralElementStub : public PlatformCodeStub { 2414 class StoreArrayLiteralElementStub : public PlatformCodeStub {
2446 public: 2415 public:
2447 explicit StoreArrayLiteralElementStub(Isolate* isolate) 2416 explicit StoreArrayLiteralElementStub(Isolate* isolate)
2448 : PlatformCodeStub(isolate) { } 2417 : PlatformCodeStub(isolate) { }
2449 2418
2450 private: 2419 private:
2451 Major MajorKey() { return StoreArrayLiteralElement; } 2420 Major MajorKey() { return StoreArrayLiteralElement; }
2452 int MinorKey() { return 0; } 2421 int MinorKey() { return 0; }
2453 2422
2454 void Generate(MacroAssembler* masm); 2423 void Generate(MacroAssembler* masm);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
2506 2475
2507 2476
2508 class CallDescriptors { 2477 class CallDescriptors {
2509 public: 2478 public:
2510 static void InitializeForIsolate(Isolate* isolate); 2479 static void InitializeForIsolate(Isolate* isolate);
2511 }; 2480 };
2512 2481
2513 } } // namespace v8::internal 2482 } } // namespace v8::internal
2514 2483
2515 #endif // V8_CODE_STUBS_H_ 2484 #endif // V8_CODE_STUBS_H_
OLDNEW
« no previous file with comments | « src/arm64/lithium-codegen-arm64.cc ('k') | src/code-stubs-hydrogen.cc » ('j') | src/hydrogen.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698