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

Side by Side Diff: src/hydrogen-instructions.h

Issue 5753005: Make closures optimizable by Crankshaft compiler. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressing next round of Florian's comments Created 10 years 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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 // HBranch 99 // HBranch
100 // HCompareMapAndBranch 100 // HCompareMapAndBranch
101 // HReturn 101 // HReturn
102 // HThrow 102 // HThrow
103 // HDeoptimize 103 // HDeoptimize
104 // HEnterInlined 104 // HEnterInlined
105 // HFunctionLiteral 105 // HFunctionLiteral
106 // HGlobalObject 106 // HGlobalObject
107 // HGlobalReceiver 107 // HGlobalReceiver
108 // HLeaveInlined 108 // HLeaveInlined
109 // HLoadContextSlot
109 // HLoadGlobal 110 // HLoadGlobal
110 // HMaterializedLiteral 111 // HMaterializedLiteral
111 // HArrayLiteral 112 // HArrayLiteral
112 // HObjectLiteral 113 // HObjectLiteral
113 // HRegExpLiteral 114 // HRegExpLiteral
114 // HOsrEntry 115 // HOsrEntry
115 // HParameter 116 // HParameter
116 // HSimulate 117 // HSimulate
117 // HStackCheck 118 // HStackCheck
118 // HStoreKeyed 119 // HStoreKeyed
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 V(GlobalReceiver) \ 209 V(GlobalReceiver) \
209 V(Goto) \ 210 V(Goto) \
210 V(InstanceOf) \ 211 V(InstanceOf) \
211 V(IsNull) \ 212 V(IsNull) \
212 V(IsObject) \ 213 V(IsObject) \
213 V(IsSmi) \ 214 V(IsSmi) \
214 V(HasInstanceType) \ 215 V(HasInstanceType) \
215 V(HasCachedArrayIndex) \ 216 V(HasCachedArrayIndex) \
216 V(ClassOfTest) \ 217 V(ClassOfTest) \
217 V(LeaveInlined) \ 218 V(LeaveInlined) \
219 V(LoadContextSlot) \
218 V(LoadElements) \ 220 V(LoadElements) \
219 V(LoadGlobal) \ 221 V(LoadGlobal) \
220 V(LoadKeyedFastElement) \ 222 V(LoadKeyedFastElement) \
221 V(LoadKeyedGeneric) \ 223 V(LoadKeyedGeneric) \
222 V(LoadNamedField) \ 224 V(LoadNamedField) \
223 V(LoadNamedGeneric) \ 225 V(LoadNamedGeneric) \
224 V(Mod) \ 226 V(Mod) \
225 V(Mul) \ 227 V(Mul) \
226 V(ObjectLiteral) \ 228 V(ObjectLiteral) \
227 V(OsrEntry) \ 229 V(OsrEntry) \
(...skipping 2282 matching lines...) Expand 10 before | Expand all | Expand 10 after
2510 virtual bool DataEquals(HValue* other) const { 2512 virtual bool DataEquals(HValue* other) const {
2511 HStoreGlobal* b = HStoreGlobal::cast(other); 2513 HStoreGlobal* b = HStoreGlobal::cast(other);
2512 return cell_.is_identical_to(b->cell()); 2514 return cell_.is_identical_to(b->cell());
2513 } 2515 }
2514 2516
2515 private: 2517 private:
2516 Handle<JSGlobalPropertyCell> cell_; 2518 Handle<JSGlobalPropertyCell> cell_;
2517 }; 2519 };
2518 2520
2519 2521
2522 class HLoadContextSlot: public HInstruction {
2523 public:
2524 HLoadContextSlot(int context_chain_length , int slot_index)
2525 : context_chain_length_(context_chain_length), slot_index_(slot_index) {
2526 set_representation(Representation::Tagged());
2527 SetFlag(kUseGVN);
2528 SetFlag(kDependsOnCalls);
2529 }
2530
2531 int context_chain_length() const { return context_chain_length_; }
2532 int slot_index() const { return slot_index_; }
2533
2534 virtual void PrintDataTo(StringStream* stream) const;
2535
2536 virtual intptr_t Hashcode() const {
2537 return context_chain_length() * 29 + slot_index();
2538 }
2539
2540 DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load_context_slot")
2541
2542 protected:
2543 virtual bool DataEquals(HValue* other) const {
2544 HLoadContextSlot* b = HLoadContextSlot::cast(other);
2545 return (context_chain_length() == b->context_chain_length())
2546 && (slot_index() == b->slot_index());
2547 }
2548
2549 private:
2550 int context_chain_length_;
2551 int slot_index_;
2552 };
2553
2554
2520 class HLoadNamedField: public HUnaryOperation { 2555 class HLoadNamedField: public HUnaryOperation {
2521 public: 2556 public:
2522 HLoadNamedField(HValue* object, bool is_in_object, int offset) 2557 HLoadNamedField(HValue* object, bool is_in_object, int offset)
2523 : HUnaryOperation(object), 2558 : HUnaryOperation(object),
2524 is_in_object_(is_in_object), 2559 is_in_object_(is_in_object),
2525 offset_(offset) { 2560 offset_(offset) {
2526 set_representation(Representation::Tagged()); 2561 set_representation(Representation::Tagged());
2527 SetFlag(kUseGVN); 2562 SetFlag(kUseGVN);
2528 if (is_in_object) { 2563 if (is_in_object) {
2529 SetFlag(kDependsOnInobjectFields); 2564 SetFlag(kDependsOnInobjectFields);
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
2910 HValue* object() const { return left(); } 2945 HValue* object() const { return left(); }
2911 HValue* key() const { return right(); } 2946 HValue* key() const { return right(); }
2912 }; 2947 };
2913 2948
2914 #undef DECLARE_INSTRUCTION 2949 #undef DECLARE_INSTRUCTION
2915 #undef DECLARE_CONCRETE_INSTRUCTION 2950 #undef DECLARE_CONCRETE_INSTRUCTION
2916 2951
2917 } } // namespace v8::internal 2952 } } // namespace v8::internal
2918 2953
2919 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 2954 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698