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

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

Issue 10103035: Share optimized code for closures. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: added x64 and ARM ports Created 8 years, 7 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 // 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 1443 matching lines...) Expand 10 before | Expand all | Expand 10 after
1454 } 1454 }
1455 1455
1456 HValue* argument() { return OperandAt(0); } 1456 HValue* argument() { return OperandAt(0); }
1457 1457
1458 DECLARE_CONCRETE_INSTRUCTION(PushArgument) 1458 DECLARE_CONCRETE_INSTRUCTION(PushArgument)
1459 }; 1459 };
1460 1460
1461 1461
1462 class HThisFunction: public HTemplateInstruction<0> { 1462 class HThisFunction: public HTemplateInstruction<0> {
1463 public: 1463 public:
1464 explicit HThisFunction(Handle<JSFunction> closure) : closure_(closure) { 1464 HThisFunction() {
1465 set_representation(Representation::Tagged()); 1465 set_representation(Representation::Tagged());
1466 SetFlag(kUseGVN); 1466 SetFlag(kUseGVN);
1467 } 1467 }
1468 1468
1469 virtual Representation RequiredInputRepresentation(int index) { 1469 virtual Representation RequiredInputRepresentation(int index) {
1470 return Representation::None(); 1470 return Representation::None();
1471 } 1471 }
1472 1472
1473 Handle<JSFunction> closure() const { return closure_; }
1474
1475 DECLARE_CONCRETE_INSTRUCTION(ThisFunction) 1473 DECLARE_CONCRETE_INSTRUCTION(ThisFunction)
1476 1474
1477 protected: 1475 protected:
1478 virtual bool DataEquals(HValue* other) { 1476 virtual bool DataEquals(HValue* other) { return true; }
1479 HThisFunction* b = HThisFunction::cast(other);
1480 return *closure() == *b->closure();
1481 }
1482
1483 private:
1484 Handle<JSFunction> closure_;
1485 }; 1477 };
1486 1478
1487 1479
1488 class HContext: public HTemplateInstruction<0> { 1480 class HContext: public HTemplateInstruction<0> {
1489 public: 1481 public:
1490 HContext() { 1482 HContext() {
1491 set_representation(Representation::Tagged()); 1483 set_representation(Representation::Tagged());
1492 SetFlag(kUseGVN); 1484 SetFlag(kUseGVN);
1493 } 1485 }
1494 1486
(...skipping 3464 matching lines...) Expand 10 before | Expand all | Expand 10 after
4959 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex); 4951 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex);
4960 }; 4952 };
4961 4953
4962 4954
4963 #undef DECLARE_INSTRUCTION 4955 #undef DECLARE_INSTRUCTION
4964 #undef DECLARE_CONCRETE_INSTRUCTION 4956 #undef DECLARE_CONCRETE_INSTRUCTION
4965 4957
4966 } } // namespace v8::internal 4958 } } // namespace v8::internal
4967 4959
4968 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 4960 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698