Added two convenience methods to access an int/double argument from within a
runtime function and use these in various places. Review URL: http://codereview.chromium.org/7003114 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8263 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
5a236ce6fd
commit
9a1d430f32
@ -63,6 +63,14 @@ class Arguments BASE_EMBEDDED {
|
||||
return Handle<S>(reinterpret_cast<S**>(value));
|
||||
}
|
||||
|
||||
int smi_at(int index) {
|
||||
return Smi::cast((*this)[index])->value();
|
||||
}
|
||||
|
||||
double number_at(int index) {
|
||||
return (*this)[index]->Number();
|
||||
}
|
||||
|
||||
// Get the total number of arguments including the receiver.
|
||||
int length() const { return length_; }
|
||||
|
||||
|
22
src/ic.cc
22
src/ic.cc
@ -578,13 +578,7 @@ bool CallICBase::TryUpdateExtraICState(LookupResult* lookup,
|
||||
// out of bounds, update the state to record this fact.
|
||||
if (StringStubState::decode(*extra_ic_state) == DEFAULT_STRING_STUB &&
|
||||
argc >= 1 && args[1]->IsNumber()) {
|
||||
double index;
|
||||
if (args[1]->IsSmi()) {
|
||||
index = Smi::cast(args[1])->value();
|
||||
} else {
|
||||
ASSERT(args[1]->IsHeapNumber());
|
||||
index = DoubleToInteger(HeapNumber::cast(args[1])->value());
|
||||
}
|
||||
double index = DoubleToInteger(args.number_at(1));
|
||||
if (index < 0 || index >= string->length()) {
|
||||
*extra_ic_state =
|
||||
StringStubState::update(*extra_ic_state,
|
||||
@ -2294,10 +2288,10 @@ RUNTIME_FUNCTION(MaybeObject*, UnaryOp_Patch) {
|
||||
|
||||
HandleScope scope(isolate);
|
||||
Handle<Object> operand = args.at<Object>(0);
|
||||
int key = Smi::cast(args[1])->value();
|
||||
Token::Value op = static_cast<Token::Value>(Smi::cast(args[2])->value());
|
||||
int key = args.smi_at(1);
|
||||
Token::Value op = static_cast<Token::Value>(args.smi_at(2));
|
||||
UnaryOpIC::TypeInfo previous_type =
|
||||
static_cast<UnaryOpIC::TypeInfo>(Smi::cast(args[3])->value());
|
||||
static_cast<UnaryOpIC::TypeInfo>(args.smi_at(3));
|
||||
|
||||
UnaryOpIC::TypeInfo type = UnaryOpIC::GetTypeInfo(operand);
|
||||
type = UnaryOpIC::ComputeNewType(type, previous_type);
|
||||
@ -2346,10 +2340,10 @@ RUNTIME_FUNCTION(MaybeObject*, BinaryOp_Patch) {
|
||||
HandleScope scope(isolate);
|
||||
Handle<Object> left = args.at<Object>(0);
|
||||
Handle<Object> right = args.at<Object>(1);
|
||||
int key = Smi::cast(args[2])->value();
|
||||
Token::Value op = static_cast<Token::Value>(Smi::cast(args[3])->value());
|
||||
int key = args.smi_at(2);
|
||||
Token::Value op = static_cast<Token::Value>(args.smi_at(3));
|
||||
BinaryOpIC::TypeInfo previous_type =
|
||||
static_cast<BinaryOpIC::TypeInfo>(Smi::cast(args[4])->value());
|
||||
static_cast<BinaryOpIC::TypeInfo>(args.smi_at(4));
|
||||
|
||||
BinaryOpIC::TypeInfo type = BinaryOpIC::GetTypeInfo(left, right);
|
||||
type = BinaryOpIC::JoinTypes(type, previous_type);
|
||||
@ -2509,7 +2503,7 @@ CompareIC::State CompareIC::TargetState(State state,
|
||||
RUNTIME_FUNCTION(Code*, CompareIC_Miss) {
|
||||
NoHandleAllocation na;
|
||||
ASSERT(args.length() == 3);
|
||||
CompareIC ic(isolate, static_cast<Token::Value>(Smi::cast(args[2])->value()));
|
||||
CompareIC ic(isolate, static_cast<Token::Value>(args.smi_at(2)));
|
||||
ic.UpdateCaches(args.at<Object>(0), args.at<Object>(1));
|
||||
return ic.target();
|
||||
}
|
||||
|
233
src/runtime.cc
233
src/runtime.cc
@ -81,19 +81,19 @@ namespace internal {
|
||||
RUNTIME_ASSERT(obj->IsBoolean()); \
|
||||
bool name = (obj)->IsTrue();
|
||||
|
||||
// Cast the given object to a Smi and store its value in an int variable
|
||||
// with the given name. If the object is not a Smi call IllegalOperation
|
||||
// Cast the given argument to a Smi and store its value in an int variable
|
||||
// with the given name. If the argument is not a Smi call IllegalOperation
|
||||
// and return.
|
||||
#define CONVERT_SMI_CHECKED(name, obj) \
|
||||
RUNTIME_ASSERT(obj->IsSmi()); \
|
||||
int name = Smi::cast(obj)->value();
|
||||
#define CONVERT_SMI_ARG_CHECKED(name, index) \
|
||||
RUNTIME_ASSERT(args[index]->IsSmi()); \
|
||||
int name = args.smi_at(index);
|
||||
|
||||
// Cast the given object to a double and store it in a variable with
|
||||
// the given name. If the object is not a number (as opposed to
|
||||
// Cast the given argument to a double and store it in a variable with
|
||||
// the given name. If the argument is not a number (as opposed to
|
||||
// the number not-a-number) call IllegalOperation and return.
|
||||
#define CONVERT_DOUBLE_CHECKED(name, obj) \
|
||||
RUNTIME_ASSERT(obj->IsNumber()); \
|
||||
double name = (obj)->Number();
|
||||
#define CONVERT_DOUBLE_ARG_CHECKED(name, index) \
|
||||
RUNTIME_ASSERT(args[index]->IsNumber()); \
|
||||
double name = args.number_at(index);
|
||||
|
||||
// Call the specified converter on the object *comand store the result in
|
||||
// a variable of the specified type with the given name. If the
|
||||
@ -482,7 +482,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateArrayLiteralBoilerplate) {
|
||||
HandleScope scope(isolate);
|
||||
ASSERT(args.length() == 3);
|
||||
CONVERT_ARG_CHECKED(FixedArray, literals, 0);
|
||||
CONVERT_SMI_CHECKED(literals_index, args[1]);
|
||||
CONVERT_SMI_ARG_CHECKED(literals_index, 1);
|
||||
CONVERT_ARG_CHECKED(FixedArray, elements, 2);
|
||||
|
||||
Handle<Object> object =
|
||||
@ -499,9 +499,9 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateObjectLiteral) {
|
||||
HandleScope scope(isolate);
|
||||
ASSERT(args.length() == 4);
|
||||
CONVERT_ARG_CHECKED(FixedArray, literals, 0);
|
||||
CONVERT_SMI_CHECKED(literals_index, args[1]);
|
||||
CONVERT_SMI_ARG_CHECKED(literals_index, 1);
|
||||
CONVERT_ARG_CHECKED(FixedArray, constant_properties, 2);
|
||||
CONVERT_SMI_CHECKED(flags, args[3]);
|
||||
CONVERT_SMI_ARG_CHECKED(flags, 3);
|
||||
bool should_have_fast_elements = (flags & ObjectLiteral::kFastElements) != 0;
|
||||
bool has_function_literal = (flags & ObjectLiteral::kHasFunction) != 0;
|
||||
|
||||
@ -525,9 +525,9 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateObjectLiteralShallow) {
|
||||
HandleScope scope(isolate);
|
||||
ASSERT(args.length() == 4);
|
||||
CONVERT_ARG_CHECKED(FixedArray, literals, 0);
|
||||
CONVERT_SMI_CHECKED(literals_index, args[1]);
|
||||
CONVERT_SMI_ARG_CHECKED(literals_index, 1);
|
||||
CONVERT_ARG_CHECKED(FixedArray, constant_properties, 2);
|
||||
CONVERT_SMI_CHECKED(flags, args[3]);
|
||||
CONVERT_SMI_ARG_CHECKED(flags, 3);
|
||||
bool should_have_fast_elements = (flags & ObjectLiteral::kFastElements) != 0;
|
||||
bool has_function_literal = (flags & ObjectLiteral::kHasFunction) != 0;
|
||||
|
||||
@ -551,7 +551,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateArrayLiteral) {
|
||||
HandleScope scope(isolate);
|
||||
ASSERT(args.length() == 3);
|
||||
CONVERT_ARG_CHECKED(FixedArray, literals, 0);
|
||||
CONVERT_SMI_CHECKED(literals_index, args[1]);
|
||||
CONVERT_SMI_ARG_CHECKED(literals_index, 1);
|
||||
CONVERT_ARG_CHECKED(FixedArray, elements, 2);
|
||||
|
||||
// Check if boilerplate exists. If not, create it first.
|
||||
@ -570,7 +570,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateArrayLiteralShallow) {
|
||||
HandleScope scope(isolate);
|
||||
ASSERT(args.length() == 3);
|
||||
CONVERT_ARG_CHECKED(FixedArray, literals, 0);
|
||||
CONVERT_SMI_CHECKED(literals_index, args[1]);
|
||||
CONVERT_SMI_ARG_CHECKED(literals_index, 1);
|
||||
CONVERT_ARG_CHECKED(FixedArray, elements, 2);
|
||||
|
||||
// Check if boilerplate exists. If not, create it first.
|
||||
@ -1111,9 +1111,8 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DeclareGlobals) {
|
||||
|
||||
Handle<Context> context = args.at<Context>(0);
|
||||
CONVERT_ARG_CHECKED(FixedArray, pairs, 1);
|
||||
bool is_eval = Smi::cast(args[2])->value() == 1;
|
||||
StrictModeFlag strict_mode =
|
||||
static_cast<StrictModeFlag>(Smi::cast(args[3])->value());
|
||||
bool is_eval = args.smi_at(2) == 1;
|
||||
StrictModeFlag strict_mode = static_cast<StrictModeFlag>(args.smi_at(3));
|
||||
ASSERT(strict_mode == kStrictMode || strict_mode == kNonStrictMode);
|
||||
|
||||
// Compute the property attributes. According to ECMA-262, section
|
||||
@ -1252,8 +1251,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DeclareContextSlot) {
|
||||
|
||||
CONVERT_ARG_CHECKED(Context, context, 0);
|
||||
Handle<String> name(String::cast(args[1]));
|
||||
PropertyAttributes mode =
|
||||
static_cast<PropertyAttributes>(Smi::cast(args[2])->value());
|
||||
PropertyAttributes mode = static_cast<PropertyAttributes>(args.smi_at(2));
|
||||
RUNTIME_ASSERT(mode == READ_ONLY || mode == NONE);
|
||||
Handle<Object> initial_value(args[3], isolate);
|
||||
|
||||
@ -1366,8 +1364,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_InitializeVarGlobal) {
|
||||
CONVERT_ARG_CHECKED(String, name, 0);
|
||||
GlobalObject* global = isolate->context()->global();
|
||||
RUNTIME_ASSERT(args[1]->IsSmi());
|
||||
StrictModeFlag strict_mode =
|
||||
static_cast<StrictModeFlag>(Smi::cast(args[1])->value());
|
||||
StrictModeFlag strict_mode = static_cast<StrictModeFlag>(args.smi_at(1));
|
||||
ASSERT(strict_mode == kStrictMode || strict_mode == kNonStrictMode);
|
||||
|
||||
// According to ECMA-262, section 12.2, page 62, the property must
|
||||
@ -1649,7 +1646,7 @@ RUNTIME_FUNCTION(MaybeObject*,
|
||||
HandleScope scope(isolate);
|
||||
ASSERT(args.length() == 2);
|
||||
CONVERT_ARG_CHECKED(JSObject, object, 0);
|
||||
CONVERT_SMI_CHECKED(properties, args[1]);
|
||||
CONVERT_SMI_ARG_CHECKED(properties, 1);
|
||||
if (object->HasFastProperties()) {
|
||||
NormalizeProperties(object, KEEP_INOBJECT_PROPERTIES, properties);
|
||||
}
|
||||
@ -1664,7 +1661,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_RegExpExec) {
|
||||
CONVERT_ARG_CHECKED(String, subject, 1);
|
||||
// Due to the way the JS calls are constructed this must be less than the
|
||||
// length of a string, i.e. it is always a Smi. We check anyway for security.
|
||||
CONVERT_SMI_CHECKED(index, args[2]);
|
||||
CONVERT_SMI_ARG_CHECKED(index, 2);
|
||||
CONVERT_ARG_CHECKED(JSArray, last_match_info, 3);
|
||||
RUNTIME_ASSERT(last_match_info->HasFastElements());
|
||||
RUNTIME_ASSERT(index >= 0);
|
||||
@ -1681,7 +1678,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_RegExpExec) {
|
||||
|
||||
RUNTIME_FUNCTION(MaybeObject*, Runtime_RegExpConstructResult) {
|
||||
ASSERT(args.length() == 3);
|
||||
CONVERT_SMI_CHECKED(elements_count, args[0]);
|
||||
CONVERT_SMI_ARG_CHECKED(elements_count, 0);
|
||||
if (elements_count > JSArray::kMaxFastElementsLength) {
|
||||
return isolate->ThrowIllegalOperation();
|
||||
}
|
||||
@ -1836,7 +1833,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_MaterializeRegExpLiteral) {
|
||||
HandleScope scope(isolate);
|
||||
ASSERT(args.length() == 4);
|
||||
CONVERT_ARG_CHECKED(FixedArray, literals, 0);
|
||||
int index = Smi::cast(args[1])->value();
|
||||
int index = args.smi_at(1);
|
||||
Handle<String> pattern = args.at<String>(2);
|
||||
Handle<String> flags = args.at<String>(3);
|
||||
|
||||
@ -2062,7 +2059,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_SetExpectedNumberOfProperties) {
|
||||
HandleScope scope(isolate);
|
||||
ASSERT(args.length() == 2);
|
||||
CONVERT_ARG_CHECKED(JSFunction, function, 0);
|
||||
CONVERT_SMI_CHECKED(num, args[1]);
|
||||
CONVERT_SMI_ARG_CHECKED(num, 1);
|
||||
RUNTIME_ASSERT(num >= 0);
|
||||
SetExpectedNofProperties(function, num);
|
||||
return isolate->heap()->undefined_value();
|
||||
@ -3116,17 +3113,17 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_SubString) {
|
||||
ASSERT(args.length() == 3);
|
||||
|
||||
CONVERT_CHECKED(String, value, args[0]);
|
||||
Object* from = args[1];
|
||||
Object* to = args[2];
|
||||
int start, end;
|
||||
// We have a fast integer-only case here to avoid a conversion to double in
|
||||
// the common case where from and to are Smis.
|
||||
if (from->IsSmi() && to->IsSmi()) {
|
||||
start = Smi::cast(from)->value();
|
||||
end = Smi::cast(to)->value();
|
||||
if (args[1]->IsSmi() && args[2]->IsSmi()) {
|
||||
CONVERT_SMI_ARG_CHECKED(from_number, 1);
|
||||
CONVERT_SMI_ARG_CHECKED(to_number, 2);
|
||||
start = from_number;
|
||||
end = to_number;
|
||||
} else {
|
||||
CONVERT_DOUBLE_CHECKED(from_number, from);
|
||||
CONVERT_DOUBLE_CHECKED(to_number, to);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(from_number, 1);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(to_number, 2);
|
||||
start = FastD2I(from_number);
|
||||
end = FastD2I(to_number);
|
||||
}
|
||||
@ -3562,12 +3559,12 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_RegExpExecMultiple) {
|
||||
RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberToRadixString) {
|
||||
NoHandleAllocation ha;
|
||||
ASSERT(args.length() == 2);
|
||||
CONVERT_SMI_CHECKED(radix, args[1]);
|
||||
CONVERT_SMI_ARG_CHECKED(radix, 1);
|
||||
RUNTIME_ASSERT(2 <= radix && radix <= 36);
|
||||
|
||||
// Fast case where the result is a one character string.
|
||||
if (args[0]->IsSmi()) {
|
||||
int value = Smi::cast(args[0])->value();
|
||||
int value = args.smi_at(0);
|
||||
if (value >= 0 && value < radix) {
|
||||
// Character array used for conversion.
|
||||
static const char kCharTable[] = "0123456789abcdefghijklmnopqrstuvwxyz";
|
||||
@ -3577,7 +3574,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberToRadixString) {
|
||||
}
|
||||
|
||||
// Slow case.
|
||||
CONVERT_DOUBLE_CHECKED(value, args[0]);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(value, 0);
|
||||
if (isnan(value)) {
|
||||
return isolate->heap()->AllocateStringFromAscii(CStrVector("NaN"));
|
||||
}
|
||||
@ -3599,7 +3596,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberToFixed) {
|
||||
NoHandleAllocation ha;
|
||||
ASSERT(args.length() == 2);
|
||||
|
||||
CONVERT_DOUBLE_CHECKED(value, args[0]);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(value, 0);
|
||||
if (isnan(value)) {
|
||||
return isolate->heap()->AllocateStringFromAscii(CStrVector("NaN"));
|
||||
}
|
||||
@ -3609,7 +3606,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberToFixed) {
|
||||
}
|
||||
return isolate->heap()->AllocateStringFromAscii(CStrVector("Infinity"));
|
||||
}
|
||||
CONVERT_DOUBLE_CHECKED(f_number, args[1]);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(f_number, 1);
|
||||
int f = FastD2I(f_number);
|
||||
RUNTIME_ASSERT(f >= 0);
|
||||
char* str = DoubleToFixedCString(value, f);
|
||||
@ -3624,7 +3621,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberToExponential) {
|
||||
NoHandleAllocation ha;
|
||||
ASSERT(args.length() == 2);
|
||||
|
||||
CONVERT_DOUBLE_CHECKED(value, args[0]);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(value, 0);
|
||||
if (isnan(value)) {
|
||||
return isolate->heap()->AllocateStringFromAscii(CStrVector("NaN"));
|
||||
}
|
||||
@ -3634,7 +3631,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberToExponential) {
|
||||
}
|
||||
return isolate->heap()->AllocateStringFromAscii(CStrVector("Infinity"));
|
||||
}
|
||||
CONVERT_DOUBLE_CHECKED(f_number, args[1]);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(f_number, 1);
|
||||
int f = FastD2I(f_number);
|
||||
RUNTIME_ASSERT(f >= -1 && f <= 20);
|
||||
char* str = DoubleToExponentialCString(value, f);
|
||||
@ -3649,7 +3646,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberToPrecision) {
|
||||
NoHandleAllocation ha;
|
||||
ASSERT(args.length() == 2);
|
||||
|
||||
CONVERT_DOUBLE_CHECKED(value, args[0]);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(value, 0);
|
||||
if (isnan(value)) {
|
||||
return isolate->heap()->AllocateStringFromAscii(CStrVector("NaN"));
|
||||
}
|
||||
@ -3659,7 +3656,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberToPrecision) {
|
||||
}
|
||||
return isolate->heap()->AllocateStringFromAscii(CStrVector("Infinity"));
|
||||
}
|
||||
CONVERT_DOUBLE_CHECKED(f_number, args[1]);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(f_number, 1);
|
||||
int f = FastD2I(f_number);
|
||||
RUNTIME_ASSERT(f >= 1 && f <= 21);
|
||||
char* str = DoubleToPrecisionCString(value, f);
|
||||
@ -3821,7 +3818,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_KeyedGetProperty) {
|
||||
// Fast case for string indexing using [] with a smi index.
|
||||
HandleScope scope(isolate);
|
||||
Handle<String> str = args.at<String>(0);
|
||||
int index = Smi::cast(args[1])->value();
|
||||
int index = args.smi_at(1);
|
||||
if (index >= 0 && index < str->length()) {
|
||||
Handle<Object> result = GetCharAt(str, index);
|
||||
return *result;
|
||||
@ -4124,7 +4121,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_SetProperty) {
|
||||
Handle<Object> object = args.at<Object>(0);
|
||||
Handle<Object> key = args.at<Object>(1);
|
||||
Handle<Object> value = args.at<Object>(2);
|
||||
CONVERT_SMI_CHECKED(unchecked_attributes, args[3]);
|
||||
CONVERT_SMI_ARG_CHECKED(unchecked_attributes, 3);
|
||||
RUNTIME_ASSERT(
|
||||
(unchecked_attributes & ~(READ_ONLY | DONT_ENUM | DONT_DELETE)) == 0);
|
||||
// Compute attributes.
|
||||
@ -4133,7 +4130,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_SetProperty) {
|
||||
|
||||
StrictModeFlag strict_mode = kNonStrictMode;
|
||||
if (args.length() == 5) {
|
||||
CONVERT_SMI_CHECKED(strict_unchecked, args[4]);
|
||||
CONVERT_SMI_ARG_CHECKED(strict_unchecked, 4);
|
||||
RUNTIME_ASSERT(strict_unchecked == kStrictMode ||
|
||||
strict_unchecked == kNonStrictMode);
|
||||
strict_mode = static_cast<StrictModeFlag>(strict_unchecked);
|
||||
@ -4194,7 +4191,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DeleteProperty) {
|
||||
|
||||
CONVERT_CHECKED(JSObject, object, args[0]);
|
||||
CONVERT_CHECKED(String, key, args[1]);
|
||||
CONVERT_SMI_CHECKED(strict, args[2]);
|
||||
CONVERT_SMI_ARG_CHECKED(strict, 2);
|
||||
return object->DeleteProperty(key, (strict == kStrictMode)
|
||||
? JSObject::STRICT_DELETION
|
||||
: JSObject::NORMAL_DELETION);
|
||||
@ -5352,7 +5349,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_StringParseInt) {
|
||||
NoHandleAllocation ha;
|
||||
|
||||
CONVERT_CHECKED(String, s, args[0]);
|
||||
CONVERT_SMI_CHECKED(radix, args[1]);
|
||||
CONVERT_SMI_ARG_CHECKED(radix, 1);
|
||||
|
||||
s->TryFlatten();
|
||||
|
||||
@ -5941,7 +5938,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberToInteger) {
|
||||
NoHandleAllocation ha;
|
||||
ASSERT(args.length() == 1);
|
||||
|
||||
CONVERT_DOUBLE_CHECKED(number, args[0]);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(number, 0);
|
||||
|
||||
// We do not include 0 so that we don't have to treat +0 / -0 cases.
|
||||
if (number > 0 && number <= Smi::kMaxValue) {
|
||||
@ -5955,7 +5952,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberToIntegerMapMinusZero) {
|
||||
NoHandleAllocation ha;
|
||||
ASSERT(args.length() == 1);
|
||||
|
||||
CONVERT_DOUBLE_CHECKED(number, args[0]);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(number, 0);
|
||||
|
||||
// We do not include 0 so that we don't have to treat +0 / -0 cases.
|
||||
if (number > 0 && number <= Smi::kMaxValue) {
|
||||
@ -5983,7 +5980,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberToJSInt32) {
|
||||
NoHandleAllocation ha;
|
||||
ASSERT(args.length() == 1);
|
||||
|
||||
CONVERT_DOUBLE_CHECKED(number, args[0]);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(number, 0);
|
||||
|
||||
// We do not include 0 so that we don't have to treat +0 / -0 cases.
|
||||
if (number > 0 && number <= Smi::kMaxValue) {
|
||||
@ -6025,8 +6022,8 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberAdd) {
|
||||
NoHandleAllocation ha;
|
||||
ASSERT(args.length() == 2);
|
||||
|
||||
CONVERT_DOUBLE_CHECKED(x, args[0]);
|
||||
CONVERT_DOUBLE_CHECKED(y, args[1]);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(x, 0);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(y, 1);
|
||||
return isolate->heap()->NumberFromDouble(x + y);
|
||||
}
|
||||
|
||||
@ -6035,8 +6032,8 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberSub) {
|
||||
NoHandleAllocation ha;
|
||||
ASSERT(args.length() == 2);
|
||||
|
||||
CONVERT_DOUBLE_CHECKED(x, args[0]);
|
||||
CONVERT_DOUBLE_CHECKED(y, args[1]);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(x, 0);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(y, 1);
|
||||
return isolate->heap()->NumberFromDouble(x - y);
|
||||
}
|
||||
|
||||
@ -6045,8 +6042,8 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberMul) {
|
||||
NoHandleAllocation ha;
|
||||
ASSERT(args.length() == 2);
|
||||
|
||||
CONVERT_DOUBLE_CHECKED(x, args[0]);
|
||||
CONVERT_DOUBLE_CHECKED(y, args[1]);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(x, 0);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(y, 1);
|
||||
return isolate->heap()->NumberFromDouble(x * y);
|
||||
}
|
||||
|
||||
@ -6055,7 +6052,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberUnaryMinus) {
|
||||
NoHandleAllocation ha;
|
||||
ASSERT(args.length() == 1);
|
||||
|
||||
CONVERT_DOUBLE_CHECKED(x, args[0]);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(x, 0);
|
||||
return isolate->heap()->NumberFromDouble(-x);
|
||||
}
|
||||
|
||||
@ -6072,8 +6069,8 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberDiv) {
|
||||
NoHandleAllocation ha;
|
||||
ASSERT(args.length() == 2);
|
||||
|
||||
CONVERT_DOUBLE_CHECKED(x, args[0]);
|
||||
CONVERT_DOUBLE_CHECKED(y, args[1]);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(x, 0);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(y, 1);
|
||||
return isolate->heap()->NumberFromDouble(x / y);
|
||||
}
|
||||
|
||||
@ -6082,8 +6079,8 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberMod) {
|
||||
NoHandleAllocation ha;
|
||||
ASSERT(args.length() == 2);
|
||||
|
||||
CONVERT_DOUBLE_CHECKED(x, args[0]);
|
||||
CONVERT_DOUBLE_CHECKED(y, args[1]);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(x, 0);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(y, 1);
|
||||
|
||||
x = modulo(x, y);
|
||||
// NumberFromDouble may return a Smi instead of a Number object
|
||||
@ -6148,7 +6145,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_StringBuilderConcat) {
|
||||
isolate->context()->mark_out_of_memory();
|
||||
return Failure::OutOfMemoryException();
|
||||
}
|
||||
int array_length = Smi::cast(args[1])->value();
|
||||
int array_length = args.smi_at(1);
|
||||
CONVERT_CHECKED(String, special, args[2]);
|
||||
|
||||
// This assumption is used by the slice encoding in one or two smis.
|
||||
@ -6261,7 +6258,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_StringBuilderJoin) {
|
||||
isolate->context()->mark_out_of_memory();
|
||||
return Failure::OutOfMemoryException();
|
||||
}
|
||||
int array_length = Smi::cast(args[1])->value();
|
||||
int array_length = args.smi_at(1);
|
||||
CONVERT_CHECKED(String, separator, args[2]);
|
||||
|
||||
if (!array->HasFastElements()) {
|
||||
@ -6539,8 +6536,8 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberEquals) {
|
||||
NoHandleAllocation ha;
|
||||
ASSERT(args.length() == 2);
|
||||
|
||||
CONVERT_DOUBLE_CHECKED(x, args[0]);
|
||||
CONVERT_DOUBLE_CHECKED(y, args[1]);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(x, 0);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(y, 1);
|
||||
if (isnan(x)) return Smi::FromInt(NOT_EQUAL);
|
||||
if (isnan(y)) return Smi::FromInt(NOT_EQUAL);
|
||||
if (x == y) return Smi::FromInt(EQUAL);
|
||||
@ -6576,8 +6573,8 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberCompare) {
|
||||
NoHandleAllocation ha;
|
||||
ASSERT(args.length() == 3);
|
||||
|
||||
CONVERT_DOUBLE_CHECKED(x, args[0]);
|
||||
CONVERT_DOUBLE_CHECKED(y, args[1]);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(x, 0);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(y, 1);
|
||||
if (isnan(x) || isnan(y)) return args[2];
|
||||
if (x == y) return Smi::FromInt(EQUAL);
|
||||
if (isless(x, y)) return Smi::FromInt(LESS);
|
||||
@ -6750,7 +6747,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_acos) {
|
||||
ASSERT(args.length() == 1);
|
||||
isolate->counters()->math_acos()->Increment();
|
||||
|
||||
CONVERT_DOUBLE_CHECKED(x, args[0]);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(x, 0);
|
||||
return isolate->transcendental_cache()->Get(TranscendentalCache::ACOS, x);
|
||||
}
|
||||
|
||||
@ -6760,7 +6757,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_asin) {
|
||||
ASSERT(args.length() == 1);
|
||||
isolate->counters()->math_asin()->Increment();
|
||||
|
||||
CONVERT_DOUBLE_CHECKED(x, args[0]);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(x, 0);
|
||||
return isolate->transcendental_cache()->Get(TranscendentalCache::ASIN, x);
|
||||
}
|
||||
|
||||
@ -6770,7 +6767,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_atan) {
|
||||
ASSERT(args.length() == 1);
|
||||
isolate->counters()->math_atan()->Increment();
|
||||
|
||||
CONVERT_DOUBLE_CHECKED(x, args[0]);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(x, 0);
|
||||
return isolate->transcendental_cache()->Get(TranscendentalCache::ATAN, x);
|
||||
}
|
||||
|
||||
@ -6783,8 +6780,8 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_atan2) {
|
||||
ASSERT(args.length() == 2);
|
||||
isolate->counters()->math_atan2()->Increment();
|
||||
|
||||
CONVERT_DOUBLE_CHECKED(x, args[0]);
|
||||
CONVERT_DOUBLE_CHECKED(y, args[1]);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(x, 0);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(y, 1);
|
||||
double result;
|
||||
if (isinf(x) && isinf(y)) {
|
||||
// Make sure that the result in case of two infinite arguments
|
||||
@ -6806,7 +6803,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_ceil) {
|
||||
ASSERT(args.length() == 1);
|
||||
isolate->counters()->math_ceil()->Increment();
|
||||
|
||||
CONVERT_DOUBLE_CHECKED(x, args[0]);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(x, 0);
|
||||
return isolate->heap()->NumberFromDouble(ceiling(x));
|
||||
}
|
||||
|
||||
@ -6816,7 +6813,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_cos) {
|
||||
ASSERT(args.length() == 1);
|
||||
isolate->counters()->math_cos()->Increment();
|
||||
|
||||
CONVERT_DOUBLE_CHECKED(x, args[0]);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(x, 0);
|
||||
return isolate->transcendental_cache()->Get(TranscendentalCache::COS, x);
|
||||
}
|
||||
|
||||
@ -6826,7 +6823,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_exp) {
|
||||
ASSERT(args.length() == 1);
|
||||
isolate->counters()->math_exp()->Increment();
|
||||
|
||||
CONVERT_DOUBLE_CHECKED(x, args[0]);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(x, 0);
|
||||
return isolate->transcendental_cache()->Get(TranscendentalCache::EXP, x);
|
||||
}
|
||||
|
||||
@ -6836,7 +6833,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_floor) {
|
||||
ASSERT(args.length() == 1);
|
||||
isolate->counters()->math_floor()->Increment();
|
||||
|
||||
CONVERT_DOUBLE_CHECKED(x, args[0]);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(x, 0);
|
||||
return isolate->heap()->NumberFromDouble(floor(x));
|
||||
}
|
||||
|
||||
@ -6846,7 +6843,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_log) {
|
||||
ASSERT(args.length() == 1);
|
||||
isolate->counters()->math_log()->Increment();
|
||||
|
||||
CONVERT_DOUBLE_CHECKED(x, args[0]);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(x, 0);
|
||||
return isolate->transcendental_cache()->Get(TranscendentalCache::LOG, x);
|
||||
}
|
||||
|
||||
@ -6856,16 +6853,16 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_pow) {
|
||||
ASSERT(args.length() == 2);
|
||||
isolate->counters()->math_pow()->Increment();
|
||||
|
||||
CONVERT_DOUBLE_CHECKED(x, args[0]);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(x, 0);
|
||||
|
||||
// If the second argument is a smi, it is much faster to call the
|
||||
// custom powi() function than the generic pow().
|
||||
if (args[1]->IsSmi()) {
|
||||
int y = Smi::cast(args[1])->value();
|
||||
int y = args.smi_at(1);
|
||||
return isolate->heap()->NumberFromDouble(power_double_int(x, y));
|
||||
}
|
||||
|
||||
CONVERT_DOUBLE_CHECKED(y, args[1]);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(y, 1);
|
||||
return isolate->heap()->AllocateHeapNumber(power_double_double(x, y));
|
||||
}
|
||||
|
||||
@ -6874,8 +6871,8 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_pow) {
|
||||
RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_pow_cfunction) {
|
||||
NoHandleAllocation ha;
|
||||
ASSERT(args.length() == 2);
|
||||
CONVERT_DOUBLE_CHECKED(x, args[0]);
|
||||
CONVERT_DOUBLE_CHECKED(y, args[1]);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(x, 0);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(y, 1);
|
||||
if (y == 0) {
|
||||
return Smi::FromInt(1);
|
||||
} else if (isnan(y) || ((x == 1 || x == -1) && isinf(y))) {
|
||||
@ -6934,7 +6931,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_sin) {
|
||||
ASSERT(args.length() == 1);
|
||||
isolate->counters()->math_sin()->Increment();
|
||||
|
||||
CONVERT_DOUBLE_CHECKED(x, args[0]);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(x, 0);
|
||||
return isolate->transcendental_cache()->Get(TranscendentalCache::SIN, x);
|
||||
}
|
||||
|
||||
@ -6944,7 +6941,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_sqrt) {
|
||||
ASSERT(args.length() == 1);
|
||||
isolate->counters()->math_sqrt()->Increment();
|
||||
|
||||
CONVERT_DOUBLE_CHECKED(x, args[0]);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(x, 0);
|
||||
return isolate->heap()->AllocateHeapNumber(sqrt(x));
|
||||
}
|
||||
|
||||
@ -6954,7 +6951,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_tan) {
|
||||
ASSERT(args.length() == 1);
|
||||
isolate->counters()->math_tan()->Increment();
|
||||
|
||||
CONVERT_DOUBLE_CHECKED(x, args[0]);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(x, 0);
|
||||
return isolate->transcendental_cache()->Get(TranscendentalCache::TAN, x);
|
||||
}
|
||||
|
||||
@ -7008,9 +7005,9 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DateMakeDay) {
|
||||
NoHandleAllocation ha;
|
||||
ASSERT(args.length() == 3);
|
||||
|
||||
CONVERT_SMI_CHECKED(year, args[0]);
|
||||
CONVERT_SMI_CHECKED(month, args[1]);
|
||||
CONVERT_SMI_CHECKED(date, args[2]);
|
||||
CONVERT_SMI_ARG_CHECKED(year, 0);
|
||||
CONVERT_SMI_ARG_CHECKED(month, 1);
|
||||
CONVERT_SMI_ARG_CHECKED(date, 2);
|
||||
|
||||
return Smi::FromInt(MakeDay(year, month, date));
|
||||
}
|
||||
@ -7307,7 +7304,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DateYMDFromTime) {
|
||||
NoHandleAllocation ha;
|
||||
ASSERT(args.length() == 2);
|
||||
|
||||
CONVERT_DOUBLE_CHECKED(t, args[0]);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(t, 0);
|
||||
CONVERT_CHECKED(JSArray, res_array, args[1]);
|
||||
|
||||
int year, month, day;
|
||||
@ -7332,7 +7329,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NewArgumentsFast) {
|
||||
|
||||
JSFunction* callee = JSFunction::cast(args[0]);
|
||||
Object** parameters = reinterpret_cast<Object**>(args[1]);
|
||||
const int length = Smi::cast(args[2])->value();
|
||||
const int length = args.smi_at(2);
|
||||
|
||||
Object* result;
|
||||
{ MaybeObject* maybe_result =
|
||||
@ -7633,7 +7630,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NotifyDeoptimized) {
|
||||
ASSERT(args.length() == 1);
|
||||
RUNTIME_ASSERT(args[0]->IsSmi());
|
||||
Deoptimizer::BailoutType type =
|
||||
static_cast<Deoptimizer::BailoutType>(Smi::cast(args[0])->value());
|
||||
static_cast<Deoptimizer::BailoutType>(args.smi_at(0));
|
||||
Deoptimizer* deoptimizer = Deoptimizer::Grab(isolate);
|
||||
ASSERT(isolate->heap()->IsAllocationAllowed());
|
||||
int frames = deoptimizer->output_count();
|
||||
@ -8143,7 +8140,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_StoreContextSlot) {
|
||||
Handle<Object> value(args[0], isolate);
|
||||
CONVERT_ARG_CHECKED(Context, context, 1);
|
||||
CONVERT_ARG_CHECKED(String, name, 2);
|
||||
CONVERT_SMI_CHECKED(strict_unchecked, args[3]);
|
||||
CONVERT_SMI_ARG_CHECKED(strict_unchecked, 3);
|
||||
RUNTIME_ASSERT(strict_unchecked == kStrictMode ||
|
||||
strict_unchecked == kNonStrictMode);
|
||||
StrictModeFlag strict_mode = static_cast<StrictModeFlag>(strict_unchecked);
|
||||
@ -8457,7 +8454,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DateLocalTimezone) {
|
||||
NoHandleAllocation ha;
|
||||
ASSERT(args.length() == 1);
|
||||
|
||||
CONVERT_DOUBLE_CHECKED(x, args[0]);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(x, 0);
|
||||
const char* zone = OS::LocalTimezone(x);
|
||||
return isolate->heap()->AllocateStringFromUtf8(CStrVector(zone));
|
||||
}
|
||||
@ -8475,7 +8472,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DateDaylightSavingsOffset) {
|
||||
NoHandleAllocation ha;
|
||||
ASSERT(args.length() == 1);
|
||||
|
||||
CONVERT_DOUBLE_CHECKED(x, args[0]);
|
||||
CONVERT_DOUBLE_ARG_CHECKED(x, 0);
|
||||
return isolate->heap()->NumberFromDouble(OS::DaylightSavingsOffset(x));
|
||||
}
|
||||
|
||||
@ -8649,8 +8646,7 @@ RUNTIME_FUNCTION(ObjectPair, Runtime_ResolvePossiblyDirectEval) {
|
||||
return CompileGlobalEval(isolate,
|
||||
args.at<String>(1),
|
||||
args.at<Object>(2),
|
||||
static_cast<StrictModeFlag>(
|
||||
Smi::cast(args[3])->value()));
|
||||
static_cast<StrictModeFlag>(args.smi_at(3)));
|
||||
}
|
||||
|
||||
|
||||
@ -8671,8 +8667,7 @@ RUNTIME_FUNCTION(ObjectPair, Runtime_ResolvePossiblyDirectEvalNoLookup) {
|
||||
return CompileGlobalEval(isolate,
|
||||
args.at<String>(1),
|
||||
args.at<Object>(2),
|
||||
static_cast<StrictModeFlag>(
|
||||
Smi::cast(args[3])->value()));
|
||||
static_cast<StrictModeFlag>(args.smi_at(3)));
|
||||
}
|
||||
|
||||
|
||||
@ -11731,7 +11726,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_CaptureLOL) {
|
||||
// Deletes the specified live object list.
|
||||
RUNTIME_FUNCTION(MaybeObject*, Runtime_DeleteLOL) {
|
||||
#ifdef LIVE_OBJECT_LIST
|
||||
CONVERT_SMI_CHECKED(id, args[0]);
|
||||
CONVERT_SMI_ARG_CHECKED(id, 0);
|
||||
bool success = LiveObjectList::Delete(id);
|
||||
return success ? isolate->heap()->true_value() :
|
||||
isolate->heap()->false_value();
|
||||
@ -11749,10 +11744,10 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DeleteLOL) {
|
||||
RUNTIME_FUNCTION(MaybeObject*, Runtime_DumpLOL) {
|
||||
#ifdef LIVE_OBJECT_LIST
|
||||
HandleScope scope;
|
||||
CONVERT_SMI_CHECKED(id1, args[0]);
|
||||
CONVERT_SMI_CHECKED(id2, args[1]);
|
||||
CONVERT_SMI_CHECKED(start, args[2]);
|
||||
CONVERT_SMI_CHECKED(count, args[3]);
|
||||
CONVERT_SMI_ARG_CHECKED(id1, 0);
|
||||
CONVERT_SMI_ARG_CHECKED(id2, 1);
|
||||
CONVERT_SMI_ARG_CHECKED(start, 2);
|
||||
CONVERT_SMI_ARG_CHECKED(count, 3);
|
||||
CONVERT_ARG_CHECKED(JSObject, filter_obj, 4);
|
||||
EnterDebugger enter_debugger;
|
||||
return LiveObjectList::Dump(id1, id2, start, count, filter_obj);
|
||||
@ -11766,7 +11761,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DumpLOL) {
|
||||
// This is only used for obj ids shown in live object lists.
|
||||
RUNTIME_FUNCTION(MaybeObject*, Runtime_GetLOLObj) {
|
||||
#ifdef LIVE_OBJECT_LIST
|
||||
CONVERT_SMI_CHECKED(obj_id, args[0]);
|
||||
CONVERT_SMI_ARG_CHECKED(obj_id, 0);
|
||||
Object* result = LiveObjectList::GetObj(obj_id);
|
||||
return result;
|
||||
#else
|
||||
@ -11793,7 +11788,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GetLOLObjId) {
|
||||
RUNTIME_FUNCTION(MaybeObject*, Runtime_GetLOLObjRetainers) {
|
||||
#ifdef LIVE_OBJECT_LIST
|
||||
HandleScope scope;
|
||||
CONVERT_SMI_CHECKED(obj_id, args[0]);
|
||||
CONVERT_SMI_ARG_CHECKED(obj_id, 0);
|
||||
RUNTIME_ASSERT(args[1]->IsUndefined() || args[1]->IsJSObject());
|
||||
RUNTIME_ASSERT(args[2]->IsUndefined() || args[2]->IsBoolean());
|
||||
RUNTIME_ASSERT(args[3]->IsUndefined() || args[3]->IsSmi());
|
||||
@ -11810,11 +11805,11 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GetLOLObjRetainers) {
|
||||
}
|
||||
int start = 0;
|
||||
if (args[3]->IsSmi()) {
|
||||
start = Smi::cast(args[3])->value();
|
||||
start = args.smi_at(3);
|
||||
}
|
||||
int limit = Smi::kMaxValue;
|
||||
if (args[4]->IsSmi()) {
|
||||
limit = Smi::cast(args[4])->value();
|
||||
limit = args.smi_at(4);
|
||||
}
|
||||
|
||||
return LiveObjectList::GetObjRetainers(obj_id,
|
||||
@ -11833,8 +11828,8 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GetLOLObjRetainers) {
|
||||
RUNTIME_FUNCTION(MaybeObject*, Runtime_GetLOLPath) {
|
||||
#ifdef LIVE_OBJECT_LIST
|
||||
HandleScope scope;
|
||||
CONVERT_SMI_CHECKED(obj_id1, args[0]);
|
||||
CONVERT_SMI_CHECKED(obj_id2, args[1]);
|
||||
CONVERT_SMI_ARG_CHECKED(obj_id1, 0);
|
||||
CONVERT_SMI_ARG_CHECKED(obj_id2, 1);
|
||||
RUNTIME_ASSERT(args[2]->IsUndefined() || args[2]->IsJSObject());
|
||||
|
||||
Handle<JSObject> instance_filter;
|
||||
@ -11855,8 +11850,8 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GetLOLPath) {
|
||||
// previously captured live object lists.
|
||||
RUNTIME_FUNCTION(MaybeObject*, Runtime_InfoLOL) {
|
||||
#ifdef LIVE_OBJECT_LIST
|
||||
CONVERT_SMI_CHECKED(start, args[0]);
|
||||
CONVERT_SMI_CHECKED(count, args[1]);
|
||||
CONVERT_SMI_ARG_CHECKED(start, 0);
|
||||
CONVERT_SMI_ARG_CHECKED(count, 1);
|
||||
return LiveObjectList::Info(start, count);
|
||||
#else
|
||||
return isolate->heap()->undefined_value();
|
||||
@ -11869,7 +11864,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_InfoLOL) {
|
||||
RUNTIME_FUNCTION(MaybeObject*, Runtime_PrintLOLObj) {
|
||||
#ifdef LIVE_OBJECT_LIST
|
||||
HandleScope scope;
|
||||
CONVERT_SMI_CHECKED(obj_id, args[0]);
|
||||
CONVERT_SMI_ARG_CHECKED(obj_id, 0);
|
||||
Object* result = LiveObjectList::PrintObj(obj_id);
|
||||
return result;
|
||||
#else
|
||||
@ -11897,8 +11892,8 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_ResetLOL) {
|
||||
RUNTIME_FUNCTION(MaybeObject*, Runtime_SummarizeLOL) {
|
||||
#ifdef LIVE_OBJECT_LIST
|
||||
HandleScope scope;
|
||||
CONVERT_SMI_CHECKED(id1, args[0]);
|
||||
CONVERT_SMI_CHECKED(id2, args[1]);
|
||||
CONVERT_SMI_ARG_CHECKED(id1, 0);
|
||||
CONVERT_SMI_ARG_CHECKED(id2, 1);
|
||||
CONVERT_ARG_CHECKED(JSObject, filter_obj, 2);
|
||||
|
||||
EnterDebugger enter_debugger;
|
||||
@ -12088,8 +12083,8 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GetV8Version) {
|
||||
|
||||
RUNTIME_FUNCTION(MaybeObject*, Runtime_Abort) {
|
||||
ASSERT(args.length() == 2);
|
||||
OS::PrintError("abort: %s\n", reinterpret_cast<char*>(args[0]) +
|
||||
Smi::cast(args[1])->value());
|
||||
OS::PrintError("abort: %s\n",
|
||||
reinterpret_cast<char*>(args[0]) + args.smi_at(1));
|
||||
isolate->PrintStack();
|
||||
OS::Abort();
|
||||
UNREACHABLE();
|
||||
|
@ -1370,8 +1370,7 @@ RUNTIME_FUNCTION(MaybeObject*, StoreInterceptorProperty) {
|
||||
JSObject* recv = JSObject::cast(args[0]);
|
||||
String* name = String::cast(args[1]);
|
||||
Object* value = args[2];
|
||||
StrictModeFlag strict_mode =
|
||||
static_cast<StrictModeFlag>(Smi::cast(args[3])->value());
|
||||
StrictModeFlag strict_mode = static_cast<StrictModeFlag>(args.smi_at(3));
|
||||
ASSERT(strict_mode == kStrictMode || strict_mode == kNonStrictMode);
|
||||
ASSERT(recv->HasNamedInterceptor());
|
||||
PropertyAttributes attr = NONE;
|
||||
@ -1383,8 +1382,8 @@ RUNTIME_FUNCTION(MaybeObject*, StoreInterceptorProperty) {
|
||||
|
||||
RUNTIME_FUNCTION(MaybeObject*, KeyedLoadPropertyWithInterceptor) {
|
||||
JSObject* receiver = JSObject::cast(args[0]);
|
||||
ASSERT(Smi::cast(args[1])->value() >= 0);
|
||||
uint32_t index = Smi::cast(args[1])->value();
|
||||
ASSERT(args.smi_at(1) >= 0);
|
||||
uint32_t index = args.smi_at(1);
|
||||
return receiver->GetElementWithInterceptor(receiver, index);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user