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

Unified Diff: test/cctest/test-code-stub-assembler.cc

Issue 2498073002: [refactoring] Split CodeAssemblerState out of CodeAssembler (Closed)
Patch Set: one more attempt Created 4 years, 1 month 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: test/cctest/test-code-stub-assembler.cc
diff --git a/test/cctest/test-code-stub-assembler.cc b/test/cctest/test-code-stub-assembler.cc
index da2773fdcaf659428b5206b13bf25a0887966dbe..28cdc55318a61b6c359933841fcc149a43bbb125 100644
--- a/test/cctest/test-code-stub-assembler.cc
+++ b/test/cctest/test-code-stub-assembler.cc
@@ -14,48 +14,46 @@
namespace v8 {
namespace internal {
+using compiler::CodeAssemblerTester;
using compiler::FunctionTester;
using compiler::Node;
-typedef compiler::CodeAssemblerTesterImpl<CodeStubAssembler>
- CodeStubAssemblerTester;
-
TEST(FixedArrayAccessSmiIndex) {
Isolate* isolate(CcTest::InitIsolateOnce());
- VoidDescriptor descriptor(isolate);
- CodeStubAssemblerTester m(isolate, descriptor);
+ CodeAssemblerTester data(isolate);
+ CodeStubAssembler m(data.state());
Handle<FixedArray> array = isolate->factory()->NewFixedArray(5);
array->set(4, Smi::FromInt(733));
m.Return(m.LoadFixedArrayElement(m.HeapConstant(array),
m.SmiTag(m.Int32Constant(4)), 0,
CodeStubAssembler::SMI_PARAMETERS));
- Handle<Code> code = m.GenerateCode();
- FunctionTester ft(descriptor, code);
+ Handle<Code> code = data.GenerateCode();
+ FunctionTester ft(code);
MaybeHandle<Object> result = ft.Call();
CHECK_EQ(733, Handle<Smi>::cast(result.ToHandleChecked())->value());
}
TEST(LoadHeapNumberValue) {
Isolate* isolate(CcTest::InitIsolateOnce());
- VoidDescriptor descriptor(isolate);
- CodeStubAssemblerTester m(isolate, descriptor);
+ CodeAssemblerTester data(isolate);
+ CodeStubAssembler m(data.state());
Handle<HeapNumber> number = isolate->factory()->NewHeapNumber(1234);
m.Return(m.SmiTag(
m.ChangeFloat64ToUint32(m.LoadHeapNumberValue(m.HeapConstant(number)))));
- Handle<Code> code = m.GenerateCode();
- FunctionTester ft(descriptor, code);
+ Handle<Code> code = data.GenerateCode();
+ FunctionTester ft(code);
MaybeHandle<Object> result = ft.Call();
CHECK_EQ(1234, Handle<Smi>::cast(result.ToHandleChecked())->value());
}
TEST(LoadInstanceType) {
Isolate* isolate(CcTest::InitIsolateOnce());
- VoidDescriptor descriptor(isolate);
- CodeStubAssemblerTester m(isolate, descriptor);
+ CodeAssemblerTester data(isolate);
+ CodeStubAssembler m(data.state());
Handle<HeapObject> undefined = isolate->factory()->undefined_value();
m.Return(m.SmiTag(m.LoadInstanceType(m.HeapConstant(undefined))));
- Handle<Code> code = m.GenerateCode();
- FunctionTester ft(descriptor, code);
+ Handle<Code> code = data.GenerateCode();
+ FunctionTester ft(code);
MaybeHandle<Object> result = ft.Call();
CHECK_EQ(InstanceType::ODDBALL_TYPE,
Handle<Smi>::cast(result.ToHandleChecked())->value());
@@ -63,14 +61,14 @@ TEST(LoadInstanceType) {
TEST(DecodeWordFromWord32) {
Isolate* isolate(CcTest::InitIsolateOnce());
- VoidDescriptor descriptor(isolate);
- CodeStubAssemblerTester m(isolate, descriptor);
+ CodeAssemblerTester data(isolate);
+ CodeStubAssembler m(data.state());
class TestBitField : public BitField<unsigned, 3, 3> {};
m.Return(
m.SmiTag(m.DecodeWordFromWord32<TestBitField>(m.Int32Constant(0x2f))));
- Handle<Code> code = m.GenerateCode();
- FunctionTester ft(descriptor, code);
+ Handle<Code> code = data.GenerateCode();
+ FunctionTester ft(code);
MaybeHandle<Object> result = ft.Call();
// value = 00101111
// mask = 00111000
@@ -81,11 +79,12 @@ TEST(DecodeWordFromWord32) {
TEST(JSFunction) {
const int kNumParams = 3; // Receiver, left, right.
Isolate* isolate(CcTest::InitIsolateOnce());
- CodeStubAssemblerTester m(isolate, kNumParams);
+ CodeAssemblerTester data(isolate, kNumParams);
+ CodeStubAssembler m(data.state());
m.Return(m.SmiFromWord32(m.Int32Add(m.SmiToWord32(m.Parameter(1)),
m.SmiToWord32(m.Parameter(2)))));
- Handle<Code> code = m.GenerateCode();
+ Handle<Code> code = data.GenerateCode();
FunctionTester ft(code, kNumParams);
MaybeHandle<Object> result = ft.Call(isolate->factory()->undefined_value(),
@@ -97,11 +96,12 @@ TEST(JSFunction) {
TEST(ComputeIntegerHash) {
Isolate* isolate(CcTest::InitIsolateOnce());
const int kNumParams = 2;
- CodeStubAssemblerTester m(isolate, kNumParams);
+ CodeAssemblerTester data(isolate, kNumParams);
+ CodeStubAssembler m(data.state());
m.Return(m.SmiFromWord32(m.ComputeIntegerHash(
m.SmiToWord32(m.Parameter(0)), m.SmiToWord32(m.Parameter(1)))));
- Handle<Code> code = m.GenerateCode();
+ Handle<Code> code = data.GenerateCode();
FunctionTester ft(code, kNumParams);
Handle<Smi> hash_seed = isolate->factory()->hash_seed();
@@ -123,10 +123,11 @@ TEST(ComputeIntegerHash) {
TEST(ToString) {
Isolate* isolate(CcTest::InitIsolateOnce());
const int kNumParams = 1;
- CodeStubAssemblerTester m(isolate, kNumParams);
+ CodeAssemblerTester data(isolate, kNumParams);
+ CodeStubAssembler m(data.state());
m.Return(m.ToString(m.Parameter(kNumParams + 2), m.Parameter(0)));
- Handle<Code> code = m.GenerateCode();
+ Handle<Code> code = data.GenerateCode();
FunctionTester ft(code, kNumParams);
Handle<FixedArray> test_cases = isolate->factory()->NewFixedArray(5);
@@ -179,10 +180,11 @@ TEST(ToString) {
TEST(FlattenString) {
Isolate* isolate(CcTest::InitIsolateOnce());
const int kNumParams = 1;
- CodeStubAssemblerTester m(isolate, kNumParams);
+ CodeAssemblerTester data(isolate, kNumParams);
+ CodeStubAssembler m(data.state());
m.Return(m.FlattenString(m.Parameter(0)));
- Handle<Code> code = m.GenerateCode();
+ Handle<Code> code = data.GenerateCode();
FunctionTester ft(code, kNumParams);
Handle<FixedArray> test_cases(isolate->factory()->NewFixedArray(4));
@@ -222,7 +224,8 @@ TEST(TryToName) {
Isolate* isolate(CcTest::InitIsolateOnce());
const int kNumParams = 3;
- CodeStubAssemblerTester m(isolate, kNumParams);
+ CodeAssemblerTester data(isolate, kNumParams);
+ CodeStubAssembler m(data.state());
enum Result { kKeyIsIndex, kKeyIsUnique, kBailout };
{
@@ -261,7 +264,7 @@ TEST(TryToName) {
m.Return(m.BooleanConstant(false));
}
- Handle<Code> code = m.GenerateCode();
+ Handle<Code> code = data.GenerateCode();
FunctionTester ft(code, kNumParams);
Handle<Object> expect_index(Smi::FromInt(kKeyIsIndex), isolate);
@@ -352,14 +355,15 @@ void TestEntryToIndex() {
Isolate* isolate(CcTest::InitIsolateOnce());
const int kNumParams = 1;
- CodeStubAssemblerTester m(isolate, kNumParams);
+ CodeAssemblerTester data(isolate, kNumParams);
+ CodeStubAssembler m(data.state());
{
Node* entry = m.SmiUntag(m.Parameter(0));
Node* result = m.EntryToIndex<Dictionary>(entry);
m.Return(m.SmiTag(result));
}
- Handle<Code> code = m.GenerateCode();
+ Handle<Code> code = data.GenerateCode();
FunctionTester ft(code, kNumParams);
// Test a wide range of entries but staying linear in the first 100 entries.
@@ -385,7 +389,8 @@ void TestNameDictionaryLookup() {
Isolate* isolate(CcTest::InitIsolateOnce());
const int kNumParams = 4;
- CodeStubAssemblerTester m(isolate, kNumParams);
+ CodeAssemblerTester data(isolate, kNumParams);
+ CodeStubAssembler m(data.state());
enum Result { kFound, kNotFound };
{
@@ -419,7 +424,7 @@ void TestNameDictionaryLookup() {
m.Return(m.BooleanConstant(false));
}
- Handle<Code> code = m.GenerateCode();
+ Handle<Code> code = data.GenerateCode();
FunctionTester ft(code, kNumParams);
Handle<Object> expect_found(Smi::FromInt(kFound), isolate);
@@ -491,7 +496,8 @@ void TestNumberDictionaryLookup() {
Isolate* isolate(CcTest::InitIsolateOnce());
const int kNumParams = 4;
- CodeStubAssemblerTester m(isolate, kNumParams);
+ CodeAssemblerTester data(isolate, kNumParams);
+ CodeStubAssembler m(data.state());
enum Result { kFound, kNotFound };
{
@@ -525,7 +531,7 @@ void TestNumberDictionaryLookup() {
m.Return(m.BooleanConstant(false));
}
- Handle<Code> code = m.GenerateCode();
+ Handle<Code> code = data.GenerateCode();
FunctionTester ft(code, kNumParams);
Handle<Object> expect_found(Smi::FromInt(kFound), isolate);
@@ -628,7 +634,8 @@ TEST(TryHasOwnProperty) {
Isolate* isolate(CcTest::InitIsolateOnce());
const int kNumParams = 4;
- CodeStubAssemblerTester m(isolate, kNumParams);
+ CodeAssemblerTester data(isolate, kNumParams);
+ CodeStubAssembler m(data.state());
enum Result { kFound, kNotFound, kBailout };
{
@@ -666,7 +673,7 @@ TEST(TryHasOwnProperty) {
m.Return(m.BooleanConstant(false));
}
- Handle<Code> code = m.GenerateCode();
+ Handle<Code> code = data.GenerateCode();
FunctionTester ft(code, kNumParams);
Handle<Object> expect_found(Smi::FromInt(kFound), isolate);
@@ -814,7 +821,8 @@ TEST(TryGetOwnProperty) {
Factory* factory = isolate->factory();
const int kNumParams = 2;
- CodeStubAssemblerTester m(isolate, kNumParams);
+ CodeAssemblerTester data(isolate, kNumParams);
+ CodeStubAssembler m(data.state());
Handle<Symbol> not_found_symbol = factory->NewSymbol();
Handle<Symbol> bailout_symbol = factory->NewSymbol();
@@ -843,7 +851,7 @@ TEST(TryGetOwnProperty) {
m.Return(m.HeapConstant(bailout_symbol));
}
- Handle<Code> code = m.GenerateCode();
+ Handle<Code> code = data.GenerateCode();
FunctionTester ft(code, kNumParams);
Handle<Name> deleted_property_name =
@@ -1030,7 +1038,8 @@ TEST(TryLookupElement) {
Isolate* isolate(CcTest::InitIsolateOnce());
const int kNumParams = 3;
- CodeStubAssemblerTester m(isolate, kNumParams);
+ CodeAssemblerTester data(isolate, kNumParams);
+ CodeStubAssembler m(data.state());
enum Result { kFound, kNotFound, kBailout };
{
@@ -1068,7 +1077,7 @@ TEST(TryLookupElement) {
m.Return(m.BooleanConstant(false));
}
- Handle<Code> code = m.GenerateCode();
+ Handle<Code> code = data.GenerateCode();
FunctionTester ft(code, kNumParams);
Factory* factory = isolate->factory();
@@ -1216,8 +1225,8 @@ TEST(DeferredCodePhiHints) {
typedef CodeStubAssembler::Label Label;
typedef CodeStubAssembler::Variable Variable;
Isolate* isolate(CcTest::InitIsolateOnce());
- VoidDescriptor descriptor(isolate);
- CodeStubAssemblerTester m(isolate, descriptor);
+ CodeAssemblerTester data(isolate);
+ CodeStubAssembler m(data.state());
Label block1(&m, Label::kDeferred);
m.Goto(&block1);
m.Bind(&block1);
@@ -1233,15 +1242,15 @@ TEST(DeferredCodePhiHints) {
m.Goto(&loop);
}
}
- CHECK(!m.GenerateCode().is_null());
+ CHECK(!data.GenerateCode().is_null());
}
TEST(TestOutOfScopeVariable) {
typedef CodeStubAssembler::Label Label;
typedef CodeStubAssembler::Variable Variable;
Isolate* isolate(CcTest::InitIsolateOnce());
- VoidDescriptor descriptor(isolate);
- CodeStubAssemblerTester m(isolate, descriptor);
+ CodeAssemblerTester data(isolate);
+ CodeStubAssembler m(data.state());
Label block1(&m);
Label block2(&m);
Label block3(&m);
@@ -1262,7 +1271,7 @@ TEST(TestOutOfScopeVariable) {
m.Goto(&block1);
}
m.Bind(&block1);
- CHECK(!m.GenerateCode().is_null());
+ CHECK(!data.GenerateCode().is_null());
}
namespace {
@@ -1270,7 +1279,8 @@ namespace {
void TestStubCacheOffsetCalculation(StubCache::Table table) {
Isolate* isolate(CcTest::InitIsolateOnce());
const int kNumParams = 2;
- CodeStubAssemblerTester m(isolate, kNumParams);
+ CodeAssemblerTester data(isolate, kNumParams);
+ CodeStubAssembler m(data.state());
{
Node* name = m.Parameter(0);
@@ -1286,7 +1296,7 @@ void TestStubCacheOffsetCalculation(StubCache::Table table) {
m.Return(m.SmiFromWord32(result));
}
- Handle<Code> code = m.GenerateCode();
+ Handle<Code> code = data.GenerateCode();
FunctionTester ft(code, kNumParams);
Factory* factory = isolate->factory();
@@ -1354,9 +1364,10 @@ namespace {
Handle<Code> CreateCodeWithFlags(Code::Flags flags) {
Isolate* isolate(CcTest::InitIsolateOnce());
- CodeStubAssemblerTester m(isolate, flags);
+ CodeAssemblerTester data(isolate, flags);
+ CodeStubAssembler m(data.state());
m.Return(m.UndefinedConstant());
- return m.GenerateCodeCloseAndEscape();
+ return data.GenerateCodeCloseAndEscape();
}
} // namespace
@@ -1366,7 +1377,8 @@ TEST(TryProbeStubCache) {
typedef CodeStubAssembler::Variable Variable;
Isolate* isolate(CcTest::InitIsolateOnce());
const int kNumParams = 3;
- CodeStubAssemblerTester m(isolate, kNumParams);
+ CodeAssemblerTester data(isolate, kNumParams);
+ CodeStubAssembler m(data.state());
Code::Kind ic_kind = Code::LOAD_IC;
StubCache stub_cache(isolate, ic_kind);
@@ -1399,7 +1411,7 @@ TEST(TryProbeStubCache) {
m.Return(m.BooleanConstant(false));
}
- Handle<Code> code = m.GenerateCode();
+ Handle<Code> code = data.GenerateCode();
FunctionTester ft(code, kNumParams);
std::vector<Handle<Name>> names;
@@ -1510,8 +1522,8 @@ TEST(GotoIfException) {
Isolate* isolate(CcTest::InitIsolateOnce());
const int kNumParams = 1;
- // Emulate TFJ builtin
- CodeStubAssemblerTester m(isolate, kNumParams, Code::BUILTIN);
+ CodeAssemblerTester data(isolate, kNumParams);
+ CodeStubAssembler m(data.state());
Node* context = m.HeapConstant(Handle<Context>(isolate->native_context()));
Node* to_string_tag =
@@ -1527,13 +1539,13 @@ TEST(GotoIfException) {
m.Bind(&exception_handler);
m.Return(exception.value());
- Handle<Code> code = m.GenerateCode();
+ Handle<Code> code = data.GenerateCode();
CHECK(!code.is_null());
FunctionTester ft(code, kNumParams);
Handle<Object> result = ft.Call().ToHandleChecked();
- // Should be a TypeError
+ // Should be a TypeError.
CHECK(result->IsJSObject());
Handle<Object> constructor =
@@ -1549,8 +1561,8 @@ TEST(GotoIfExceptionMultiple) {
Isolate* isolate(CcTest::InitIsolateOnce());
const int kNumParams = 4; // receiver, first, second, third
- // Emulate TFJ builtin
- CodeStubAssemblerTester m(isolate, kNumParams, Code::BUILTIN);
+ CodeAssemblerTester data(isolate, kNumParams);
+ CodeStubAssembler m(data.state());
Node* context = m.HeapConstant(Handle<Context>(isolate->native_context()));
Node* first_value = m.Parameter(0);
@@ -1592,25 +1604,25 @@ TEST(GotoIfExceptionMultiple) {
m.Bind(&exception_handler3);
m.Return(error.value());
- Handle<Code> code = m.GenerateCode();
+ Handle<Code> code = data.GenerateCode();
CHECK(!code.is_null());
FunctionTester ft(code, kNumParams);
Handle<Object> result;
- // First handler does not throw, returns result of first value
+ // First handler does not throw, returns result of first value.
result = ft.Call(isolate->factory()->undefined_value(),
isolate->factory()->to_string_tag_symbol())
.ToHandleChecked();
CHECK(String::cast(*result)->IsOneByteEqualTo(OneByteVector("undefined")));
- // First handler returns a number
+ // First handler returns a number.
result = ft.Call(isolate->factory()->to_string_tag_symbol(),
isolate->factory()->undefined_value())
.ToHandleChecked();
CHECK_EQ(7, Smi::cast(*result)->value());
- // First handler throws, second handler returns a number
+ // First handler throws, second handler returns a number.
result = ft.Call(isolate->factory()->to_string_tag_symbol(),
isolate->factory()->to_primitive_symbol())
.ToHandleChecked();
@@ -1623,7 +1635,7 @@ TEST(GotoIfExceptionMultiple) {
isolate->factory()->unscopables_symbol())
.ToHandleChecked();
- // Should be a TypeError
+ // Should be a TypeError.
CHECK(result->IsJSObject());
Handle<Object> constructor =
@@ -1638,7 +1650,8 @@ TEST(AllocateJSObjectFromMap) {
Factory* factory = isolate->factory();
const int kNumParams = 3;
- CodeStubAssemblerTester m(isolate, kNumParams);
+ CodeAssemblerTester data(isolate, kNumParams);
+ CodeStubAssembler m(data.state());
{
Node* map = m.Parameter(0);
@@ -1650,7 +1663,7 @@ TEST(AllocateJSObjectFromMap) {
m.Return(result);
}
- Handle<Code> code = m.GenerateCode();
+ Handle<Code> code = data.GenerateCode();
FunctionTester ft(code, kNumParams);
Handle<Map> maps[] = {
@@ -1701,7 +1714,8 @@ TEST(AllocateNameDictionary) {
Isolate* isolate(CcTest::InitIsolateOnce());
const int kNumParams = 1;
- CodeStubAssemblerTester m(isolate, kNumParams);
+ CodeAssemblerTester data(isolate, kNumParams);
+ CodeStubAssembler m(data.state());
{
Node* capacity = m.Parameter(0);
@@ -1709,7 +1723,7 @@ TEST(AllocateNameDictionary) {
m.Return(result);
}
- Handle<Code> code = m.GenerateCode();
+ Handle<Code> code = data.GenerateCode();
FunctionTester ft(code, kNumParams);
{
@@ -1729,16 +1743,17 @@ TEST(PopAndReturnConstant) {
Isolate* isolate(CcTest::InitIsolateOnce());
const int kNumParams = 4;
- const int kNumProgramaticParams = 2;
- CodeStubAssemblerTester m(isolate, kNumParams - kNumProgramaticParams);
+ const int kNumProgrammaticParams = 2;
+ CodeAssemblerTester data(isolate, kNumParams - kNumProgrammaticParams);
+ CodeStubAssembler m(data.state());
// Call a function that return |kNumProgramaticParams| parameters in addition
// to those specified by the static descriptor. |kNumProgramaticParams| is
// specified as a constant.
- m.PopAndReturn(m.Int32Constant(kNumProgramaticParams),
+ m.PopAndReturn(m.Int32Constant(kNumProgrammaticParams),
m.SmiConstant(Smi::FromInt(1234)));
- Handle<Code> code = m.GenerateCode();
+ Handle<Code> code = data.GenerateCode();
CHECK(!code.is_null());
FunctionTester ft(code, kNumParams);
@@ -1757,8 +1772,9 @@ TEST(PopAndReturnVariable) {
Isolate* isolate(CcTest::InitIsolateOnce());
const int kNumParams = 4;
- const int kNumProgramaticParams = 2;
- CodeStubAssemblerTester m(isolate, kNumParams - kNumProgramaticParams);
+ const int kNumProgrammaticParams = 2;
+ CodeAssemblerTester data(isolate, kNumParams - kNumProgrammaticParams);
+ CodeStubAssembler m(data.state());
// Call a function that return |kNumProgramaticParams| parameters in addition
// to those specified by the static descriptor. |kNumProgramaticParams| is
@@ -1766,7 +1782,7 @@ TEST(PopAndReturnVariable) {
// a constant.
m.PopAndReturn(m.SmiUntag(m.Parameter(1)), m.SmiConstant(Smi::FromInt(1234)));
- Handle<Code> code = m.GenerateCode();
+ Handle<Code> code = data.GenerateCode();
CHECK(!code.is_null());
FunctionTester ft(code, kNumParams);
@@ -1775,7 +1791,7 @@ TEST(PopAndReturnVariable) {
result = ft.Call(isolate->factory()->undefined_value(),
Handle<Smi>(Smi::FromInt(1234), isolate),
isolate->factory()->undefined_value(),
- Handle<Smi>(Smi::FromInt(kNumProgramaticParams), isolate))
+ Handle<Smi>(Smi::FromInt(kNumProgrammaticParams), isolate))
.ToHandleChecked();
CHECK_EQ(1234, Handle<Smi>::cast(result)->value());
}
@@ -1784,7 +1800,9 @@ TEST(PopAndReturnVariable) {
TEST(OneToTwoByteStringCopy) {
Isolate* isolate(CcTest::InitIsolateOnce());
- CodeStubAssemblerTester m(isolate, 2);
+ const int kNumParams = 2;
+ CodeAssemblerTester data(isolate, kNumParams);
+ CodeStubAssembler m(data.state());
m.CopyStringCharacters(
m.Parameter(0), m.Parameter(1), m.SmiConstant(Smi::FromInt(0)),
@@ -1793,7 +1811,7 @@ TEST(OneToTwoByteStringCopy) {
CodeStubAssembler::SMI_PARAMETERS);
m.Return(m.SmiConstant(Smi::FromInt(0)));
- Handle<Code> code = m.GenerateCode();
+ Handle<Code> code = data.GenerateCode();
CHECK(!code.is_null());
Handle<String> string1 = isolate->factory()->InternalizeUtf8String("abcde");
@@ -1818,7 +1836,9 @@ TEST(OneToTwoByteStringCopy) {
TEST(OneToOneByteStringCopy) {
Isolate* isolate(CcTest::InitIsolateOnce());
- CodeStubAssemblerTester m(isolate, 2);
+ const int kNumParams = 2;
+ CodeAssemblerTester data(isolate, kNumParams);
+ CodeStubAssembler m(data.state());
m.CopyStringCharacters(
m.Parameter(0), m.Parameter(1), m.SmiConstant(Smi::FromInt(0)),
@@ -1827,7 +1847,7 @@ TEST(OneToOneByteStringCopy) {
CodeStubAssembler::SMI_PARAMETERS);
m.Return(m.SmiConstant(Smi::FromInt(0)));
- Handle<Code> code = m.GenerateCode();
+ Handle<Code> code = data.GenerateCode();
CHECK(!code.is_null());
Handle<String> string1 = isolate->factory()->InternalizeUtf8String("abcde");
@@ -1852,7 +1872,9 @@ TEST(OneToOneByteStringCopy) {
TEST(OneToOneByteStringCopyNonZeroStart) {
Isolate* isolate(CcTest::InitIsolateOnce());
- CodeStubAssemblerTester m(isolate, 2);
+ const int kNumParams = 2;
+ CodeAssemblerTester data(isolate, kNumParams);
+ CodeStubAssembler m(data.state());
m.CopyStringCharacters(
m.Parameter(0), m.Parameter(1), m.SmiConstant(Smi::FromInt(0)),
@@ -1861,7 +1883,7 @@ TEST(OneToOneByteStringCopyNonZeroStart) {
CodeStubAssembler::SMI_PARAMETERS);
m.Return(m.SmiConstant(Smi::FromInt(0)));
- Handle<Code> code = m.GenerateCode();
+ Handle<Code> code = data.GenerateCode();
CHECK(!code.is_null());
Handle<String> string1 = isolate->factory()->InternalizeUtf8String("abcde");
@@ -1883,7 +1905,9 @@ TEST(OneToOneByteStringCopyNonZeroStart) {
TEST(TwoToTwoByteStringCopy) {
Isolate* isolate(CcTest::InitIsolateOnce());
- CodeStubAssemblerTester m(isolate, 2);
+ const int kNumParams = 2;
+ CodeAssemblerTester data(isolate, kNumParams);
+ CodeStubAssembler m(data.state());
m.CopyStringCharacters(
m.Parameter(0), m.Parameter(1), m.SmiConstant(Smi::FromInt(0)),
@@ -1892,7 +1916,7 @@ TEST(TwoToTwoByteStringCopy) {
CodeStubAssembler::SMI_PARAMETERS);
m.Return(m.SmiConstant(Smi::FromInt(0)));
- Handle<Code> code = m.GenerateCode();
+ Handle<Code> code = data.GenerateCode();
CHECK(!code.is_null());
uc16 array1[] = {2000, 2001, 2002, 2003, 2004};
@@ -1921,7 +1945,8 @@ TEST(Arguments) {
Isolate* isolate(CcTest::InitIsolateOnce());
const int kNumParams = 4;
- CodeStubAssemblerTester m(isolate, kNumParams);
+ CodeAssemblerTester data(isolate, kNumParams);
+ CodeStubAssembler m(data.state());
CodeStubArguments arguments(&m, m.IntPtrConstant(3));
@@ -1934,7 +1959,7 @@ TEST(Arguments) {
m.Return(arguments.GetReceiver());
- Handle<Code> code = m.GenerateCode();
+ Handle<Code> code = data.GenerateCode();
CHECK(!code.is_null());
FunctionTester ft(code, kNumParams);
@@ -1950,13 +1975,13 @@ TEST(ArgumentsForEach) {
Isolate* isolate(CcTest::InitIsolateOnce());
const int kNumParams = 4;
- CodeStubAssemblerTester m(isolate, kNumParams);
+ CodeAssemblerTester data(isolate, kNumParams);
+ CodeStubAssembler m(data.state());
CodeStubArguments arguments(&m, m.IntPtrConstant(3));
- CodeStubAssemblerTester::Variable sum(&m,
- MachineType::PointerRepresentation());
- CodeStubAssemblerTester::VariableList list({&sum}, m.zone());
+ CodeStubAssembler::Variable sum(&m, MachineType::PointerRepresentation());
+ CodeStubAssembler::VariableList list({&sum}, m.zone());
sum.Bind(m.IntPtrConstant(0));
@@ -1966,7 +1991,7 @@ TEST(ArgumentsForEach) {
m.Return(sum.value());
- Handle<Code> code = m.GenerateCode();
+ Handle<Code> code = data.GenerateCode();
CHECK(!code.is_null());
FunctionTester ft(code, kNumParams);
« no previous file with comments | « test/cctest/compiler/test-code-assembler.cc ('k') | test/unittests/interpreter/interpreter-assembler-unittest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698