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

Unified Diff: src/code-stubs.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 side-by-side diff with in-line comments
Download patch
Index: src/code-stubs.h
diff --git a/src/code-stubs.h b/src/code-stubs.h
index 4d021c2dc7dbe19c901d15753d288c1e8ad506ee..03b50194d2749accd0404bd9ad0acf94e95c1d83 100644
--- a/src/code-stubs.h
+++ b/src/code-stubs.h
@@ -592,12 +592,9 @@ class NumberToStringStub V8_FINAL : public HydrogenCodeStub {
class FastNewClosureStub : public HydrogenCodeStub {
public:
- FastNewClosureStub(Isolate* isolate,
- StrictMode strict_mode,
- bool is_generator)
- : HydrogenCodeStub(isolate),
- strict_mode_(strict_mode),
- is_generator_(is_generator) { }
+ FastNewClosureStub(Isolate* isolate, StrictMode strict_mode,
+ FunctionKind kind)
+ : HydrogenCodeStub(isolate), strict_mode_(strict_mode), kind_(kind) {}
virtual Handle<Code> GenerateCode() V8_OVERRIDE;
@@ -607,20 +604,23 @@ class FastNewClosureStub : public HydrogenCodeStub {
static void InstallDescriptors(Isolate* isolate);
StrictMode strict_mode() const { return strict_mode_; }
- bool is_generator() const { return is_generator_; }
+ FunctionKind kind() const { return kind_; }
+ bool is_arrow() const { return IsArrowFunction(kind_); }
+ bool is_generator() const { return IsGeneratorFunction(kind_); }
+ bool is_concise_method() const { return IsConciseMethod(kind_); }
private:
- class StrictModeBits: public BitField<bool, 0, 1> {};
- class IsGeneratorBits: public BitField<bool, 1, 1> {};
+ class StrictModeBits : public BitField<bool, 0, 1> {};
+ class FunctionKindBits : public BitField<FunctionKind, 1, 3> {};
Major MajorKey() const { return FastNewClosure; }
int NotMissMinorKey() const {
return StrictModeBits::encode(strict_mode_ == STRICT) |
- IsGeneratorBits::encode(is_generator_);
+ FunctionKindBits::encode(kind_);
}
StrictMode strict_mode_;
- bool is_generator_;
+ FunctionKind kind_;
};

Powered by Google App Engine
This is Rietveld 408576698