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

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

Issue 477263002: ES6: Add support for method shorthand in object literals (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_ 5 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_
6 #define V8_HYDROGEN_INSTRUCTIONS_H_ 6 #define V8_HYDROGEN_INSTRUCTIONS_H_
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/allocation.h" 10 #include "src/allocation.h"
(...skipping 7430 matching lines...) Expand 10 before | Expand all | Expand 10 after
7441 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { 7441 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
7442 return Representation::Tagged(); 7442 return Representation::Tagged();
7443 } 7443 }
7444 7444
7445 DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral) 7445 DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral)
7446 7446
7447 Handle<SharedFunctionInfo> shared_info() const { return shared_info_; } 7447 Handle<SharedFunctionInfo> shared_info() const { return shared_info_; }
7448 bool pretenure() const { return pretenure_; } 7448 bool pretenure() const { return pretenure_; }
7449 bool has_no_literals() const { return has_no_literals_; } 7449 bool has_no_literals() const { return has_no_literals_; }
7450 bool is_generator() const { return is_generator_; } 7450 bool is_generator() const { return is_generator_; }
7451 bool is_concise_method() const { return is_concise_method_; }
7452 FunctionKind kind() const {
7453 // TODO(arv): Update to handle concise generator methods.
7454 // if (is_arrow()) return FunctionKind::kArrowFunction;
7455 if (is_generator()) return FunctionKind::kGeneratorFunction;
7456 if (is_concise_method()) return FunctionKind::kConciseMethod;
7457 return FunctionKind::kNormalFunction;
7458 }
7451 StrictMode strict_mode() const { return strict_mode_; } 7459 StrictMode strict_mode() const { return strict_mode_; }
7452 7460
7453 private: 7461 private:
7454 HFunctionLiteral(HValue* context, 7462 HFunctionLiteral(HValue* context, Handle<SharedFunctionInfo> shared,
7455 Handle<SharedFunctionInfo> shared,
7456 bool pretenure) 7463 bool pretenure)
7457 : HTemplateInstruction<1>(HType::JSObject()), 7464 : HTemplateInstruction<1>(HType::JSObject()),
7458 shared_info_(shared), 7465 shared_info_(shared),
7459 pretenure_(pretenure), 7466 pretenure_(pretenure),
7460 has_no_literals_(shared->num_literals() == 0), 7467 has_no_literals_(shared->num_literals() == 0),
7461 is_generator_(shared->is_generator()), 7468 is_generator_(shared->is_generator()),
7469 is_concise_method_(shared->is_concise_method()),
7462 strict_mode_(shared->strict_mode()) { 7470 strict_mode_(shared->strict_mode()) {
7463 SetOperandAt(0, context); 7471 SetOperandAt(0, context);
7464 set_representation(Representation::Tagged()); 7472 set_representation(Representation::Tagged());
7465 SetChangesFlag(kNewSpacePromotion); 7473 SetChangesFlag(kNewSpacePromotion);
7466 } 7474 }
7467 7475
7468 virtual bool IsDeletable() const V8_OVERRIDE { return true; } 7476 virtual bool IsDeletable() const V8_OVERRIDE { return true; }
7469 7477
7470 Handle<SharedFunctionInfo> shared_info_; 7478 Handle<SharedFunctionInfo> shared_info_;
7471 bool pretenure_ : 1; 7479 bool pretenure_ : 1;
7472 bool has_no_literals_ : 1; 7480 bool has_no_literals_ : 1;
7473 bool is_generator_ : 1; 7481 bool is_generator_ : 1;
7482 bool is_concise_method_ : 1;
7474 StrictMode strict_mode_; 7483 StrictMode strict_mode_;
7475 }; 7484 };
7476 7485
7477 7486
7478 class HTypeof V8_FINAL : public HTemplateInstruction<2> { 7487 class HTypeof V8_FINAL : public HTemplateInstruction<2> {
7479 public: 7488 public:
7480 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P1(HTypeof, HValue*); 7489 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P1(HTypeof, HValue*);
7481 7490
7482 HValue* context() const { return OperandAt(0); } 7491 HValue* context() const { return OperandAt(0); }
7483 HValue* value() const { return OperandAt(1); } 7492 HValue* value() const { return OperandAt(1); }
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
7858 }; 7867 };
7859 7868
7860 7869
7861 7870
7862 #undef DECLARE_INSTRUCTION 7871 #undef DECLARE_INSTRUCTION
7863 #undef DECLARE_CONCRETE_INSTRUCTION 7872 #undef DECLARE_CONCRETE_INSTRUCTION
7864 7873
7865 } } // namespace v8::internal 7874 } } // namespace v8::internal
7866 7875
7867 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 7876 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« src/ast.h ('K') | « src/globals.h ('k') | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698