Commit 6d568748 authored by Adam Klein's avatar Adam Klein Committed by Commit Bot

Revert "[runtime] Slightly optimize creation of class literals."

This reverts commit 521fa16e.

Reason for revert: fails tests under code-serializer:

https://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20debug/builds/17691

Original change's description:
> [runtime] Slightly optimize creation of class literals.
> 
> TBR=bmeurer@chromium.org
> 
> Bug: v8:5799
> Change-Id: I61de5f8b3333db174dadf76ed983950acb39742b
> Reviewed-on: https://chromium-review.googlesource.com/649509
> Commit-Queue: Igor Sheludko <ishell@chromium.org>
> Reviewed-by: Toon Verwaest <verwaest@chromium.org>
> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#49044}

TBR=rmcilroy@chromium.org,yangguo@chromium.org,mythria@chromium.org,gsathya@chromium.org,ishell@chromium.org,verwaest@chromium.org

Change-Id: I994edb855a8a0aa6e7e7476b0b013a46aac6f2e7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:5799
Reviewed-on: https://chromium-review.googlesource.com/745581Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
Commit-Queue: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49046}
parent 67aae25f
......@@ -1808,7 +1808,6 @@ v8_source_set("v8_base") {
"src/objects/js-array.h",
"src/objects/js-regexp-inl.h",
"src/objects/js-regexp.h",
"src/objects/literal-objects-inl.h",
"src/objects/literal-objects.cc",
"src/objects/literal-objects.h",
"src/objects/map-inl.h",
......
......@@ -798,17 +798,6 @@ bool Literal::IsPropertyName() const {
return !string_->AsArrayIndex(&index);
}
bool Literal::AsArrayIndex(uint32_t* index) const {
if (type() == kString) {
return string_->AsArrayIndex(index);
} else {
DCHECK_EQ(kSmi, type());
DCHECK_LE(0, smi_);
*index = smi_;
return true;
}
}
bool Literal::ToUint32(uint32_t* value) const {
switch (type()) {
case kSmi:
......
......@@ -990,10 +990,6 @@ class Literal final : public Expression {
// Returns true if literal represents a property name (i.e. cannot be parsed
// as array indices).
bool IsPropertyName() const;
// Returns true if literal represents an array index.
bool AsArrayIndex(uint32_t* index) const;
const AstRawString* AsRawPropertyName() {
DCHECK(IsPropertyName());
return string_;
......
......@@ -191,7 +191,6 @@ enum class ObjectType {
#undef ENUM_STRUCT_ELEMENT
class AccessCheckNeeded;
class ClassBoilerplate;
class CompilationCacheTable;
class Constructor;
class Filler;
......
......@@ -3133,7 +3133,6 @@ Handle<Map> Factory::CreateClassFunctionMap(Handle<JSFunction> empty_function) {
Handle<Map> map = NewMap(JS_FUNCTION_TYPE, JSFunction::kSizeWithPrototype);
map->set_has_prototype_slot(true);
map->set_is_constructor(true);
map->set_is_prototype_map(true);
map->set_is_callable();
Map::SetPrototype(map, empty_function);
......@@ -3142,8 +3141,8 @@ Handle<Map> Factory::CreateClassFunctionMap(Handle<JSFunction> empty_function) {
//
Map::EnsureDescriptorSlack(map, 2);
PropertyAttributes ro_attribs =
static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY);
PropertyAttributes rw_attribs =
static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE);
PropertyAttributes roc_attribs =
static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY);
......@@ -3157,7 +3156,7 @@ Handle<Map> Factory::CreateClassFunctionMap(Handle<JSFunction> empty_function) {
{
// Add prototype accessor.
Descriptor d = Descriptor::AccessorConstant(
prototype_string(), function_prototype_accessor(), ro_attribs);
prototype_string(), function_prototype_accessor(), rw_attribs);
map->AppendDescriptor(&d);
}
return map;
......
This diff is collapsed.
......@@ -153,6 +153,9 @@ class BytecodeGenerator final : public AstVisitor<BytecodeGenerator> {
void VisitArgumentsObject(Variable* variable);
void VisitRestArgumentsArray(Variable* rest);
void VisitCallSuper(Call* call);
void VisitClassLiteralProperties(ClassLiteral* expr, Register constructor,
Register prototype);
void BuildClassLiteralNameProperty(ClassLiteral* expr, Register constructor);
void BuildClassLiteral(ClassLiteral* expr);
void VisitNewTargetVariable(Variable* variable);
void VisitThisFunctionVariable(Variable* variable);
......@@ -304,7 +307,6 @@ class BytecodeGenerator final : public AstVisitor<BytecodeGenerator> {
native_function_literals_;
ZoneVector<std::pair<ObjectLiteral*, size_t>> object_literals_;
ZoneVector<std::pair<ArrayLiteral*, size_t>> array_literals_;
ZoneVector<std::pair<ClassLiteral*, size_t>> class_literals_;
ZoneVector<std::pair<GetTemplateObject*, size_t>> template_objects_;
ControlScope* execution_control_;
......
......@@ -151,8 +151,6 @@ bool HeapObject::IsJSGeneratorObject() const {
bool HeapObject::IsBoilerplateDescription() const { return IsFixedArray(); }
bool HeapObject::IsClassBoilerplate() const { return IsFixedArray(); }
bool HeapObject::IsExternal() const {
return map()->FindRootMap() == GetHeap()->external_map();
}
......
......@@ -15569,7 +15569,6 @@ template <typename Derived, typename Shape>
void Dictionary<Derived, Shape>::Print() {
OFStream os(stdout);
Print(os);
os << std::endl;
}
#endif
......@@ -17387,23 +17386,6 @@ Handle<Derived> Dictionary<Derived, Shape>::AtPut(Handle<Derived> dictionary,
return dictionary;
}
template <typename Derived, typename Shape>
Handle<Derived>
BaseNameDictionary<Derived, Shape>::AddNoUpdateNextEnumerationIndex(
Handle<Derived> dictionary, Key key, Handle<Object> value,
PropertyDetails details, int* entry_out) {
// Insert element at empty or deleted entry
return Dictionary<Derived, Shape>::Add(dictionary, key, value, details,
entry_out);
}
// GCC workaround: Explicitly instantiate template method for NameDictionary
// to avoid "undefined reference" issues during linking.
template Handle<NameDictionary>
BaseNameDictionary<NameDictionary, NameDictionaryShape>::
AddNoUpdateNextEnumerationIndex(Handle<NameDictionary>, Handle<Name>,
Handle<Object>, PropertyDetails, int*);
template <typename Derived, typename Shape>
Handle<Derived> BaseNameDictionary<Derived, Shape>::Add(
Handle<Derived> dictionary, Key key, Handle<Object> value,
......@@ -17415,7 +17397,7 @@ Handle<Derived> BaseNameDictionary<Derived, Shape>::Add(
int index = dictionary->NextEnumerationIndex();
details = details.set_index(index);
dictionary->SetNextEnumerationIndex(index + 1);
return AddNoUpdateNextEnumerationIndex(dictionary, key, value, details,
return Dictionary<Derived, Shape>::Add(dictionary, key, value, details,
entry_out);
}
......
......@@ -972,7 +972,6 @@ template <class C> inline bool Is(Object* obj);
V(Callable) \
V(CallHandlerInfo) \
V(Cell) \
V(ClassBoilerplate) \
V(Code) \
V(CodeDataContainer) \
V(CompilationCacheTable) \
......
......@@ -171,10 +171,6 @@ class BaseNameDictionary : public Dictionary<Derived, Shape> {
// Ensure enough space for n additional elements.
static Handle<Derived> EnsureCapacity(Handle<Derived> dictionary, int n);
MUST_USE_RESULT static Handle<Derived> AddNoUpdateNextEnumerationIndex(
Handle<Derived> dictionary, Key key, Handle<Object> value,
PropertyDetails details, int* entry_out = nullptr);
MUST_USE_RESULT static Handle<Derived> Add(Handle<Derived> dictionary,
Key key, Handle<Object> value,
PropertyDetails details,
......
// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_LITERAL_OBJECTS_INL_H_
#define V8_LITERAL_OBJECTS_INL_H_
#include "src/objects-inl.h"
#include "src/objects/literal-objects.h"
// Has to be the last include (doesn't have include guards):
#include "src/objects/object-macros.h"
namespace v8 {
namespace internal {
CAST_ACCESSOR(ClassBoilerplate)
BIT_FIELD_ACCESSORS(ClassBoilerplate, flags, install_class_name_accessor,
ClassBoilerplate::Flags::InstallClassNameAccessorBit)
BIT_FIELD_ACCESSORS(ClassBoilerplate, flags, arguments_count,
ClassBoilerplate::Flags::ArgumentsCountBits)
SMI_ACCESSORS(ClassBoilerplate, flags,
FixedArray::OffsetOfElementAt(kFlagsIndex));
ACCESSORS(ClassBoilerplate, static_properties_template, Object,
FixedArray::OffsetOfElementAt(kClassPropertiesTemplateIndex));
ACCESSORS(ClassBoilerplate, static_elements_template, Object,
FixedArray::OffsetOfElementAt(kClassElementsTemplateIndex));
ACCESSORS(ClassBoilerplate, static_computed_properties, FixedArray,
FixedArray::OffsetOfElementAt(kClassComputedPropertiesIndex));
ACCESSORS(ClassBoilerplate, instance_properties_template, Object,
FixedArray::OffsetOfElementAt(kPrototypePropertiesTemplateIndex));
ACCESSORS(ClassBoilerplate, instance_elements_template, Object,
FixedArray::OffsetOfElementAt(kPrototypeElementsTemplateIndex));
ACCESSORS(ClassBoilerplate, instance_computed_properties, FixedArray,
FixedArray::OffsetOfElementAt(kPrototypeComputedPropertiesIndex));
} // namespace internal
} // namespace v8
#include "src/objects/object-macros-undef.h"
#endif // V8_LITERAL_OBJECTS_INL_H_
This diff is collapsed.
......@@ -13,8 +13,6 @@
namespace v8 {
namespace internal {
class ClassLiteral;
// BoilerplateDescription is a list of properties consisting of name value
// pairs. In addition to the properties, it provides the projected number
// of properties in the backing store. This number includes properties with
......@@ -58,79 +56,6 @@ class ConstantElementsPair : public Tuple2 {
DISALLOW_IMPLICIT_CONSTRUCTORS(ConstantElementsPair);
};
class ClassBoilerplate : public FixedArray {
public:
enum ValueKind { kData, kGetter, kSetter };
struct Flags {
#define FLAGS_BIT_FIELDS(V, _) \
V(InstallClassNameAccessorBit, bool, 1, _) \
V(ArgumentsCountBits, int, 30, _)
DEFINE_BIT_FIELDS(FLAGS_BIT_FIELDS)
#undef FLAGS_BIT_FIELDS
};
struct ComputedEntryFlags {
#define COMPUTED_ENTRY_BIT_FIELDS(V, _) \
V(ValueKindBits, ValueKind, 2, _) \
V(KeyIndexBits, unsigned, 29, _)
DEFINE_BIT_FIELDS(COMPUTED_ENTRY_BIT_FIELDS)
#undef COMPUTED_ENTRY_BIT_FIELDS
};
enum DefineClassArgumentsIndices {
kConstructorArgumentIndex = 1,
kPrototypeArgumentIndex = 2,
// The index of a first dynamic argument passed to Runtime::kDefineClass
// function. The dynamic arguments are consist of method closures and
// computed property names.
kFirstDynamicArgumentIndex = 3,
};
static const int kMinimumClassPropertiesCount = 6;
static const int kMinimumPrototypePropertiesCount = 1;
DECL_CAST(ClassBoilerplate)
DECL_BOOLEAN_ACCESSORS(install_class_name_accessor)
DECL_INT_ACCESSORS(arguments_count)
DECL_ACCESSORS(static_properties_template, Object)
DECL_ACCESSORS(static_elements_template, Object)
DECL_ACCESSORS(static_computed_properties, FixedArray)
DECL_ACCESSORS(instance_properties_template, Object)
DECL_ACCESSORS(instance_elements_template, Object)
DECL_ACCESSORS(instance_computed_properties, FixedArray)
static void AddToPropertiesTemplate(Isolate* isolate,
Handle<NameDictionary> dictionary,
Handle<Name> name, int key_index,
ValueKind value_kind, Object* value);
static void AddToElementsTemplate(Isolate* isolate,
Handle<SeededNumberDictionary> dictionary,
uint32_t key, int key_index,
ValueKind value_kind, Object* value);
static Handle<ClassBoilerplate> BuildClassBoilerplate(Isolate* isolate,
ClassLiteral* expr);
enum {
kFlagsIndex,
kClassPropertiesTemplateIndex,
kClassElementsTemplateIndex,
kClassComputedPropertiesIndex,
kPrototypePropertiesTemplateIndex,
kPrototypeElementsTemplateIndex,
kPrototypeComputedPropertiesIndex,
kBoileplateLength // last element
};
static const int kFullComputedEntrySize = 2;
private:
DECL_INT_ACCESSORS(flags)
};
} // namespace internal
} // namespace v8
......
......@@ -497,18 +497,16 @@ class SharedFunctionInfo : public HeapObject {
DEFINE_BIT_FIELDS(DEBUGGER_HINTS_BIT_FIELDS)
#undef DEBUGGER_HINTS_BIT_FIELDS
// Indicates that this function uses a super property (or an eval that may
// use a super property).
// This is needed to set up the [[HomeObject]] on the function instance.
inline bool needs_home_object() const;
private:
// [raw_name]: Function name string or kNoSharedNameSentinel.
DECL_ACCESSORS(raw_name, Object)
inline void set_kind(FunctionKind kind);
inline void set_needs_home_object(bool value);
// Indicates that this function uses a super property (or an eval that may
// use a super property).
// This is needed to set up the [[HomeObject]] on the function instance.
DECL_BOOLEAN_ACCESSORS(needs_home_object)
friend class Factory;
friend class V8HeapExplorer;
......
This diff is collapsed.
......@@ -80,21 +80,23 @@ namespace internal {
F(BigIntToNumber, 1, 1) \
F(BigIntUnaryOp, 2, 1)
#define FOR_EACH_INTRINSIC_CLASSES(F) \
F(ThrowUnsupportedSuperError, 0, 1) \
F(ThrowConstructorNonCallableError, 1, 1) \
F(ThrowStaticPrototypeError, 0, 1) \
F(ThrowSuperAlreadyCalledError, 0, 1) \
F(ThrowSuperNotCalled, 0, 1) \
F(ThrowNotSuperConstructor, 2, 1) \
F(HomeObjectSymbol, 0, 1) \
F(DefineClass, -1 /* >= 3 */, 1) \
F(LoadFromSuper, 3, 1) \
F(LoadKeyedFromSuper, 3, 1) \
F(StoreToSuper_Strict, 4, 1) \
F(StoreToSuper_Sloppy, 4, 1) \
F(StoreKeyedToSuper_Strict, 4, 1) \
F(StoreKeyedToSuper_Sloppy, 4, 1) \
#define FOR_EACH_INTRINSIC_CLASSES(F) \
F(ThrowUnsupportedSuperError, 0, 1) \
F(ThrowConstructorNonCallableError, 1, 1) \
F(ThrowStaticPrototypeError, 0, 1) \
F(ThrowSuperAlreadyCalledError, 0, 1) \
F(ThrowSuperNotCalled, 0, 1) \
F(ThrowNotSuperConstructor, 2, 1) \
F(HomeObjectSymbol, 0, 1) \
F(DefineClass, 4, 1) \
F(InstallClassNameAccessor, 1, 1) \
F(InstallClassNameAccessorWithCheck, 1, 1) \
F(LoadFromSuper, 3, 1) \
F(LoadKeyedFromSuper, 3, 1) \
F(StoreToSuper_Strict, 4, 1) \
F(StoreToSuper_Sloppy, 4, 1) \
F(StoreKeyedToSuper_Strict, 4, 1) \
F(StoreKeyedToSuper_Sloppy, 4, 1) \
F(GetSuperConstructor, 1, 1)
#define FOR_EACH_INTRINSIC_COLLECTIONS(F) \
......
......@@ -1179,7 +1179,6 @@
'objects/js-regexp.h',
'objects/js-regexp-inl.h',
'objects/literal-objects.cc',
'objects/literal-objects-inl.h',
'objects/literal-objects.h',
'objects/map-inl.h',
'objects/map.h',
......
......@@ -12,28 +12,40 @@ snippet: "
speak() { console.log(this.name + ' is speaking.'); }
}
"
frame size: 6
frame size: 8
parameter count: 1
bytecode array length: 31
bytecode array length: 67
bytecodes: [
/* 30 E> */ B(StackCheck),
B(CreateClosure), U8(0), U8(0), U8(2),
B(Star), R(2),
B(LdaTheHole),
B(Star), R(4),
B(CreateClosure), U8(1), U8(0), U8(2),
B(Star), R(3),
B(LdaConstant), U8(0),
B(Star), R(2),
B(CreateClosure), U8(2), U8(1), U8(2),
B(LdaSmi), I8(34),
B(Star), R(5),
B(Wide), B(LdaSmi), I16(148),
B(Star), R(6),
B(Mov), R(2), R(4),
B(CallRuntime), U16(Runtime::kDefineClass), R(3), U8(4),
B(Star), R(3),
B(LdaConstant), U8(1),
B(Star), R(5),
B(CallRuntime), U16(Runtime::kDefineClass), R(2), U8(4),
B(CreateClosure), U8(2), U8(1), U8(2),
B(Star), R(6),
B(LdaSmi), I8(2),
B(Star), R(7),
B(Ldar), R(6),
B(StaDataPropertyInLiteral), R(3), R(5), U8(1), U8(2),
B(CallRuntime), U16(Runtime::kInstallClassNameAccessor), R(2), U8(1),
B(CallRuntime), U16(Runtime::kToFastProperties), R(2), U8(1),
B(Star), R(0),
B(Star), R(1),
B(LdaUndefined),
/* 149 S> */ B(Return),
]
constant pool: [
FIXED_ARRAY_TYPE,
SHARED_FUNCTION_INFO_TYPE,
ONE_BYTE_INTERNALIZED_STRING_TYPE ["speak"],
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
......@@ -46,28 +58,40 @@ snippet: "
speak() { console.log(this.name + ' is speaking.'); }
}
"
frame size: 6
frame size: 8
parameter count: 1
bytecode array length: 31
bytecode array length: 67
bytecodes: [
/* 30 E> */ B(StackCheck),
B(CreateClosure), U8(0), U8(0), U8(2),
B(Star), R(2),
B(LdaTheHole),
B(Star), R(4),
B(CreateClosure), U8(1), U8(0), U8(2),
B(Star), R(3),
B(LdaConstant), U8(0),
B(Star), R(2),
B(CreateClosure), U8(2), U8(1), U8(2),
B(LdaSmi), I8(34),
B(Star), R(5),
B(CallRuntime), U16(Runtime::kDefineClass), R(2), U8(4),
B(Wide), B(LdaSmi), I16(148),
B(Star), R(6),
B(Mov), R(2), R(4),
B(CallRuntime), U16(Runtime::kDefineClass), R(3), U8(4),
B(Star), R(3),
B(LdaConstant), U8(1),
B(Star), R(5),
B(CreateClosure), U8(2), U8(1), U8(2),
B(Star), R(6),
B(LdaSmi), I8(2),
B(Star), R(7),
B(Ldar), R(6),
B(StaDataPropertyInLiteral), R(3), R(5), U8(1), U8(2),
B(CallRuntime), U16(Runtime::kInstallClassNameAccessor), R(2), U8(1),
B(CallRuntime), U16(Runtime::kToFastProperties), R(2), U8(1),
B(Star), R(0),
B(Star), R(1),
B(LdaUndefined),
/* 149 S> */ B(Return),
]
constant pool: [
FIXED_ARRAY_TYPE,
SHARED_FUNCTION_INFO_TYPE,
ONE_BYTE_INTERNALIZED_STRING_TYPE ["speak"],
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
......@@ -82,9 +106,9 @@ snippet: "
static [n1]() { return n1; }
}
"
frame size: 10
frame size: 9
parameter count: 1
bytecode array length: 68
bytecode array length: 106
bytecodes: [
B(CreateFunctionContext), U8(2),
B(PushContext), R(2),
......@@ -93,25 +117,36 @@ bytecodes: [
/* 43 E> */ B(StaCurrentContextSlot), U8(4),
/* 57 S> */ B(LdaConstant), U8(1),
/* 57 E> */ B(StaCurrentContextSlot), U8(5),
B(CreateClosure), U8(2), U8(0), U8(2),
B(Star), R(3),
B(LdaTheHole),
B(Star), R(5),
B(CreateClosure), U8(3), U8(0), U8(2),
B(Star), R(4),
B(LdaConstant), U8(2),
B(Star), R(3),
B(LdaSmi), I8(62),
B(Star), R(6),
B(Wide), B(LdaSmi), I16(128),
B(Star), R(7),
B(Mov), R(3), R(5),
B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(4),
B(Star), R(4),
B(LdaImmutableCurrentContextSlot), U8(4),
/* 75 E> */ B(ToName), R(6),
B(CreateClosure), U8(4), U8(1), U8(2),
B(CreateClosure), U8(3), U8(1), U8(2),
B(Star), R(7),
B(LdaSmi), I8(2),
B(Star), R(8),
B(Ldar), R(7),
B(StaDataPropertyInLiteral), R(4), R(6), U8(3), U8(2),
B(LdaImmutableCurrentContextSlot), U8(5),
/* 106 E> */ B(ToName), R(8),
B(LdaConstant), U8(5),
B(TestEqualStrictNoFeedback), R(8),
/* 106 E> */ B(ToName), R(6),
B(LdaConstant), U8(4),
B(TestEqualStrictNoFeedback), R(6),
B(Mov), R(3), R(5),
B(JumpIfFalse), U8(7),
B(CallRuntime), U16(Runtime::kThrowStaticPrototypeError), R(0), U8(0),
B(CreateClosure), U8(6), U8(2), U8(2),
B(Star), R(9),
B(CallRuntime), U16(Runtime::kDefineClass), R(3), U8(7),
B(CreateClosure), U8(5), U8(4), U8(2),
B(StaDataPropertyInLiteral), R(5), R(6), U8(3), U8(5),
B(CallRuntime), U16(Runtime::kInstallClassNameAccessorWithCheck), R(3), U8(1),
B(CallRuntime), U16(Runtime::kToFastProperties), R(3), U8(1),
B(Star), R(0),
B(Star), R(1),
B(LdaUndefined),
......@@ -120,7 +155,6 @@ bytecodes: [
constant pool: [
ONE_BYTE_INTERNALIZED_STRING_TYPE ["a"],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["b"],
FIXED_ARRAY_TYPE,
SHARED_FUNCTION_INFO_TYPE,
SHARED_FUNCTION_INFO_TYPE,
ONE_BYTE_INTERNALIZED_STRING_TYPE ["prototype"],
......@@ -135,29 +169,34 @@ snippet: "
class C { constructor() { count++; }}
return new C();
"
frame size: 6
frame size: 8
parameter count: 1
bytecode array length: 36
bytecode array length: 55
bytecodes: [
B(CreateFunctionContext), U8(1),
B(PushContext), R(2),
/* 30 E> */ B(StackCheck),
/* 46 S> */ B(LdaZero),
/* 46 E> */ B(StaCurrentContextSlot), U8(4),
B(CreateClosure), U8(0), U8(0), U8(2),
B(Star), R(3),
B(LdaTheHole),
B(Star), R(5),
B(CreateClosure), U8(1), U8(0), U8(2),
B(Star), R(4),
B(LdaConstant), U8(0),
B(Star), R(3),
B(CallRuntime), U16(Runtime::kDefineClass), R(3), U8(3),
B(LdaSmi), I8(49),
B(Star), R(6),
B(LdaSmi), I8(86),
B(Star), R(7),
B(Mov), R(3), R(5),
B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(4),
B(Star), R(4),
B(CallRuntime), U16(Runtime::kInstallClassNameAccessor), R(3), U8(1),
B(CallRuntime), U16(Runtime::kToFastProperties), R(3), U8(1),
B(Star), R(0),
B(Star), R(1),
/* 94 S> */ B(Construct), R(1), R(0), U8(0), U8(1),
/* 102 S> */ B(Return),
]
constant pool: [
FIXED_ARRAY_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
......@@ -168,37 +207,52 @@ snippet: "
(class {})
class E { static name () {}}
"
frame size: 6
frame size: 8
parameter count: 1
bytecode array length: 49
bytecode array length: 92
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 34 S> */ B(LdaTheHole),
B(Star), R(4),
B(CreateClosure), U8(1), U8(0), U8(2),
/* 34 S> */ B(CreateClosure), U8(0), U8(0), U8(2),
B(Star), R(2),
B(LdaTheHole),
B(Star), R(3),
B(LdaSmi), I8(35),
B(Star), R(5),
B(LdaSmi), I8(43),
B(Star), R(6),
B(Mov), R(2), R(4),
B(CallRuntime), U16(Runtime::kDefineClass), R(3), U8(4),
B(Star), R(3),
B(LdaConstant), U8(0),
B(CallRuntime), U16(Runtime::kToFastProperties), R(2), U8(1),
B(CreateClosure), U8(1), U8(1), U8(2),
B(Star), R(2),
B(CallRuntime), U16(Runtime::kDefineClass), R(2), U8(3),
B(LdaTheHole),
B(Star), R(4),
B(CreateClosure), U8(3), U8(1), U8(2),
B(Star), R(3),
B(LdaSmi), I8(45),
B(Star), R(5),
B(LdaSmi), I8(73),
B(Star), R(6),
B(Mov), R(2), R(4),
B(CallRuntime), U16(Runtime::kDefineClass), R(3), U8(4),
B(Star), R(3),
B(LdaConstant), U8(2),
B(Star), R(2),
B(CreateClosure), U8(4), U8(2), U8(2),
B(Star), R(5),
B(CallRuntime), U16(Runtime::kDefineClass), R(2), U8(4),
B(CreateClosure), U8(3), U8(2), U8(2),
B(Star), R(6),
B(LdaSmi), I8(2),
B(Star), R(7),
B(Ldar), R(6),
B(StaDataPropertyInLiteral), R(4), R(5), U8(1), U8(3),
B(CallRuntime), U16(Runtime::kToFastProperties), R(2), U8(1),
B(Star), R(0),
B(Star), R(1),
B(LdaUndefined),
/* 74 S> */ B(Return),
]
constant pool: [
FIXED_ARRAY_TYPE,
SHARED_FUNCTION_INFO_TYPE,
FIXED_ARRAY_TYPE,
SHARED_FUNCTION_INFO_TYPE,
ONE_BYTE_INTERNALIZED_STRING_TYPE ["name"],
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
......
......@@ -505,9 +505,9 @@ handlers: [
snippet: "
export default (class {});
"
frame size: 6
frame size: 8
parameter count: 2
bytecode array length: 121
bytecode array length: 140
bytecodes: [
B(Ldar), R(1),
B(JumpIfUndefined), U8(18),
......@@ -548,13 +548,19 @@ bytecodes: [
/* 26 S> */ B(Return),
B(Ldar), R(3),
B(StaCurrentContextSlot), U8(5),
B(CreateClosure), U8(4), U8(0), U8(0),
B(Star), R(3),
B(LdaTheHole),
B(Star), R(5),
B(CreateClosure), U8(5), U8(0), U8(0),
B(Star), R(4),
B(LdaConstant), U8(4),
B(Star), R(3),
B(CallRuntime), U16(Runtime::kDefineClass), R(3), U8(3),
B(LdaSmi), I8(16),
B(Star), R(6),
B(LdaSmi), I8(24),
B(Star), R(7),
B(Mov), R(3), R(5),
B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(4),
B(Star), R(4),
B(CallRuntime), U16(Runtime::kInstallClassNameAccessor), R(3), U8(1),
B(CallRuntime), U16(Runtime::kToFastProperties), R(3), U8(1),
B(StaModuleVariable), I8(1), U8(0),
B(LdaCurrentContextSlot), U8(5),
/* 26 S> */ B(Return),
......@@ -564,7 +570,6 @@ constant pool: [
FIXED_ARRAY_TYPE,
Smi [10],
Smi [7],
FIXED_ARRAY_TYPE,
SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
......
......@@ -10,21 +10,27 @@ snippet: "
class A { constructor(...args) { this.args = args; } }
new A(...[1, 2, 3]);
"
frame size: 5
frame size: 7
parameter count: 1
bytecode array length: 38
bytecode array length: 57
bytecodes: [
/* 30 E> */ B(StackCheck),
B(CreateClosure), U8(0), U8(0), U8(2),
B(Star), R(2),
B(LdaTheHole),
B(Star), R(4),
B(CreateClosure), U8(1), U8(0), U8(2),
B(Star), R(3),
B(LdaConstant), U8(0),
B(Star), R(2),
B(CallRuntime), U16(Runtime::kDefineClass), R(2), U8(3),
B(LdaSmi), I8(34),
B(Star), R(5),
B(LdaSmi), I8(88),
B(Star), R(6),
B(Mov), R(2), R(4),
B(CallRuntime), U16(Runtime::kDefineClass), R(3), U8(4),
B(Star), R(3),
B(CallRuntime), U16(Runtime::kInstallClassNameAccessor), R(2), U8(1),
B(CallRuntime), U16(Runtime::kToFastProperties), R(2), U8(1),
B(Star), R(0),
B(Star), R(1),
/* 89 S> */ B(CreateArrayLiteral), U8(2), U8(1), U8(37),
/* 89 S> */ B(CreateArrayLiteral), U8(1), U8(1), U8(37),
B(Star), R(3),
B(Ldar), R(1),
/* 89 E> */ B(ConstructWithSpread), R(1), R(3), U8(1), U8(2),
......@@ -32,7 +38,6 @@ bytecodes: [
/* 110 S> */ B(Return),
]
constant pool: [
FIXED_ARRAY_TYPE,
SHARED_FUNCTION_INFO_TYPE,
TUPLE2_TYPE,
]
......@@ -44,23 +49,29 @@ snippet: "
class A { constructor(...args) { this.args = args; } }
new A(0, ...[1, 2, 3]);
"
frame size: 5
frame size: 7
parameter count: 1
bytecode array length: 41
bytecode array length: 60
bytecodes: [
/* 30 E> */ B(StackCheck),
B(CreateClosure), U8(0), U8(0), U8(2),
B(Star), R(2),
B(LdaTheHole),
B(Star), R(4),
B(CreateClosure), U8(1), U8(0), U8(2),
B(Star), R(3),
B(LdaConstant), U8(0),
B(Star), R(2),
B(CallRuntime), U16(Runtime::kDefineClass), R(2), U8(3),
B(LdaSmi), I8(34),
B(Star), R(5),
B(LdaSmi), I8(88),
B(Star), R(6),
B(Mov), R(2), R(4),
B(CallRuntime), U16(Runtime::kDefineClass), R(3), U8(4),
B(Star), R(3),
B(CallRuntime), U16(Runtime::kInstallClassNameAccessor), R(2), U8(1),
B(CallRuntime), U16(Runtime::kToFastProperties), R(2), U8(1),
B(Star), R(0),
B(Star), R(1),
/* 89 S> */ B(LdaZero),
B(Star), R(3),
B(CreateArrayLiteral), U8(2), U8(1), U8(37),
B(CreateArrayLiteral), U8(1), U8(1), U8(37),
B(Star), R(4),
B(Ldar), R(1),
/* 89 E> */ B(ConstructWithSpread), R(1), R(3), U8(2), U8(2),
......@@ -68,7 +79,6 @@ bytecodes: [
/* 113 S> */ B(Return),
]
constant pool: [
FIXED_ARRAY_TYPE,
SHARED_FUNCTION_INFO_TYPE,
TUPLE2_TYPE,
]
......@@ -80,27 +90,33 @@ snippet: "
class A { constructor(...args) { this.args = args; } }
new A(0, ...[1, 2, 3], 4);
"
frame size: 6
frame size: 7
parameter count: 1
bytecode array length: 62
bytecode array length: 81
bytecodes: [
/* 30 E> */ B(StackCheck),
B(CreateClosure), U8(0), U8(0), U8(2),
B(Star), R(2),
B(LdaTheHole),
B(Star), R(4),
B(CreateClosure), U8(1), U8(0), U8(2),
B(Star), R(3),
B(LdaConstant), U8(0),
B(Star), R(2),
B(CallRuntime), U16(Runtime::kDefineClass), R(2), U8(3),
B(LdaSmi), I8(34),
B(Star), R(5),
B(LdaSmi), I8(88),
B(Star), R(6),
B(Mov), R(2), R(4),
B(CallRuntime), U16(Runtime::kDefineClass), R(3), U8(4),
B(Star), R(3),
B(CallRuntime), U16(Runtime::kInstallClassNameAccessor), R(2), U8(1),
B(CallRuntime), U16(Runtime::kToFastProperties), R(2), U8(1),
B(Star), R(0),
B(Star), R(1),
/* 89 S> */ B(CreateArrayLiteral), U8(2), U8(1), U8(37),
/* 89 S> */ B(CreateArrayLiteral), U8(1), U8(1), U8(37),
B(Star), R(3),
B(CreateArrayLiteral), U8(3), U8(2), U8(37),
B(CreateArrayLiteral), U8(2), U8(2), U8(37),
B(Star), R(4),
B(CallJSRuntime), U8(%spread_iterable), R(4), U8(1),
B(Star), R(4),
B(CreateArrayLiteral), U8(4), U8(3), U8(37),
B(CreateArrayLiteral), U8(3), U8(3), U8(37),
B(Star), R(5),
B(CallJSRuntime), U8(%spread_arguments), R(3), U8(3),
B(Star), R(3),
......@@ -110,7 +126,6 @@ bytecodes: [
/* 116 S> */ B(Return),
]
constant pool: [
FIXED_ARRAY_TYPE,
SHARED_FUNCTION_INFO_TYPE,
TUPLE2_TYPE,
TUPLE2_TYPE,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment