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

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: merge Created 6 years, 3 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
« no previous file with comments | « src/ast.h ('k') | src/code-stubs-hydrogen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs.h
diff --git a/src/code-stubs.h b/src/code-stubs.h
index a5be52966a0d26d27650175335e141a63d89baba..626e14e08d4de951aa4bc837172b002b116aa3ba 100644
--- a/src/code-stubs.h
+++ b/src/code-stubs.h
@@ -551,21 +551,27 @@ class NumberToStringStub FINAL : public HydrogenCodeStub {
class FastNewClosureStub : public HydrogenCodeStub {
public:
FastNewClosureStub(Isolate* isolate, StrictMode strict_mode,
- bool is_generator)
+ FunctionKind kind)
: HydrogenCodeStub(isolate) {
+ DCHECK(IsValidFunctionKind(kind));
set_sub_minor_key(StrictModeBits::encode(strict_mode) |
- IsGeneratorBits::encode(is_generator));
+ FunctionKindBits::encode(kind));
}
StrictMode strict_mode() const {
return StrictModeBits::decode(sub_minor_key());
}
- bool is_generator() const { return IsGeneratorBits::decode(sub_minor_key()); }
+ FunctionKind kind() const {
+ return FunctionKindBits::decode(sub_minor_key());
+ }
+ 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<StrictMode, 0, 1> {};
- class IsGeneratorBits : public BitField<bool, 1, 1> {};
+ class FunctionKindBits : public BitField<FunctionKind, 1, 3> {};
DEFINE_CALL_INTERFACE_DESCRIPTOR(FastNewClosure);
DEFINE_HYDROGEN_CODE_STUB(FastNewClosure, HydrogenCodeStub);
« no previous file with comments | « src/ast.h ('k') | src/code-stubs-hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698