Revision: 3017
Author: [email protected]
Date: Mon Oct 5 03:50:55 2009
Log: Revert revisions 3013, 3014, and 3016. We need a better solution.
Review URL: http://codereview.chromium.org/251088
http://code.google.com/p/v8/source/detail?r=3017
Modified:
/branches/bleeding_edge/include/v8.h
/branches/bleeding_edge/src/checks.h
/branches/bleeding_edge/test/cctest/test-api.cc
=======================================
--- /branches/bleeding_edge/include/v8.h Fri Oct 2 08:51:07 2009
+++ /branches/bleeding_edge/include/v8.h Mon Oct 5 03:50:55 2009
@@ -1063,7 +1063,6 @@
class V8EXPORT Integer : public Number {
public:
static Local<Integer> New(int32_t value);
- static inline Local<Integer> New(uint32_t value);
int64_t Value() const;
static inline Integer* Cast(v8::Value* obj);
private:
@@ -3025,16 +3024,6 @@
#endif
return static_cast<Number*>(value);
}
-
-
-Local<Integer> Integer::New(uint32_t value) {
- // If highest bit is not set, chances are it's SMI.
- bool could_be_smi = (value & (1 << 31)) == 0;
- if (could_be_smi) {
- return Integer::New(static_cast<int32_t>(value));
- }
- return Local<Integer>::Cast(Number::New(value));
-}
Integer* Integer::Cast(v8::Value* value) {
=======================================
--- /branches/bleeding_edge/src/checks.h Sat Oct 3 06:46:22 2009
+++ /branches/bleeding_edge/src/checks.h Mon Oct 5 03:50:55 2009
@@ -80,27 +80,6 @@
}
}
-// Helper function used by the CHECK_INT64_EQ function when given int64_t
-// arguments. Should not be called directly. We do not overload CHECK_EQ
-// with both 32-bit and 64-bit integers, because it causes ambiguity
-// with operands of mixed sizes.
-static inline void CheckInt64EqualsHelper(const char* file, int line,
- const char* expected_source,
- int64_t expected,
- const char* value_source,
- int64_t value) {
- if (expected != value) {
- // Print int64_t values in hex, as two int32s,
- // to avoid platform-dependencies.
- V8_Fatal(file, line,
- "CHECK_EQ(%s, %s) failed\n#"
- " Expected: 0x%08x%08x\n# Found: 0x%08x%08x",
- expected_source, value_source,
- uint32_t(expected >> 32), uint32_t(expected),
- uint32_t(value >> 32), uint32_t(value));
- }
-}
-
// Helper function used by the CHECK_NE function when given int
// arguments. Should not be called directly.
@@ -233,9 +212,6 @@
#define CHECK_GT(a, b) CHECK((a) > (b))
#define CHECK_GE(a, b) CHECK((a) >= (b))
-#define CHECK_INT64_EQ(expected, value) CheckInt64EqualsHelper(__FILE__, \
- __LINE__, #expected, expected, #value, value)
-
// This is inspired by the static assertion facility in boost. This
// is pretty magical. If it causes you trouble on a platform you may
=======================================
--- /branches/bleeding_edge/test/cctest/test-api.cc Sat Oct 3 06:46:22 2009
+++ /branches/bleeding_edge/test/cctest/test-api.cc Mon Oct 5 03:50:55 2009
@@ -700,75 +700,6 @@
Local<Script> setter = v8_compile("obj.foo = 901;");
CHECK_EQ(901, setter->Run()->Int32Value());
}
-
-
-THREADED_TEST(TinyInteger) {
- v8::HandleScope scope;
- LocalContext env;
- int32_t value = 239;
- Local<v8::Integer> value_obj = v8::Integer::New(value);
- CHECK_INT64_EQ(static_cast<int64_t>(value), value_obj->Value());
-}
-
-
-THREADED_TEST(BigSmiInteger) {
- v8::HandleScope scope;
- LocalContext env;
- int32_t value = (1 << 30) - 1;
- CHECK(i::Smi::IsValid(value));
- CHECK(!i::Smi::IsValid(value + 1));
- Local<v8::Integer> value_obj = v8::Integer::New(value);
- CHECK_INT64_EQ(static_cast<int64_t>(value), value_obj->Value());
-}
-
-
-THREADED_TEST(BigInteger) {
- v8::HandleScope scope;
- LocalContext env;
- int32_t value = (1 << 30) + 1;
- CHECK(!i::Smi::IsValid(value));
- Local<v8::Integer> value_obj = v8::Integer::New(value);
- CHECK_INT64_EQ(static_cast<int64_t>(value), value_obj->Value());
-}
-
-
-THREADED_TEST(TinyUnsignedInteger) {
- v8::HandleScope scope;
- LocalContext env;
- uint32_t value = 239;
- Local<v8::Integer> value_obj = v8::Integer::New(value);
- CHECK_INT64_EQ(static_cast<int64_t>(value), value_obj->Value());
-}
-
-
-THREADED_TEST(BigUnsignedSmiInteger) {
- v8::HandleScope scope;
- LocalContext env;
- uint32_t value = (1 << 30) - 1;
- CHECK(i::Smi::IsValid(value));
- CHECK(!i::Smi::IsValid(value + 1));
- Local<v8::Integer> value_obj = v8::Integer::New(value);
- CHECK_INT64_EQ(static_cast<int64_t>(value), value_obj->Value());
-}
-
-
-THREADED_TEST(BigUnsignedInteger) {
- v8::HandleScope scope;
- LocalContext env;
- uint32_t value = (1 << 30) + 1;
- CHECK(!i::Smi::IsValid(value));
- Local<v8::Integer> value_obj = v8::Integer::New(value);
- CHECK_INT64_EQ(static_cast<int64_t>(value), value_obj->Value());
-}
-
-
-THREADED_TEST(OutOfSignedRangeUnsignedInteger) {
- v8::HandleScope scope;
- LocalContext env;
- uint32_t value = uint32_t(0xffffffff);
- Local<v8::Integer> value_obj = v8::Integer::New(value);
- CHECK_INT64_EQ(static_cast<int64_t>(value), value_obj->Value());
-}
THREADED_TEST(Number) {
--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---