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

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

Issue 10033028: Reland arguments access support for inlined functions (r11109,r11118). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix Kevin's comments Created 8 years, 8 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 1336 matching lines...) Expand 10 before | Expand all | Expand 10 after
1347 }; 1347 };
1348 1348
1349 1349
1350 class HEnterInlined: public HTemplateInstruction<0> { 1350 class HEnterInlined: public HTemplateInstruction<0> {
1351 public: 1351 public:
1352 HEnterInlined(Handle<JSFunction> closure, 1352 HEnterInlined(Handle<JSFunction> closure,
1353 int arguments_count, 1353 int arguments_count,
1354 FunctionLiteral* function, 1354 FunctionLiteral* function,
1355 CallKind call_kind, 1355 CallKind call_kind,
1356 bool is_construct, 1356 bool is_construct,
1357 Variable* arguments) 1357 Variable* arguments_var,
1358 ZoneList<HValue*>* arguments_values)
1358 : closure_(closure), 1359 : closure_(closure),
1359 arguments_count_(arguments_count), 1360 arguments_count_(arguments_count),
1360 function_(function), 1361 function_(function),
1361 call_kind_(call_kind), 1362 call_kind_(call_kind),
1362 is_construct_(is_construct), 1363 is_construct_(is_construct),
1363 arguments_(arguments) { 1364 arguments_var_(arguments_var),
1365 arguments_values_(arguments_values) {
1364 } 1366 }
1365 1367
1366 virtual void PrintDataTo(StringStream* stream); 1368 virtual void PrintDataTo(StringStream* stream);
1367 1369
1368 Handle<JSFunction> closure() const { return closure_; } 1370 Handle<JSFunction> closure() const { return closure_; }
1369 int arguments_count() const { return arguments_count_; } 1371 int arguments_count() const { return arguments_count_; }
1370 FunctionLiteral* function() const { return function_; } 1372 FunctionLiteral* function() const { return function_; }
1371 CallKind call_kind() const { return call_kind_; } 1373 CallKind call_kind() const { return call_kind_; }
1372 bool is_construct() const { return is_construct_; } 1374 bool is_construct() const { return is_construct_; }
1373 1375
1374 virtual Representation RequiredInputRepresentation(int index) { 1376 virtual Representation RequiredInputRepresentation(int index) {
1375 return Representation::None(); 1377 return Representation::None();
1376 } 1378 }
1377 1379
1378 Variable* arguments() { return arguments_; } 1380 Variable* arguments_var() { return arguments_var_; }
1381 ZoneList<HValue*>* arguments_values() { return arguments_values_; }
1379 1382
1380 DECLARE_CONCRETE_INSTRUCTION(EnterInlined) 1383 DECLARE_CONCRETE_INSTRUCTION(EnterInlined)
1381 1384
1382 private: 1385 private:
1383 Handle<JSFunction> closure_; 1386 Handle<JSFunction> closure_;
1384 int arguments_count_; 1387 int arguments_count_;
1385 FunctionLiteral* function_; 1388 FunctionLiteral* function_;
1386 CallKind call_kind_; 1389 CallKind call_kind_;
1387 bool is_construct_; 1390 bool is_construct_;
1388 Variable* arguments_; 1391 Variable* arguments_var_;
1392 ZoneList<HValue*>* arguments_values_;
1389 }; 1393 };
1390 1394
1391 1395
1392 class HLeaveInlined: public HTemplateInstruction<0> { 1396 class HLeaveInlined: public HTemplateInstruction<0> {
1393 public: 1397 public:
1394 HLeaveInlined() {} 1398 explicit HLeaveInlined(bool arguments_pushed)
1399 : arguments_pushed_(arguments_pushed) { }
1395 1400
1396 virtual Representation RequiredInputRepresentation(int index) { 1401 virtual Representation RequiredInputRepresentation(int index) {
1397 return Representation::None(); 1402 return Representation::None();
1398 } 1403 }
1399 1404
1405 bool arguments_pushed() {
1406 return arguments_pushed_;
1407 }
1408
1400 DECLARE_CONCRETE_INSTRUCTION(LeaveInlined) 1409 DECLARE_CONCRETE_INSTRUCTION(LeaveInlined)
1410
1411 private:
1412 bool arguments_pushed_;
1401 }; 1413 };
1402 1414
1403 1415
1404 class HPushArgument: public HUnaryOperation { 1416 class HPushArgument: public HUnaryOperation {
1405 public: 1417 public:
1406 explicit HPushArgument(HValue* value) : HUnaryOperation(value) { 1418 explicit HPushArgument(HValue* value) : HUnaryOperation(value) {
1407 set_representation(Representation::Tagged()); 1419 set_representation(Representation::Tagged());
1408 } 1420 }
1409 1421
1410 virtual Representation RequiredInputRepresentation(int index) { 1422 virtual Representation RequiredInputRepresentation(int index) {
(...skipping 1159 matching lines...) Expand 10 before | Expand all | Expand 10 after
2570 HValue* receiver() { return OperandAt(1); } 2582 HValue* receiver() { return OperandAt(1); }
2571 HValue* length() { return OperandAt(2); } 2583 HValue* length() { return OperandAt(2); }
2572 HValue* elements() { return OperandAt(3); } 2584 HValue* elements() { return OperandAt(3); }
2573 2585
2574 DECLARE_CONCRETE_INSTRUCTION(ApplyArguments) 2586 DECLARE_CONCRETE_INSTRUCTION(ApplyArguments)
2575 }; 2587 };
2576 2588
2577 2589
2578 class HArgumentsElements: public HTemplateInstruction<0> { 2590 class HArgumentsElements: public HTemplateInstruction<0> {
2579 public: 2591 public:
2580 HArgumentsElements() { 2592 explicit HArgumentsElements(bool from_inlined) : from_inlined_(from_inlined) {
2581 // The value produced by this instruction is a pointer into the stack 2593 // The value produced by this instruction is a pointer into the stack
2582 // that looks as if it was a smi because of alignment. 2594 // that looks as if it was a smi because of alignment.
2583 set_representation(Representation::Tagged()); 2595 set_representation(Representation::Tagged());
2584 SetFlag(kUseGVN); 2596 SetFlag(kUseGVN);
2585 } 2597 }
2586 2598
2587 DECLARE_CONCRETE_INSTRUCTION(ArgumentsElements) 2599 DECLARE_CONCRETE_INSTRUCTION(ArgumentsElements)
2588 2600
2589 virtual Representation RequiredInputRepresentation(int index) { 2601 virtual Representation RequiredInputRepresentation(int index) {
2590 return Representation::None(); 2602 return Representation::None();
2591 } 2603 }
2592 2604
2605 bool from_inlined() const { return from_inlined_; }
2606
2593 protected: 2607 protected:
2594 virtual bool DataEquals(HValue* other) { return true; } 2608 virtual bool DataEquals(HValue* other) { return true; }
2609
2610 bool from_inlined_;
2595 }; 2611 };
2596 2612
2597 2613
2598 class HArgumentsLength: public HUnaryOperation { 2614 class HArgumentsLength: public HUnaryOperation {
2599 public: 2615 public:
2600 explicit HArgumentsLength(HValue* value) : HUnaryOperation(value) { 2616 explicit HArgumentsLength(HValue* value) : HUnaryOperation(value) {
2601 set_representation(Representation::Integer32()); 2617 set_representation(Representation::Integer32());
2602 SetFlag(kUseGVN); 2618 SetFlag(kUseGVN);
2603 } 2619 }
2604 2620
(...skipping 2252 matching lines...) Expand 10 before | Expand all | Expand 10 after
4857 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex); 4873 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex);
4858 }; 4874 };
4859 4875
4860 4876
4861 #undef DECLARE_INSTRUCTION 4877 #undef DECLARE_INSTRUCTION
4862 #undef DECLARE_CONCRETE_INSTRUCTION 4878 #undef DECLARE_CONCRETE_INSTRUCTION
4863 4879
4864 } } // namespace v8::internal 4880 } } // namespace v8::internal
4865 4881
4866 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 4882 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« src/arm/lithium-arm.h ('K') | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698