Extend GCMole to also cover cctest files.

R=rossberg@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20841 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 107a3590
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
'include_dirs': [ 'include_dirs': [
'../../src', '../../src',
], ],
'sources': [ 'sources': [ ### gcmole(all) ###
'<(generated_file)', '<(generated_file)',
'cctest.cc', 'cctest.cc',
'gay-fixed.cc', 'gay-fixed.cc',
...@@ -125,7 +125,7 @@ ...@@ -125,7 +125,7 @@
], ],
'conditions': [ 'conditions': [
['v8_target_arch=="ia32"', { ['v8_target_arch=="ia32"', {
'sources': [ 'sources': [ ### gcmole(arch:ia32) ###
'test-assembler-ia32.cc', 'test-assembler-ia32.cc',
'test-code-stubs.cc', 'test-code-stubs.cc',
'test-code-stubs-ia32.cc', 'test-code-stubs-ia32.cc',
...@@ -136,7 +136,7 @@ ...@@ -136,7 +136,7 @@
], ],
}], }],
['v8_target_arch=="x64"', { ['v8_target_arch=="x64"', {
'sources': [ 'sources': [ ### gcmole(arch:x64) ###
'test-assembler-x64.cc', 'test-assembler-x64.cc',
'test-code-stubs.cc', 'test-code-stubs.cc',
'test-code-stubs-x64.cc', 'test-code-stubs-x64.cc',
...@@ -147,7 +147,7 @@ ...@@ -147,7 +147,7 @@
], ],
}], }],
['v8_target_arch=="arm"', { ['v8_target_arch=="arm"', {
'sources': [ 'sources': [ ### gcmole(arch:arm) ###
'test-assembler-arm.cc', 'test-assembler-arm.cc',
'test-code-stubs.cc', 'test-code-stubs.cc',
'test-code-stubs-arm.cc', 'test-code-stubs-arm.cc',
...@@ -156,7 +156,7 @@ ...@@ -156,7 +156,7 @@
], ],
}], }],
['v8_target_arch=="arm64"', { ['v8_target_arch=="arm64"', {
'sources': [ 'sources': [ ### gcmole(arch:arm64) ###
'test-utils-arm64.cc', 'test-utils-arm64.cc',
'test-assembler-arm64.cc', 'test-assembler-arm64.cc',
'test-code-stubs.cc', 'test-code-stubs.cc',
...@@ -168,7 +168,7 @@ ...@@ -168,7 +168,7 @@
], ],
}], }],
['v8_target_arch=="mipsel"', { ['v8_target_arch=="mipsel"', {
'sources': [ 'sources': [ ### gcmole(arch:mipsel) ###
'test-assembler-mips.cc', 'test-assembler-mips.cc',
'test-code-stubs.cc', 'test-code-stubs.cc',
'test-code-stubs-mips.cc', 'test-code-stubs-mips.cc',
......
...@@ -756,6 +756,7 @@ TEST(JSArray) { ...@@ -756,6 +756,7 @@ TEST(JSArray) {
Handle<JSFunction> function = Handle<JSFunction>::cast(fun_obj); Handle<JSFunction> function = Handle<JSFunction>::cast(fun_obj);
// Allocate the object. // Allocate the object.
Handle<Object> element;
Handle<JSObject> object = factory->NewJSObject(function); Handle<JSObject> object = factory->NewJSObject(function);
Handle<JSArray> array = Handle<JSArray>::cast(object); Handle<JSArray> array = Handle<JSArray>::cast(object);
// We just initialized the VM, no heap allocation failure yet. // We just initialized the VM, no heap allocation failure yet.
...@@ -770,7 +771,8 @@ TEST(JSArray) { ...@@ -770,7 +771,8 @@ TEST(JSArray) {
// array[length] = name. // array[length] = name.
JSReceiver::SetElement(array, 0, name, NONE, SLOPPY).Check(); JSReceiver::SetElement(array, 0, name, NONE, SLOPPY).Check();
CHECK_EQ(Smi::FromInt(1), array->length()); CHECK_EQ(Smi::FromInt(1), array->length());
CHECK_EQ(*i::Object::GetElement(isolate, array, 0).ToHandleChecked(), *name); element = i::Object::GetElement(isolate, array, 0).ToHandleChecked();
CHECK_EQ(*element, *name);
// Set array length with larger than smi value. // Set array length with larger than smi value.
Handle<Object> length = Handle<Object> length =
...@@ -787,9 +789,10 @@ TEST(JSArray) { ...@@ -787,9 +789,10 @@ TEST(JSArray) {
uint32_t new_int_length = 0; uint32_t new_int_length = 0;
CHECK(array->length()->ToArrayIndex(&new_int_length)); CHECK(array->length()->ToArrayIndex(&new_int_length));
CHECK_EQ(static_cast<double>(int_length), new_int_length - 1); CHECK_EQ(static_cast<double>(int_length), new_int_length - 1);
CHECK_EQ(*i::Object::GetElement(isolate, array, int_length).ToHandleChecked(), element = Object::GetElement(isolate, array, int_length).ToHandleChecked();
*name); CHECK_EQ(*element, *name);
CHECK_EQ(*i::Object::GetElement(isolate, array, 0).ToHandleChecked(), *name); element = Object::GetElement(isolate, array, 0).ToHandleChecked();
CHECK_EQ(*element, *name);
} }
...@@ -817,18 +820,23 @@ TEST(JSObjectCopy) { ...@@ -817,18 +820,23 @@ TEST(JSObjectCopy) {
JSReceiver::SetElement(obj, 1, second, NONE, SLOPPY).Check(); JSReceiver::SetElement(obj, 1, second, NONE, SLOPPY).Check();
// Make the clone. // Make the clone.
Handle<Object> value1, value2;
Handle<JSObject> clone = JSObject::Copy(obj); Handle<JSObject> clone = JSObject::Copy(obj);
CHECK(!clone.is_identical_to(obj)); CHECK(!clone.is_identical_to(obj));
CHECK_EQ(*i::Object::GetElement(isolate, obj, 0).ToHandleChecked(), value1 = Object::GetElement(isolate, obj, 0).ToHandleChecked();
*i::Object::GetElement(isolate, clone, 0).ToHandleChecked()); value2 = Object::GetElement(isolate, clone, 0).ToHandleChecked();
CHECK_EQ(*i::Object::GetElement(isolate, obj, 1).ToHandleChecked(), CHECK_EQ(*value1, *value2);
*i::Object::GetElement(isolate, clone, 1).ToHandleChecked()); value1 = Object::GetElement(isolate, obj, 1).ToHandleChecked();
value2 = Object::GetElement(isolate, clone, 1).ToHandleChecked();
CHECK_EQ(*value1, *value2);
CHECK_EQ(*Object::GetProperty(obj, first).ToHandleChecked(), value1 = Object::GetProperty(obj, first).ToHandleChecked();
*Object::GetProperty(clone, first).ToHandleChecked()); value2 = Object::GetProperty(clone, first).ToHandleChecked();
CHECK_EQ(*Object::GetProperty(obj, second).ToHandleChecked(), CHECK_EQ(*value1, *value2);
*Object::GetProperty(clone, second).ToHandleChecked()); value1 = Object::GetProperty(obj, second).ToHandleChecked();
value2 = Object::GetProperty(clone, second).ToHandleChecked();
CHECK_EQ(*value1, *value2);
// Flip the values. // Flip the values.
JSReceiver::SetProperty(clone, first, two, NONE, SLOPPY).Check(); JSReceiver::SetProperty(clone, first, two, NONE, SLOPPY).Check();
...@@ -837,15 +845,19 @@ TEST(JSObjectCopy) { ...@@ -837,15 +845,19 @@ TEST(JSObjectCopy) {
JSReceiver::SetElement(clone, 0, second, NONE, SLOPPY).Check(); JSReceiver::SetElement(clone, 0, second, NONE, SLOPPY).Check();
JSReceiver::SetElement(clone, 1, first, NONE, SLOPPY).Check(); JSReceiver::SetElement(clone, 1, first, NONE, SLOPPY).Check();
CHECK_EQ(*i::Object::GetElement(isolate, obj, 1).ToHandleChecked(), value1 = Object::GetElement(isolate, obj, 1).ToHandleChecked();
*i::Object::GetElement(isolate, clone, 0).ToHandleChecked()); value2 = Object::GetElement(isolate, clone, 0).ToHandleChecked();
CHECK_EQ(*i::Object::GetElement(isolate, obj, 0).ToHandleChecked(), CHECK_EQ(*value1, *value2);
*i::Object::GetElement(isolate, clone, 1).ToHandleChecked()); value1 = Object::GetElement(isolate, obj, 0).ToHandleChecked();
value2 = Object::GetElement(isolate, clone, 1).ToHandleChecked();
CHECK_EQ(*Object::GetProperty(obj, second).ToHandleChecked(), CHECK_EQ(*value1, *value2);
*Object::GetProperty(clone, first).ToHandleChecked());
CHECK_EQ(*Object::GetProperty(obj, first).ToHandleChecked(), value1 = Object::GetProperty(obj, second).ToHandleChecked();
*Object::GetProperty(clone, second).ToHandleChecked()); value2 = Object::GetProperty(clone, first).ToHandleChecked();
CHECK_EQ(*value1, *value2);
value1 = Object::GetProperty(obj, first).ToHandleChecked();
value2 = Object::GetProperty(clone, second).ToHandleChecked();
CHECK_EQ(*value1, *value2);
} }
......
...@@ -116,7 +116,7 @@ function InvokeClangPluginForEachFile(filenames, cfg, func) ...@@ -116,7 +116,7 @@ function InvokeClangPluginForEachFile(filenames, cfg, func)
cfg.arch_define) cfg.arch_define)
for _, filename in ipairs(filenames) do for _, filename in ipairs(filenames) do
log("-- %s", filename) log("-- %s", filename)
local action = cmd_line .. " src/" .. filename .. " 2>&1" local action = cmd_line .. " " .. filename .. " 2>&1"
if FLAGS.verbose then print('popen ', action) end if FLAGS.verbose then print('popen ', action) end
local pipe = io.popen(action) local pipe = io.popen(action)
func(filename, pipe:lines()) func(filename, pipe:lines())
...@@ -129,19 +129,26 @@ end ...@@ -129,19 +129,26 @@ end
-- GYP file parsing -- GYP file parsing
local function ParseGYPFile() local function ParseGYPFile()
local f = assert(io.open("tools/gyp/v8.gyp"), "failed to open GYP file") local gyp = ""
local gyp = f:read('*a') local gyp_files = { "tools/gyp/v8.gyp", "test/cctest/cctest.gyp" }
f:close() for i = 1, #gyp_files do
local f = assert(io.open(gyp_files[i]), "failed to open GYP file")
local t = f:read('*a')
gyp = gyp .. t
f:close()
end
local result = {} local result = {}
for condition, sources in for condition, sources in
gyp:gmatch "'sources': %[.-### gcmole%((.-)%) ###(.-)%]" do gyp:gmatch "'sources': %[.-### gcmole%((.-)%) ###(.-)%]" do
local files = {} if result[condition] == nil then result[condition] = {} end
for file in sources:gmatch "'%.%./%.%./src/([^']-%.cc)'" do for file in sources:gmatch "'%.%./%.%./src/([^']-%.cc)'" do
table.insert(files, file) table.insert(result[condition], "src/" .. file)
end
for file in sources:gmatch "'(test-[^']-%.cc)'" do
table.insert(result[condition], "test/cctest/" .. file)
end end
result[condition] = files
end end
return result return result
......
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