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

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 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
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 V(GlobalObject) \ 207 V(GlobalObject) \
207 V(GlobalReceiver) \ 208 V(GlobalReceiver) \
208 V(Goto) \ 209 V(Goto) \
209 V(InstanceOf) \ 210 V(InstanceOf) \
210 V(IsNull) \ 211 V(IsNull) \
211 V(IsSmi) \ 212 V(IsSmi) \
212 V(HasInstanceType) \ 213 V(HasInstanceType) \
213 V(HasCachedArrayIndex) \ 214 V(HasCachedArrayIndex) \
214 V(ClassOfTest) \ 215 V(ClassOfTest) \
215 V(LeaveInlined) \ 216 V(LeaveInlined) \
217 V(LoadContextSlot) \
216 V(LoadElements) \ 218 V(LoadElements) \
217 V(LoadGlobal) \ 219 V(LoadGlobal) \
218 V(LoadKeyedFastElement) \ 220 V(LoadKeyedFastElement) \
219 V(LoadKeyedGeneric) \ 221 V(LoadKeyedGeneric) \
220 V(LoadNamedField) \ 222 V(LoadNamedField) \
221 V(LoadNamedGeneric) \ 223 V(LoadNamedGeneric) \
222 V(Mod) \ 224 V(Mod) \
223 V(Mul) \ 225 V(Mul) \
224 V(ObjectLiteral) \ 226 V(ObjectLiteral) \
225 V(OsrEntry) \ 227 V(OsrEntry) \
(...skipping 2270 matching lines...) Expand 10 before | Expand all | Expand 10 after
2496 virtual bool DataEquals(HValue* other) const { 2498 virtual bool DataEquals(HValue* other) const {
2497 HStoreGlobal* b = HStoreGlobal::cast(other); 2499 HStoreGlobal* b = HStoreGlobal::cast(other);
2498 return cell_.is_identical_to(b->cell()); 2500 return cell_.is_identical_to(b->cell());
2499 } 2501 }
2500 2502
2501 private: 2503 private:
2502 Handle<JSGlobalPropertyCell> cell_; 2504 Handle<JSGlobalPropertyCell> cell_;
2503 }; 2505 };
2504 2506
2505 2507
2508 class HLoadContextSlot: public HInstruction {
2509 public:
2510 HLoadContextSlot(Handle<Context> context, int index)
2511 : context_(context), index_(index) {
2512 set_representation(Representation::Tagged());
2513 SetFlag(kUseGVN);
2514 SetFlag(kDependsOnCalls);
2515 }
2516
2517 Handle<Context> context() const { return context_; }
2518 int index() const { return index_; }
2519
2520 virtual void PrintDataTo(StringStream* stream) const;
2521
2522 virtual intptr_t Hashcode() const {
2523 ASSERT(!Heap::allow_allocation(false));
2524 return reinterpret_cast<intptr_t>(*context_) * 7 + index_;
2525 }
2526
2527 DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load_context_slot")
2528
2529 protected:
2530 virtual bool DataEquals(HValue* other) const {
2531 HLoadContextSlot* b = HLoadContextSlot::cast(other);
2532 return context_.is_identical_to(b->context()) && index_ == b->index();
2533 }
2534
2535 private:
2536 Handle<Context> context_;
2537 int index_;
2538 };
2539
2540
2506 class HLoadNamedField: public HUnaryOperation { 2541 class HLoadNamedField: public HUnaryOperation {
2507 public: 2542 public:
2508 HLoadNamedField(HValue* object, bool is_in_object, int offset) 2543 HLoadNamedField(HValue* object, bool is_in_object, int offset)
2509 : HUnaryOperation(object), 2544 : HUnaryOperation(object),
2510 is_in_object_(is_in_object), 2545 is_in_object_(is_in_object),
2511 offset_(offset) { 2546 offset_(offset) {
2512 set_representation(Representation::Tagged()); 2547 set_representation(Representation::Tagged());
2513 SetFlag(kUseGVN); 2548 SetFlag(kUseGVN);
2514 if (is_in_object) { 2549 if (is_in_object) {
2515 SetFlag(kDependsOnInobjectFields); 2550 SetFlag(kDependsOnInobjectFields);
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
2896 HValue* object() const { return left(); } 2931 HValue* object() const { return left(); }
2897 HValue* key() const { return right(); } 2932 HValue* key() const { return right(); }
2898 }; 2933 };
2899 2934
2900 #undef DECLARE_INSTRUCTION 2935 #undef DECLARE_INSTRUCTION
2901 #undef DECLARE_CONCRETE_INSTRUCTION 2936 #undef DECLARE_CONCRETE_INSTRUCTION
2902 2937
2903 } } // namespace v8::internal 2938 } } // namespace v8::internal
2904 2939
2905 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 2940 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698