| Index: src/code-stubs.h
|
| diff --git a/src/code-stubs.h b/src/code-stubs.h
|
| index 4d021c2dc7dbe19c901d15753d288c1e8ad506ee..4aca6c7110c76e3e416b90924e2f41dde4fca633 100644
|
| --- a/src/code-stubs.h
|
| +++ b/src/code-stubs.h
|
| @@ -592,12 +592,12 @@ class NumberToStringStub V8_FINAL : public HydrogenCodeStub {
|
|
|
| class FastNewClosureStub : public HydrogenCodeStub {
|
| public:
|
| - FastNewClosureStub(Isolate* isolate,
|
| - StrictMode strict_mode,
|
| - bool is_generator)
|
| + FastNewClosureStub(Isolate* isolate, StrictMode strict_mode,
|
| + FunctionKind kind)
|
| : HydrogenCodeStub(isolate),
|
| strict_mode_(strict_mode),
|
| - is_generator_(is_generator) { }
|
| + is_generator_(kind == FunctionKind::kGeneratorFunction),
|
| + is_concise_method_(kind == FunctionKind::kConciseMethod) {}
|
|
|
| virtual Handle<Code> GenerateCode() V8_OVERRIDE;
|
|
|
| @@ -608,19 +608,31 @@ class FastNewClosureStub : public HydrogenCodeStub {
|
|
|
| StrictMode strict_mode() const { return strict_mode_; }
|
| bool is_generator() const { return is_generator_; }
|
| + bool is_concise_method() const { return is_concise_method_; }
|
| + FunctionKind kind() const {
|
| + // TODO(arv): Update to handle concise generator methods.
|
| + // if (is_arrow()) return FunctionKind::kArrowFunction;
|
| + if (is_generator()) return FunctionKind::kGeneratorFunction;
|
| + if (is_concise_method()) return FunctionKind::kConciseMethod;
|
| + return FunctionKind::kNormalFunction;
|
| + }
|
|
|
| private:
|
| - class StrictModeBits: public BitField<bool, 0, 1> {};
|
| - class IsGeneratorBits: public BitField<bool, 1, 1> {};
|
| + class StrictModeBits : public BitField<bool, 0, 1> {};
|
| + class IsGeneratorBits : public BitField<bool, 1, 1> {};
|
| + class IsMethodBits : public BitField<bool, 2, 1> {};
|
|
|
| Major MajorKey() const { return FastNewClosure; }
|
| int NotMissMinorKey() const {
|
| return StrictModeBits::encode(strict_mode_ == STRICT) |
|
| - IsGeneratorBits::encode(is_generator_);
|
| + IsGeneratorBits::encode(is_generator_) |
|
| + IsMethodBits::encode(is_concise_method_);
|
| }
|
|
|
| StrictMode strict_mode_;
|
| + // TODO(arv): Maybe store these as bits?
|
| bool is_generator_;
|
| + bool is_concise_method_;
|
| };
|
|
|
|
|
|
|