summaryrefslogtreecommitdiff
path: root/deps/v8/test/cctest/test-assembler-ia32.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/test/cctest/test-assembler-ia32.cc')
-rw-r--r--deps/v8/test/cctest/test-assembler-ia32.cc85
1 files changed, 42 insertions, 43 deletions
diff --git a/deps/v8/test/cctest/test-assembler-ia32.cc b/deps/v8/test/cctest/test-assembler-ia32.cc
index 14692ff1e..e9d799b54 100644
--- a/deps/v8/test/cctest/test-assembler-ia32.cc
+++ b/deps/v8/test/cctest/test-assembler-ia32.cc
@@ -61,7 +61,7 @@ TEST(AssemblerIa320) {
v8::HandleScope scope;
v8::internal::byte buffer[256];
- Assembler assm(buffer, sizeof buffer);
+ Assembler assm(Isolate::Current(), buffer, sizeof buffer);
__ mov(eax, Operand(esp, 4));
__ add(eax, Operand(esp, 8));
@@ -69,10 +69,10 @@ TEST(AssemblerIa320) {
CodeDesc desc;
assm.GetCode(&desc);
- Object* code = Heap::CreateCode(desc,
- Code::ComputeFlags(Code::STUB),
- Handle<Object>(Heap::undefined_value()))->
- ToObjectChecked();
+ Object* code = HEAP->CreateCode(
+ desc,
+ Code::ComputeFlags(Code::STUB),
+ Handle<Object>(HEAP->undefined_value()))->ToObjectChecked();
CHECK(code->IsCode());
#ifdef OBJECT_PRINT
Code::cast(code)->Print();
@@ -89,7 +89,7 @@ TEST(AssemblerIa321) {
v8::HandleScope scope;
v8::internal::byte buffer[256];
- Assembler assm(buffer, sizeof buffer);
+ Assembler assm(Isolate::Current(), buffer, sizeof buffer);
Label L, C;
__ mov(edx, Operand(esp, 4));
@@ -102,15 +102,15 @@ TEST(AssemblerIa321) {
__ bind(&C);
__ test(edx, Operand(edx));
- __ j(not_zero, &L, taken);
+ __ j(not_zero, &L);
__ ret(0);
CodeDesc desc;
assm.GetCode(&desc);
- Object* code = Heap::CreateCode(desc,
- Code::ComputeFlags(Code::STUB),
- Handle<Object>(Heap::undefined_value()))->
- ToObjectChecked();
+ Object* code = HEAP->CreateCode(
+ desc,
+ Code::ComputeFlags(Code::STUB),
+ Handle<Object>(HEAP->undefined_value()))->ToObjectChecked();
CHECK(code->IsCode());
#ifdef OBJECT_PRINT
Code::cast(code)->Print();
@@ -127,7 +127,7 @@ TEST(AssemblerIa322) {
v8::HandleScope scope;
v8::internal::byte buffer[256];
- Assembler assm(buffer, sizeof buffer);
+ Assembler assm(Isolate::Current(), buffer, sizeof buffer);
Label L, C;
__ mov(edx, Operand(esp, 4));
@@ -140,20 +140,19 @@ TEST(AssemblerIa322) {
__ bind(&C);
__ test(edx, Operand(edx));
- __ j(not_zero, &L, taken);
+ __ j(not_zero, &L);
__ ret(0);
// some relocated stuff here, not executed
- __ mov(eax, Factory::true_value());
+ __ mov(eax, FACTORY->true_value());
__ jmp(NULL, RelocInfo::RUNTIME_ENTRY);
CodeDesc desc;
assm.GetCode(&desc);
- Object* code = Heap::CreateCode(
+ Object* code = HEAP->CreateCode(
desc,
Code::ComputeFlags(Code::STUB),
- Handle<Object>(Heap::undefined_value()))->ToObjectChecked();
-
+ Handle<Object>(HEAP->undefined_value()))->ToObjectChecked();
CHECK(code->IsCode());
#ifdef OBJECT_PRINT
Code::cast(code)->Print();
@@ -168,13 +167,13 @@ TEST(AssemblerIa322) {
typedef int (*F3)(float x);
TEST(AssemblerIa323) {
+ InitializeVM();
if (!CpuFeatures::IsSupported(SSE2)) return;
- InitializeVM();
v8::HandleScope scope;
v8::internal::byte buffer[256];
- Assembler assm(buffer, sizeof buffer);
+ Assembler assm(Isolate::Current(), buffer, sizeof buffer);
CHECK(CpuFeatures::IsSupported(SSE2));
{ CpuFeatures::Scope fscope(SSE2);
@@ -184,10 +183,10 @@ TEST(AssemblerIa323) {
CodeDesc desc;
assm.GetCode(&desc);
- Code* code = Code::cast(Heap::CreateCode(
+ Code* code = Code::cast(HEAP->CreateCode(
desc,
Code::ComputeFlags(Code::STUB),
- Handle<Object>(Heap::undefined_value()))->ToObjectChecked());
+ Handle<Object>(HEAP->undefined_value()))->ToObjectChecked());
// don't print the code - our disassembler can't handle cvttss2si
// instead print bytes
Disassembler::Dump(stdout,
@@ -203,13 +202,13 @@ TEST(AssemblerIa323) {
typedef int (*F4)(double x);
TEST(AssemblerIa324) {
+ InitializeVM();
if (!CpuFeatures::IsSupported(SSE2)) return;
- InitializeVM();
v8::HandleScope scope;
v8::internal::byte buffer[256];
- Assembler assm(buffer, sizeof buffer);
+ Assembler assm(Isolate::Current(), buffer, sizeof buffer);
CHECK(CpuFeatures::IsSupported(SSE2));
CpuFeatures::Scope fscope(SSE2);
@@ -218,10 +217,10 @@ TEST(AssemblerIa324) {
CodeDesc desc;
assm.GetCode(&desc);
- Code* code = Code::cast(Heap::CreateCode(
+ Code* code = Code::cast(HEAP->CreateCode(
desc,
Code::ComputeFlags(Code::STUB),
- Handle<Object>(Heap::undefined_value()))->ToObjectChecked());
+ Handle<Object>(HEAP->undefined_value()))->ToObjectChecked());
// don't print the code - our disassembler can't handle cvttsd2si
// instead print bytes
Disassembler::Dump(stdout,
@@ -240,17 +239,17 @@ TEST(AssemblerIa325) {
v8::HandleScope scope;
v8::internal::byte buffer[256];
- Assembler assm(buffer, sizeof buffer);
+ Assembler assm(Isolate::Current(), buffer, sizeof buffer);
__ mov(eax, Operand(reinterpret_cast<intptr_t>(&baz), RelocInfo::NONE));
__ ret(0);
CodeDesc desc;
assm.GetCode(&desc);
- Code* code = Code::cast(Heap::CreateCode(
+ Code* code = Code::cast(HEAP->CreateCode(
desc,
Code::ComputeFlags(Code::STUB),
- Handle<Object>(Heap::undefined_value()))->ToObjectChecked());
+ Handle<Object>(HEAP->undefined_value()))->ToObjectChecked());
F0 f = FUNCTION_CAST<F0>(code->entry());
int res = f();
CHECK_EQ(42, res);
@@ -260,14 +259,14 @@ TEST(AssemblerIa325) {
typedef double (*F5)(double x, double y);
TEST(AssemblerIa326) {
+ InitializeVM();
if (!CpuFeatures::IsSupported(SSE2)) return;
- InitializeVM();
v8::HandleScope scope;
CHECK(CpuFeatures::IsSupported(SSE2));
CpuFeatures::Scope fscope(SSE2);
v8::internal::byte buffer[256];
- Assembler assm(buffer, sizeof buffer);
+ Assembler assm(Isolate::Current(), buffer, sizeof buffer);
__ movdbl(xmm0, Operand(esp, 1 * kPointerSize));
__ movdbl(xmm1, Operand(esp, 3 * kPointerSize));
@@ -284,10 +283,10 @@ TEST(AssemblerIa326) {
CodeDesc desc;
assm.GetCode(&desc);
- Code* code = Code::cast(Heap::CreateCode(
+ Code* code = Code::cast(HEAP->CreateCode(
desc,
Code::ComputeFlags(Code::STUB),
- Handle<Object>(Heap::undefined_value()))->ToObjectChecked());
+ Handle<Object>(HEAP->undefined_value()))->ToObjectChecked());
#ifdef DEBUG
::printf("\n---\n");
// don't print the code - our disassembler can't handle SSE instructions
@@ -306,14 +305,14 @@ TEST(AssemblerIa326) {
typedef double (*F6)(int x);
TEST(AssemblerIa328) {
+ InitializeVM();
if (!CpuFeatures::IsSupported(SSE2)) return;
- InitializeVM();
v8::HandleScope scope;
CHECK(CpuFeatures::IsSupported(SSE2));
CpuFeatures::Scope fscope(SSE2);
v8::internal::byte buffer[256];
- Assembler assm(buffer, sizeof buffer);
+ Assembler assm(Isolate::Current(), buffer, sizeof buffer);
__ mov(eax, Operand(esp, 4));
__ cvtsi2sd(xmm0, Operand(eax));
// Copy xmm0 to st(0) using eight bytes of stack.
@@ -324,10 +323,10 @@ TEST(AssemblerIa328) {
__ ret(0);
CodeDesc desc;
assm.GetCode(&desc);
- Code* code = Code::cast(Heap::CreateCode(
+ Code* code = Code::cast(HEAP->CreateCode(
desc,
Code::ComputeFlags(Code::STUB),
- Handle<Object>(Heap::undefined_value()))->ToObjectChecked());
+ Handle<Object>(HEAP->undefined_value()))->ToObjectChecked());
CHECK(code->IsCode());
#ifdef OBJECT_PRINT
Code::cast(code)->Print();
@@ -346,16 +345,16 @@ TEST(AssemblerIa329) {
InitializeVM();
v8::HandleScope scope;
v8::internal::byte buffer[256];
- MacroAssembler assm(buffer, sizeof buffer);
+ MacroAssembler assm(Isolate::Current(), buffer, sizeof buffer);
enum { kEqual = 0, kGreater = 1, kLess = 2, kNaN = 3, kUndefined = 4 };
Label equal_l, less_l, greater_l, nan_l;
__ fld_d(Operand(esp, 3 * kPointerSize));
__ fld_d(Operand(esp, 1 * kPointerSize));
__ FCmp();
- __ j(parity_even, &nan_l, taken);
- __ j(equal, &equal_l, taken);
- __ j(below, &less_l, taken);
- __ j(above, &greater_l, taken);
+ __ j(parity_even, &nan_l);
+ __ j(equal, &equal_l);
+ __ j(below, &less_l);
+ __ j(above, &greater_l);
__ mov(eax, kUndefined);
__ ret(0);
@@ -379,10 +378,10 @@ TEST(AssemblerIa329) {
CodeDesc desc;
assm.GetCode(&desc);
- Code* code = Code::cast(Heap::CreateCode(
+ Code* code = Code::cast(HEAP->CreateCode(
desc,
Code::ComputeFlags(Code::STUB),
- Handle<Object>(Heap::undefined_value()))->ToObjectChecked());
+ Handle<Object>(HEAP->undefined_value()))->ToObjectChecked());
CHECK(code->IsCode());
#ifdef OBJECT_PRINT
Code::cast(code)->Print();