| Index: src/runtime.cc
|
| diff --git a/src/runtime.cc b/src/runtime.cc
|
| index 878ae1588e009c81466ea5f05b137274fa198b5d..e4a9c219e3801edf43d130c4ba0c17a368206318 100644
|
| --- a/src/runtime.cc
|
| +++ b/src/runtime.cc
|
| @@ -685,10 +685,10 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GetConstructTrap) {
|
|
|
|
|
| RUNTIME_FUNCTION(MaybeObject*, Runtime_Fix) {
|
| - SealHandleScope shs(isolate);
|
| + HandleScope scope(isolate);
|
| ASSERT(args.length() == 1);
|
| - CONVERT_ARG_CHECKED(JSProxy, proxy, 0);
|
| - proxy->Fix();
|
| + CONVERT_ARG_HANDLE_CHECKED(JSProxy, proxy, 0);
|
| + JSProxy::Fix(proxy);
|
| return isolate->heap()->undefined_value();
|
| }
|
|
|
| @@ -4722,6 +4722,19 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberToPrecision) {
|
| }
|
|
|
|
|
| +RUNTIME_FUNCTION(MaybeObject*, Runtime_IsValidSmi) {
|
| + HandleScope shs(isolate);
|
| + ASSERT(args.length() == 1);
|
| +
|
| + CONVERT_NUMBER_CHECKED(int32_t, number, Int32, args[0]);
|
| + if (Smi::IsValid(number)) {
|
| + return isolate->heap()->true_value();
|
| + } else {
|
| + return isolate->heap()->false_value();
|
| + }
|
| +}
|
| +
|
| +
|
| // Returns a single character string where first character equals
|
| // string->Get(index).
|
| static Handle<Object> GetCharAt(Handle<String> string, uint32_t index) {
|
| @@ -8649,12 +8662,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_CompileForOnStackReplacement) {
|
| function->PrintName();
|
| PrintF("]\n");
|
| }
|
| - InterruptStub interrupt_stub;
|
| - Handle<Code> interrupt_code = interrupt_stub.GetCode(isolate);
|
| - Handle<Code> replacement_code = isolate->builtins()->OnStackReplacement();
|
| - Deoptimizer::RevertInterruptCode(*unoptimized,
|
| - *interrupt_code,
|
| - *replacement_code);
|
| + Deoptimizer::RevertInterruptCode(isolate, *unoptimized);
|
|
|
| // If the optimization attempt succeeded, return the AST id tagged as a
|
| // smi. This tells the builtin that we need to translate the unoptimized
|
| @@ -8984,7 +8992,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DeclareModules) {
|
| IsImmutableVariableMode(mode) ? FROZEN : SEALED;
|
| Handle<AccessorInfo> info =
|
| Accessors::MakeModuleExport(name, index, attr);
|
| - Handle<Object> result = SetAccessor(module, info);
|
| + Handle<Object> result = JSObject::SetAccessor(module, info);
|
| ASSERT(!(result.is_null() || result->IsUndefined()));
|
| USE(result);
|
| break;
|
| @@ -12068,6 +12076,8 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GetStepInPositions) {
|
| // Get the frame where the debugging is performed.
|
| StackFrame::Id id = UnwrapFrameId(wrapped_id);
|
| JavaScriptFrameIterator frame_it(isolate, id);
|
| + RUNTIME_ASSERT(!frame_it.done());
|
| +
|
| JavaScriptFrame* frame = frame_it.frame();
|
|
|
| Handle<JSFunction> fun =
|
| @@ -12087,11 +12097,28 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GetStepInPositions) {
|
| BreakLocationIterator break_location_iterator(debug_info,
|
| ALL_BREAK_LOCATIONS);
|
|
|
| - break_location_iterator.FindBreakLocationFromAddress(frame->pc());
|
| + break_location_iterator.FindBreakLocationFromAddress(frame->pc() - 1);
|
| int current_statement_pos = break_location_iterator.statement_position();
|
|
|
| while (!break_location_iterator.Done()) {
|
| + bool accept;
|
| if (break_location_iterator.pc() > frame->pc()) {
|
| + accept = true;
|
| + } else {
|
| + StackFrame::Id break_frame_id = isolate->debug()->break_frame_id();
|
| + // The break point is near our pc. Could be a step-in possibility,
|
| + // that is currently taken by active debugger call.
|
| + if (break_frame_id == StackFrame::NO_ID) {
|
| + // We are not stepping.
|
| + accept = false;
|
| + } else {
|
| + JavaScriptFrameIterator additional_frame_it(isolate, break_frame_id);
|
| + // If our frame is a top frame and we are stepping, we can do step-in
|
| + // at this place.
|
| + accept = additional_frame_it.frame()->id() == id;
|
| + }
|
| + }
|
| + if (accept) {
|
| if (break_location_iterator.IsStepInLocation(isolate)) {
|
| Smi* position_value = Smi::FromInt(break_location_iterator.position());
|
| JSObject::SetElement(array, len,
|
| @@ -14148,13 +14175,13 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_CollectStackTrace) {
|
| RUNTIME_FUNCTION(MaybeObject*, Runtime_GetAndClearOverflowedStackTrace) {
|
| HandleScope scope(isolate);
|
| ASSERT_EQ(args.length(), 1);
|
| - CONVERT_ARG_CHECKED(JSObject, error_object, 0);
|
| - String* key = isolate->heap()->hidden_stack_trace_string();
|
| - Object* result = error_object->GetHiddenProperty(key);
|
| + CONVERT_ARG_HANDLE_CHECKED(JSObject, error_object, 0);
|
| + Handle<String> key = isolate->factory()->hidden_stack_trace_string();
|
| + Handle<Object> result(error_object->GetHiddenProperty(*key), isolate);
|
| if (result->IsTheHole()) return isolate->heap()->undefined_value();
|
| RUNTIME_ASSERT(result->IsJSArray() || result->IsUndefined());
|
| - error_object->DeleteHiddenProperty(key);
|
| - return result;
|
| + JSObject::DeleteHiddenProperty(error_object, key);
|
| + return *result;
|
| }
|
|
|
|
|
|
|