Harden a few builtins

Introducing BUILTIN_ASSERT, builtins' equivalent of RUNTIME_ASSERT.

R=rossberg@chromium.org

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

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21439 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 620f07e3
......@@ -2485,17 +2485,6 @@ DebugCommandProcessor.prototype.systemBreak = function(cmd, args) {
};
function NumberToHex8Str(n) {
var r = "";
for (var i = 0; i < 8; ++i) {
var c = hexCharArray[n & 0x0F]; // hexCharArray is defined in uri.js
r = c + r;
n = n >>> 4;
}
return r;
}
/**
* Convert an Object to its debugger protocol representation. The representation
* may be serilized to a JSON object using JSON.stringify().
......
......@@ -1133,6 +1133,24 @@ void Isolate::DoThrow(Object* exception, MessageLocation* location) {
} else {
OS::PrintError("Extension or internal compilation error.\n");
}
#ifdef OBJECT_PRINT
// Since comments and empty lines have been stripped from the source of
// builtins, print the actual source here so that line numbers match.
if (location->script()->source()->IsString()) {
Handle<String> src(String::cast(location->script()->source()));
PrintF("Failing script:\n");
int len = src->length();
int line_number = 1;
PrintF("%5d: ", line_number);
for (int i = 0; i < len; i++) {
uint16_t character = src->Get(i);
PrintF("%c", character);
if (character == '\n' && i < len - 2) {
PrintF("%5d: ", ++line_number);
}
}
}
#endif
}
}
......
......@@ -14263,7 +14263,7 @@ int JSObject::GetLocalElementKeys(FixedArray* storage,
case FAST_HOLEY_DOUBLE_ELEMENTS: {
int length = IsJSArray() ?
Smi::cast(JSArray::cast(this)->length())->value() :
FixedDoubleArray::cast(elements())->length();
FixedArrayBase::cast(elements())->length();
for (int i = 0; i < length; i++) {
if (!FixedDoubleArray::cast(elements())->is_the_hole(i)) {
if (storage != NULL) {
......
This diff is collapsed.
This diff is collapsed.
......@@ -51,7 +51,7 @@ EXPECTED_FUNCTION_COUNT = 359
EXPECTED_FUZZABLE_COUNT = 326
EXPECTED_CCTEST_COUNT = 6
EXPECTED_UNKNOWN_COUNT = 5
EXPECTED_BUILTINS_COUNT = 824
EXPECTED_BUILTINS_COUNT = 781
# Don't call these at all.
......
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