Revision: 20841
Author: [email protected]
Date: Thu Apr 17 11:57:08 2014 UTC
Log: Extend GCMole to also cover cctest files.
[email protected]
Review URL: https://codereview.chromium.org/240933002
http://code.google.com/p/v8/source/detail?r=20841
Modified:
/branches/bleeding_edge/test/cctest/cctest.gyp
/branches/bleeding_edge/test/cctest/test-heap.cc
/branches/bleeding_edge/tools/gcmole/gcmole.lua
=======================================
--- /branches/bleeding_edge/test/cctest/cctest.gyp Fri Apr 4 20:41:57 2014
UTC
+++ /branches/bleeding_edge/test/cctest/cctest.gyp Thu Apr 17 11:57:08 2014
UTC
@@ -41,7 +41,7 @@
'include_dirs': [
'../../src',
],
- 'sources': [
+ 'sources': [ ### gcmole(all) ###
'<(generated_file)',
'cctest.cc',
'gay-fixed.cc',
@@ -125,7 +125,7 @@
],
'conditions': [
['v8_target_arch=="ia32"', {
- 'sources': [
+ 'sources': [ ### gcmole(arch:ia32) ###
'test-assembler-ia32.cc',
'test-code-stubs.cc',
'test-code-stubs-ia32.cc',
@@ -136,7 +136,7 @@
],
}],
['v8_target_arch=="x64"', {
- 'sources': [
+ 'sources': [ ### gcmole(arch:x64) ###
'test-assembler-x64.cc',
'test-code-stubs.cc',
'test-code-stubs-x64.cc',
@@ -147,7 +147,7 @@
],
}],
['v8_target_arch=="arm"', {
- 'sources': [
+ 'sources': [ ### gcmole(arch:arm) ###
'test-assembler-arm.cc',
'test-code-stubs.cc',
'test-code-stubs-arm.cc',
@@ -156,7 +156,7 @@
],
}],
['v8_target_arch=="arm64"', {
- 'sources': [
+ 'sources': [ ### gcmole(arch:arm64) ###
'test-utils-arm64.cc',
'test-assembler-arm64.cc',
'test-code-stubs.cc',
@@ -168,7 +168,7 @@
],
}],
['v8_target_arch=="mipsel"', {
- 'sources': [
+ 'sources': [ ### gcmole(arch:mipsel) ###
'test-assembler-mips.cc',
'test-code-stubs.cc',
'test-code-stubs-mips.cc',
=======================================
--- /branches/bleeding_edge/test/cctest/test-heap.cc Wed Apr 16 11:38:56
2014 UTC
+++ /branches/bleeding_edge/test/cctest/test-heap.cc Thu Apr 17 11:57:08
2014 UTC
@@ -756,6 +756,7 @@
Handle<JSFunction> function = Handle<JSFunction>::cast(fun_obj);
// Allocate the object.
+ Handle<Object> element;
Handle<JSObject> object = factory->NewJSObject(function);
Handle<JSArray> array = Handle<JSArray>::cast(object);
// We just initialized the VM, no heap allocation failure yet.
@@ -770,7 +771,8 @@
// array[length] = name.
JSReceiver::SetElement(array, 0, name, NONE, SLOPPY).Check();
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.
Handle<Object> length =
@@ -787,9 +789,10 @@
uint32_t new_int_length = 0;
CHECK(array->length()->ToArrayIndex(&new_int_length));
CHECK_EQ(static_cast<double>(int_length), new_int_length - 1);
- CHECK_EQ(*i::Object::GetElement(isolate, array,
int_length).ToHandleChecked(),
- *name);
- CHECK_EQ(*i::Object::GetElement(isolate, array, 0).ToHandleChecked(),
*name);
+ element = Object::GetElement(isolate, array,
int_length).ToHandleChecked();
+ CHECK_EQ(*element, *name);
+ element = Object::GetElement(isolate, array, 0).ToHandleChecked();
+ CHECK_EQ(*element, *name);
}
@@ -817,18 +820,23 @@
JSReceiver::SetElement(obj, 1, second, NONE, SLOPPY).Check();
// Make the clone.
+ Handle<Object> value1, value2;
Handle<JSObject> clone = JSObject::Copy(obj);
CHECK(!clone.is_identical_to(obj));
- CHECK_EQ(*i::Object::GetElement(isolate, obj, 0).ToHandleChecked(),
- *i::Object::GetElement(isolate, clone, 0).ToHandleChecked());
- CHECK_EQ(*i::Object::GetElement(isolate, obj, 1).ToHandleChecked(),
- *i::Object::GetElement(isolate, clone, 1).ToHandleChecked());
+ value1 = Object::GetElement(isolate, obj, 0).ToHandleChecked();
+ value2 = Object::GetElement(isolate, clone, 0).ToHandleChecked();
+ CHECK_EQ(*value1, *value2);
+ 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(),
- *Object::GetProperty(clone, first).ToHandleChecked());
- CHECK_EQ(*Object::GetProperty(obj, second).ToHandleChecked(),
- *Object::GetProperty(clone, second).ToHandleChecked());
+ value1 = Object::GetProperty(obj, first).ToHandleChecked();
+ value2 = Object::GetProperty(clone, first).ToHandleChecked();
+ CHECK_EQ(*value1, *value2);
+ value1 = Object::GetProperty(obj, second).ToHandleChecked();
+ value2 = Object::GetProperty(clone, second).ToHandleChecked();
+ CHECK_EQ(*value1, *value2);
// Flip the values.
JSReceiver::SetProperty(clone, first, two, NONE, SLOPPY).Check();
@@ -837,15 +845,19 @@
JSReceiver::SetElement(clone, 0, second, NONE, SLOPPY).Check();
JSReceiver::SetElement(clone, 1, first, NONE, SLOPPY).Check();
- CHECK_EQ(*i::Object::GetElement(isolate, obj, 1).ToHandleChecked(),
- *i::Object::GetElement(isolate, clone, 0).ToHandleChecked());
- CHECK_EQ(*i::Object::GetElement(isolate, obj, 0).ToHandleChecked(),
- *i::Object::GetElement(isolate, clone, 1).ToHandleChecked());
+ value1 = Object::GetElement(isolate, obj, 1).ToHandleChecked();
+ value2 = Object::GetElement(isolate, clone, 0).ToHandleChecked();
+ CHECK_EQ(*value1, *value2);
+ value1 = Object::GetElement(isolate, obj, 0).ToHandleChecked();
+ value2 = Object::GetElement(isolate, clone, 1).ToHandleChecked();
+ CHECK_EQ(*value1, *value2);
- CHECK_EQ(*Object::GetProperty(obj, second).ToHandleChecked(),
- *Object::GetProperty(clone, first).ToHandleChecked());
- CHECK_EQ(*Object::GetProperty(obj, first).ToHandleChecked(),
- *Object::GetProperty(clone, second).ToHandleChecked());
+ value1 = Object::GetProperty(obj, 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);
}
=======================================
--- /branches/bleeding_edge/tools/gcmole/gcmole.lua Tue Mar 25 11:46:28
2014 UTC
+++ /branches/bleeding_edge/tools/gcmole/gcmole.lua Thu Apr 17 11:57:08
2014 UTC
@@ -116,7 +116,7 @@
cfg.arch_define)
for _, filename in ipairs(filenames) do
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
local pipe = io.popen(action)
func(filename, pipe:lines())
@@ -129,19 +129,26 @@
-- GYP file parsing
local function ParseGYPFile()
- local f = assert(io.open("tools/gyp/v8.gyp"), "failed to open GYP file")
- local gyp = f:read('*a')
- f:close()
+ local gyp = ""
+ local gyp_files = { "tools/gyp/v8.gyp", "test/cctest/cctest.gyp" }
+ 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 = {}
for condition, sources in
gyp:gmatch "'sources': %[.-### gcmole%((.-)%) ###(.-)%]" do
- local files = {}
+ if result[condition] == nil then result[condition] = {} end
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
- result[condition] = files
end
return result
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.