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

Unified Diff: src/code-stubs.h

Issue 908883002: new classes: implement new.target passing to superclass constructor. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix x64 arithmetic Created 5 years, 10 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/code.h ('k') | src/compiler.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 dbdd3c73577709f884ab1b8ef534edd0e905f2bd..fb2fbe55df5398d9ed4d7c0351b5a888e9b8d0c3 100644
--- a/src/code-stubs.h
+++ b/src/code-stubs.h
@@ -1590,8 +1590,13 @@ class ArgumentsAccessStub: public PlatformCodeStub {
NEW_STRICT
};
- ArgumentsAccessStub(Isolate* isolate, Type type) : PlatformCodeStub(isolate) {
- minor_key_ = TypeBits::encode(type);
+ enum HasNewTarget { NO_NEW_TARGET, HAS_NEW_TARGET };
+
+ ArgumentsAccessStub(Isolate* isolate, Type type,
+ HasNewTarget has_new_target = NO_NEW_TARGET)
+ : PlatformCodeStub(isolate) {
+ minor_key_ =
+ TypeBits::encode(type) | HasNewTargetBits::encode(has_new_target);
}
CallInterfaceDescriptor GetCallInterfaceDescriptor() OVERRIDE {
@@ -1603,6 +1608,9 @@ class ArgumentsAccessStub: public PlatformCodeStub {
private:
Type type() const { return TypeBits::decode(minor_key_); }
+ bool has_new_target() const {
+ return HasNewTargetBits::decode(minor_key_) == HAS_NEW_TARGET;
+ }
void GenerateReadElement(MacroAssembler* masm);
void GenerateNewStrict(MacroAssembler* masm);
@@ -1612,6 +1620,7 @@ class ArgumentsAccessStub: public PlatformCodeStub {
void PrintName(std::ostream& os) const OVERRIDE; // NOLINT
class TypeBits : public BitField<Type, 0, 2> {};
+ class HasNewTargetBits : public BitField<HasNewTarget, 2, 1> {};
DEFINE_PLATFORM_CODE_STUB(ArgumentsAccess, PlatformCodeStub);
};
@@ -1693,9 +1702,13 @@ class CallConstructStub: public PlatformCodeStub {
return (flags() & RECORD_CONSTRUCTOR_TARGET) != 0;
}
+ bool IsSuperConstructorCall() const {
+ return (flags() & SUPER_CONSTRUCTOR_CALL) != 0;
+ }
+
void PrintName(std::ostream& os) const OVERRIDE; // NOLINT
- class FlagBits : public BitField<CallConstructorFlags, 0, 1> {};
+ class FlagBits : public BitField<CallConstructorFlags, 0, 2> {};
DEFINE_CALL_INTERFACE_DESCRIPTOR(CallConstruct);
DEFINE_PLATFORM_CODE_STUB(CallConstruct, PlatformCodeStub);
« no previous file with comments | « src/code.h ('k') | src/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698