Remove usage of deprecated APIs from assembler tests
BUG=4134 R=epertoso@chromium.org LOG=n Review URL: https://codereview.chromium.org/1460193002 Cr-Commit-Position: refs/heads/master@{#32137}
This commit is contained in:
parent
8cfa73ac38
commit
6e13300c19
@ -25,6 +25,9 @@
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
// TODO(jochen): Remove this after the setting is turned on globally.
|
||||
#define V8_IMMINENT_DEPRECATION_WARNINGS
|
||||
|
||||
#include <iostream> // NOLINT(readability/streams)
|
||||
|
||||
#include "src/v8.h"
|
||||
|
@ -25,6 +25,9 @@
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
// TODO(jochen): Remove this after the setting is turned on globally.
|
||||
#define V8_IMMINENT_DEPRECATION_WARNINGS
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
@ -25,6 +25,9 @@
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
// TODO(jochen): Remove this after the setting is turned on globally.
|
||||
#define V8_IMMINENT_DEPRECATION_WARNINGS
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "src/v8.h"
|
||||
@ -443,6 +446,7 @@ TEST(AssemblerMultiByteNop) {
|
||||
void DoSSE2(const v8::FunctionCallbackInfo<v8::Value>& args) {
|
||||
Isolate* isolate = reinterpret_cast<Isolate*>(CcTest::isolate());
|
||||
HandleScope scope(isolate);
|
||||
v8::Local<v8::Context> context = CcTest::isolate()->GetCurrentContext();
|
||||
|
||||
CHECK(args[0]->IsArray());
|
||||
v8::Local<v8::Array> vec = v8::Local<v8::Array>::Cast(args[0]);
|
||||
@ -456,7 +460,8 @@ void DoSSE2(const v8::FunctionCallbackInfo<v8::Value>& args) {
|
||||
|
||||
// Store input vector on the stack.
|
||||
for (unsigned i = 0; i < ELEMENT_COUNT; ++i) {
|
||||
__ push(Immediate(vec->Get(i)->Int32Value()));
|
||||
__ push(Immediate(
|
||||
vec->Get(context, i).ToLocalChecked()->Int32Value(context).FromJust()));
|
||||
}
|
||||
|
||||
// Read vector into a xmm register.
|
||||
@ -490,7 +495,7 @@ TEST(StackAlignmentForSSE2) {
|
||||
|
||||
v8::Isolate* isolate = CcTest::isolate();
|
||||
v8::HandleScope handle_scope(isolate);
|
||||
v8::Handle<v8::ObjectTemplate> global_template =
|
||||
v8::Local<v8::ObjectTemplate> global_template =
|
||||
v8::ObjectTemplate::New(isolate);
|
||||
global_template->Set(v8_str("do_sse2"),
|
||||
v8::FunctionTemplate::New(isolate, DoSSE2));
|
||||
@ -502,20 +507,21 @@ TEST(StackAlignmentForSSE2) {
|
||||
"}");
|
||||
|
||||
v8::Local<v8::Object> global_object = env->Global();
|
||||
v8::Local<v8::Function> foo =
|
||||
v8::Local<v8::Function>::Cast(global_object->Get(v8_str("foo")));
|
||||
v8::Local<v8::Function> foo = v8::Local<v8::Function>::Cast(
|
||||
global_object->Get(env.local(), v8_str("foo")).ToLocalChecked());
|
||||
|
||||
int32_t vec[ELEMENT_COUNT] = { -1, 1, 1, 1 };
|
||||
v8::Local<v8::Array> v8_vec = v8::Array::New(isolate, ELEMENT_COUNT);
|
||||
for (unsigned i = 0; i < ELEMENT_COUNT; i++) {
|
||||
v8_vec->Set(i, v8_num(vec[i]));
|
||||
v8_vec->Set(env.local(), i, v8_num(vec[i])).FromJust();
|
||||
}
|
||||
|
||||
v8::Local<v8::Value> args[] = { v8_vec };
|
||||
v8::Local<v8::Value> result = foo->Call(global_object, 1, args);
|
||||
v8::Local<v8::Value> result =
|
||||
foo->Call(env.local(), global_object, 1, args).ToLocalChecked();
|
||||
|
||||
// The mask should be 0b1000.
|
||||
CHECK_EQ(8, result->Int32Value());
|
||||
CHECK_EQ(8, result->Int32Value(env.local()).FromJust());
|
||||
}
|
||||
|
||||
#undef ELEMENT_COUNT
|
||||
|
@ -25,6 +25,9 @@
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
// TODO(jochen): Remove this after the setting is turned on globally.
|
||||
#define V8_IMMINENT_DEPRECATION_WARNINGS
|
||||
|
||||
#include <iostream> // NOLINT(readability/streams)
|
||||
|
||||
#include "src/v8.h"
|
||||
|
@ -25,6 +25,9 @@
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
// TODO(jochen): Remove this after the setting is turned on globally.
|
||||
#define V8_IMMINENT_DEPRECATION_WARNINGS
|
||||
|
||||
#include <iostream> // NOLINT(readability/streams)
|
||||
|
||||
#include "src/v8.h"
|
||||
|
@ -25,6 +25,9 @@
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
// TODO(jochen): Remove this after the setting is turned on globally.
|
||||
#define V8_IMMINENT_DEPRECATION_WARNINGS
|
||||
|
||||
#include "src/v8.h"
|
||||
|
||||
#include "src/disassembler.h"
|
||||
|
@ -25,6 +25,9 @@
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
// TODO(jochen): Remove this after the setting is turned on globally.
|
||||
#define V8_IMMINENT_DEPRECATION_WARNINGS
|
||||
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
|
||||
@ -591,6 +594,7 @@ TEST(AssemblerMultiByteNop) {
|
||||
|
||||
void DoSSE2(const v8::FunctionCallbackInfo<v8::Value>& args) {
|
||||
v8::HandleScope scope(CcTest::isolate());
|
||||
v8::Local<v8::Context> context = CcTest::isolate()->GetCurrentContext();
|
||||
byte buffer[1024];
|
||||
|
||||
CHECK(args[0]->IsArray());
|
||||
@ -605,9 +609,15 @@ void DoSSE2(const v8::FunctionCallbackInfo<v8::Value>& args) {
|
||||
|
||||
// Store input vector on the stack.
|
||||
for (unsigned i = 0; i < ELEMENT_COUNT; i++) {
|
||||
__ movl(rax, Immediate(vec->Get(i)->Int32Value()));
|
||||
__ movl(rax, Immediate(vec->Get(context, i)
|
||||
.ToLocalChecked()
|
||||
->Int32Value(context)
|
||||
.FromJust()));
|
||||
__ shlq(rax, Immediate(0x20));
|
||||
__ orq(rax, Immediate(vec->Get(++i)->Int32Value()));
|
||||
__ orq(rax, Immediate(vec->Get(context, ++i)
|
||||
.ToLocalChecked()
|
||||
->Int32Value(context)
|
||||
.FromJust()));
|
||||
__ pushq(rax);
|
||||
}
|
||||
|
||||
@ -641,7 +651,7 @@ TEST(StackAlignmentForSSE2) {
|
||||
|
||||
v8::Isolate* isolate = CcTest::isolate();
|
||||
v8::HandleScope handle_scope(isolate);
|
||||
v8::Handle<v8::ObjectTemplate> global_template =
|
||||
v8::Local<v8::ObjectTemplate> global_template =
|
||||
v8::ObjectTemplate::New(isolate);
|
||||
global_template->Set(v8_str("do_sse2"),
|
||||
v8::FunctionTemplate::New(isolate, DoSSE2));
|
||||
@ -653,20 +663,21 @@ TEST(StackAlignmentForSSE2) {
|
||||
"}");
|
||||
|
||||
v8::Local<v8::Object> global_object = env->Global();
|
||||
v8::Local<v8::Function> foo =
|
||||
v8::Local<v8::Function>::Cast(global_object->Get(v8_str("foo")));
|
||||
v8::Local<v8::Function> foo = v8::Local<v8::Function>::Cast(
|
||||
global_object->Get(env.local(), v8_str("foo")).ToLocalChecked());
|
||||
|
||||
int32_t vec[ELEMENT_COUNT] = { -1, 1, 1, 1 };
|
||||
v8::Local<v8::Array> v8_vec = v8::Array::New(isolate, ELEMENT_COUNT);
|
||||
for (unsigned i = 0; i < ELEMENT_COUNT; i++) {
|
||||
v8_vec->Set(i, v8_num(vec[i]));
|
||||
v8_vec->Set(env.local(), i, v8_num(vec[i])).FromJust();
|
||||
}
|
||||
|
||||
v8::Local<v8::Value> args[] = { v8_vec };
|
||||
v8::Local<v8::Value> result = foo->Call(global_object, 1, args);
|
||||
v8::Local<v8::Value> result =
|
||||
foo->Call(env.local(), global_object, 1, args).ToLocalChecked();
|
||||
|
||||
// The mask should be 0b1000.
|
||||
CHECK_EQ(8, result->Int32Value());
|
||||
CHECK_EQ(8, result->Int32Value(env.local()).FromJust());
|
||||
}
|
||||
|
||||
#undef ELEMENT_COUNT
|
||||
|
Loading…
Reference in New Issue
Block a user