Commit 0da1a0c0 authored by jochen's avatar jochen Committed by Commit bot

Remove v8::i::Isolate::Current from cctests

BUG=2487
R=yangguo@chromium.org
LOG=n

Review URL: https://codereview.chromium.org/1468943002

Cr-Commit-Position: refs/heads/master@{#32176}
parent 6fb0f563
......@@ -118,7 +118,7 @@ static void InitializeVM() {
// Run tests with the simulator.
#define SETUP_SIZE(buf_size) \
Isolate* isolate = Isolate::Current(); \
Isolate* isolate = CcTest::i_isolate(); \
HandleScope scope(isolate); \
DCHECK(isolate != NULL); \
byte* buf = new byte[buf_size]; \
......@@ -171,12 +171,12 @@ static void InitializeVM() {
#else // ifdef USE_SIMULATOR.
// Run the test on real hardware or models.
#define SETUP_SIZE(buf_size) \
Isolate* isolate = Isolate::Current(); \
HandleScope scope(isolate); \
DCHECK(isolate != NULL); \
byte* buf = new byte[buf_size]; \
MacroAssembler masm(isolate, buf, buf_size); \
#define SETUP_SIZE(buf_size) \
Isolate* isolate = CcTest::i_isolate(); \
HandleScope scope(isolate); \
DCHECK(isolate != NULL); \
byte* buf = new byte[buf_size]; \
MacroAssembler masm(isolate, buf, buf_size); \
RegisterDump core;
#define RESET() \
......
......@@ -51,7 +51,7 @@ typedef Object* (*F4)(void* p0, void* p1, int p2, int p3, int p4);
// Simple add parameter 1 to parameter 2 and return
TEST(0) {
CcTest::InitializeVM();
Isolate* isolate = Isolate::Current();
Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate);
Assembler assm(isolate, NULL, 0);
......@@ -79,7 +79,7 @@ TEST(0) {
// Loop 100 times, adding loop counter to result
TEST(1) {
CcTest::InitializeVM();
Isolate* isolate = Isolate::Current();
Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate);
Assembler assm(isolate, NULL, 0);
......@@ -117,7 +117,7 @@ TEST(1) {
TEST(2) {
CcTest::InitializeVM();
Isolate* isolate = Isolate::Current();
Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate);
Assembler assm(isolate, NULL, 0);
......@@ -168,7 +168,7 @@ TEST(2) {
TEST(3) {
CcTest::InitializeVM();
Isolate* isolate = Isolate::Current();
Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate);
typedef struct {
......@@ -178,7 +178,7 @@ TEST(3) {
} T;
T t;
Assembler assm(Isolate::Current(), NULL, 0);
Assembler assm(CcTest::i_isolate(), NULL, 0);
Label L, C;
__ function_descriptor();
......@@ -248,7 +248,7 @@ TEST(3) {
TEST(4) {
// Test the VFP floating point instructions.
CcTest::InitializeVM();
Isolate* isolate = Isolate::Current();
Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate);
typedef struct {
......@@ -270,7 +270,7 @@ TEST(4) {
// Create a function that accepts &t, and loads, manipulates, and stores
// the doubles and floats.
Assembler assm(Isolate::Current(), NULL, 0);
Assembler assm(CcTest::i_isolate(), NULL, 0);
Label L, C;
if (CpuFeatures::IsSupported(VFP3)) {
......@@ -383,7 +383,7 @@ TEST(4) {
TEST(5) {
// Test the ARMv7 bitfield instructions.
CcTest::InitializeVM();
Isolate* isolate = Isolate::Current();
Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate);
Assembler assm(isolate, NULL, 0);
......@@ -420,7 +420,7 @@ TEST(5) {
TEST(6) {
// Test saturating instructions.
CcTest::InitializeVM();
Isolate* isolate = Isolate::Current();
Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate);
Assembler assm(isolate, NULL, 0);
......@@ -463,7 +463,7 @@ static void TestRoundingMode(VCVTTypes types,
int expected,
bool expected_exception = false) {
CcTest::InitializeVM();
Isolate* isolate = Isolate::Current();
Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate);
Assembler assm(isolate, NULL, 0);
......@@ -642,7 +642,7 @@ TEST(7) {
TEST(8) {
// Test VFP multi load/store with ia_w.
CcTest::InitializeVM();
Isolate* isolate = Isolate::Current();
Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate);
typedef struct {
......@@ -754,7 +754,7 @@ TEST(8) {
TEST(9) {
// Test VFP multi load/store with ia.
CcTest::InitializeVM();
Isolate* isolate = Isolate::Current();
Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate);
typedef struct {
......@@ -870,7 +870,7 @@ TEST(9) {
TEST(10) {
// Test VFP multi load/store with db_w.
CcTest::InitializeVM();
Isolate* isolate = Isolate::Current();
Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate);
typedef struct {
......@@ -982,7 +982,7 @@ TEST(10) {
TEST(11) {
// Test instructions using the carry flag.
CcTest::InitializeVM();
Isolate* isolate = Isolate::Current();
Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate);
typedef struct {
......@@ -1048,7 +1048,7 @@ TEST(11) {
TEST(12) {
// Test chaining of label usages within instructions (issue 1644).
CcTest::InitializeVM();
Isolate* isolate = Isolate::Current();
Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate);
Assembler assm(isolate, NULL, 0);
......
......@@ -149,7 +149,7 @@ int32_t RunGeneratedCodeCallWrapper(ConvertDToIFunc func,
Simulator::CallArgument(from),
Simulator::CallArgument::End()
};
return static_cast<int32_t>(Simulator::current(Isolate::Current())
return static_cast<int32_t>(Simulator::current(CcTest::i_isolate())
->CallInt64(FUNCTION_ADDR(func), args));
#else
return (*func)(from);
......
......@@ -159,8 +159,9 @@ static Isolate* GetIsolateFrom(LocalContext* context) {
int32_t RunGeneratedCodeCallWrapper(ConvertDToIFunc func,
double from) {
#ifdef USE_SIMULATOR
Simulator::current(Isolate::Current())->CallFP(FUNCTION_ADDR(func), from, 0.);
return Simulator::current(Isolate::Current())->get_register(v0.code());
Simulator::current(CcTest::i_isolate())
->CallFP(FUNCTION_ADDR(func), from, 0.);
return Simulator::current(CcTest::i_isolate())->get_register(v0.code());
#else
return (*func)(from);
#endif
......
......@@ -157,9 +157,10 @@ static Isolate* GetIsolateFrom(LocalContext* context) {
int32_t RunGeneratedCodeCallWrapper(ConvertDToIFunc func,
double from) {
#ifdef USE_SIMULATOR
Simulator::current(Isolate::Current())->CallFP(FUNCTION_ADDR(func), from, 0.);
Simulator::current(CcTest::i_isolate())
->CallFP(FUNCTION_ADDR(func), from, 0.);
return static_cast<int32_t>(
Simulator::current(Isolate::Current())->get_register(v0.code()));
Simulator::current(CcTest::i_isolate())->get_register(v0.code()));
#else
return (*func)(from);
#endif
......
......@@ -50,7 +50,7 @@ using namespace v8::internal;
#define INSTR_SIZE (1024)
#define SET_UP_CLASS(ASMCLASS) \
InitializeVM(); \
Isolate* isolate = Isolate::Current(); \
Isolate* isolate = CcTest::i_isolate(); \
HandleScope scope(isolate); \
byte* buf = static_cast<byte*>(malloc(INSTR_SIZE)); \
uint32_t encoding = 0; \
......
......@@ -67,7 +67,7 @@ bool DisassembleAndCompare(byte* pc, const char* compare_string) {
// in the rest of the macros.
#define SET_UP() \
CcTest::InitializeVM(); \
Isolate* isolate = Isolate::Current(); \
Isolate* isolate = CcTest::i_isolate(); \
HandleScope scope(isolate); \
byte* buffer = reinterpret_cast<byte*>(malloc(4 * 1024)); \
Assembler assm(isolate, buffer, 4 * 1024); \
......
......@@ -69,8 +69,7 @@ class KangarooThread : public v8::base::Thread {
{
v8::Locker locker(isolate_);
v8::Isolate::Scope isolate_scope(isolate_);
CHECK_EQ(reinterpret_cast<v8::internal::Isolate*>(isolate_),
v8::internal::Isolate::Current());
CHECK_EQ(isolate_, v8::Isolate::GetCurrent());
v8::HandleScope scope(isolate_);
v8::Local<v8::Context> context =
v8::Local<v8::Context>::New(isolate_, context_);
......@@ -111,8 +110,7 @@ TEST(KangarooIsolates) {
v8::HandleScope handle_scope(isolate);
v8::Local<v8::Context> context = v8::Context::New(isolate);
v8::Context::Scope context_scope(context);
CHECK_EQ(reinterpret_cast<v8::internal::Isolate*>(isolate),
v8::internal::Isolate::Current());
CHECK_EQ(isolate, v8::Isolate::GetCurrent());
CompileRun("function getValue() { return 30; }");
thread1.Reset(new KangarooThread(isolate, context));
}
......@@ -190,8 +188,7 @@ class IsolateLockingThreadWithLocalContext : public JoinableThread {
v8::Isolate::Scope isolate_scope(isolate_);
v8::HandleScope handle_scope(isolate_);
LocalContext local_context(isolate_);
CHECK_EQ(reinterpret_cast<v8::internal::Isolate*>(isolate_),
v8::internal::Isolate::Current());
CHECK_EQ(isolate_, v8::Isolate::GetCurrent());
CalcFibAndCheck(local_context.local());
}
private:
......@@ -688,11 +685,12 @@ class IsolateGenesisThread : public JoinableThread {
v8::Isolate* isolate = v8::Isolate::New(create_params);
{
v8::Isolate::Scope isolate_scope(isolate);
CHECK(!i::Isolate::Current()->has_installed_extensions());
CHECK(
!reinterpret_cast<i::Isolate*>(isolate)->has_installed_extensions());
v8::ExtensionConfiguration extensions(count_, extension_names_);
v8::HandleScope handle_scope(isolate);
v8::Context::New(isolate, &extensions);
CHECK(i::Isolate::Current()->has_installed_extensions());
CHECK(reinterpret_cast<i::Isolate*>(isolate)->has_installed_extensions());
}
isolate->Dispose();
}
......
......@@ -64,7 +64,7 @@ static bool all_zeroes(const byte* beg, const byte* end) {
TEST(CopyBytes) {
CcTest::InitializeVM();
Isolate* isolate = Isolate::Current();
Isolate* isolate = CcTest::i_isolate();
HandleScope handles(isolate);
const int data_size = 1 * KB;
......
......@@ -65,7 +65,7 @@ static bool all_zeroes(const byte* beg, const byte* end) {
TEST(CopyBytes) {
CcTest::InitializeVM();
Isolate* isolate = Isolate::Current();
Isolate* isolate = CcTest::i_isolate();
HandleScope handles(isolate);
const int data_size = 1 * KB;
......
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