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

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

Issue 8775002: Simplify stack check instruction in Crankshaft. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 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/ia32/lithium-codegen-ia32.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 1253 matching lines...) Expand 10 before | Expand all | Expand 10 after
1264 } 1264 }
1265 int ast_id_; 1265 int ast_id_;
1266 int pop_count_; 1266 int pop_count_;
1267 ZoneList<HValue*> values_; 1267 ZoneList<HValue*> values_;
1268 ZoneList<int> assigned_indexes_; 1268 ZoneList<int> assigned_indexes_;
1269 }; 1269 };
1270 1270
1271 1271
1272 class HStackCheck: public HTemplateInstruction<1> { 1272 class HStackCheck: public HTemplateInstruction<1> {
1273 public: 1273 public:
1274 enum Type { 1274 explicit HStackCheck(HValue* context) {
1275 kFunctionEntry,
1276 kBackwardsBranch
1277 };
1278
1279 HStackCheck(HValue* context, Type type) : type_(type) {
1280 SetOperandAt(0, context); 1275 SetOperandAt(0, context);
1281 } 1276 }
1282 1277
1283 HValue* context() { return OperandAt(0); } 1278 HValue* context() { return OperandAt(0); }
1284 1279
1285 virtual Representation RequiredInputRepresentation(int index) { 1280 virtual Representation RequiredInputRepresentation(int index) {
1286 return Representation::Tagged(); 1281 return Representation::Tagged();
1287 } 1282 }
1288 1283
1289 void Eliminate() { 1284 void Eliminate() {
1290 // The stack check eliminator might try to eliminate the same stack 1285 // The stack check eliminator might try to eliminate the same stack
1291 // check instruction multiple times. 1286 // check instruction multiple times.
1292 if (IsLinked()) { 1287 if (IsLinked()) {
1293 DeleteFromGraph(); 1288 DeleteFromGraph();
1294 } 1289 }
1295 } 1290 }
1296 1291
1297 bool is_function_entry() { return type_ == kFunctionEntry; }
1298 bool is_backwards_branch() { return type_ == kBackwardsBranch; }
1299
1300 DECLARE_CONCRETE_INSTRUCTION(StackCheck) 1292 DECLARE_CONCRETE_INSTRUCTION(StackCheck)
1301
1302 private:
1303 Type type_;
1304 }; 1293 };
1305 1294
1306 1295
1307 class HEnterInlined: public HTemplateInstruction<0> { 1296 class HEnterInlined: public HTemplateInstruction<0> {
1308 public: 1297 public:
1309 HEnterInlined(Handle<JSFunction> closure, 1298 HEnterInlined(Handle<JSFunction> closure,
1310 FunctionLiteral* function, 1299 FunctionLiteral* function,
1311 CallKind call_kind) 1300 CallKind call_kind)
1312 : closure_(closure), 1301 : closure_(closure),
1313 function_(function), 1302 function_(function),
(...skipping 3112 matching lines...) Expand 10 before | Expand all | Expand 10 after
4426 4415
4427 DECLARE_CONCRETE_INSTRUCTION(In) 4416 DECLARE_CONCRETE_INSTRUCTION(In)
4428 }; 4417 };
4429 4418
4430 #undef DECLARE_INSTRUCTION 4419 #undef DECLARE_INSTRUCTION
4431 #undef DECLARE_CONCRETE_INSTRUCTION 4420 #undef DECLARE_CONCRETE_INSTRUCTION
4432 4421
4433 } } // namespace v8::internal 4422 } } // namespace v8::internal
4434 4423
4435 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 4424 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698