| OLD | NEW |
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 8122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8133 | 8133 |
| 8134 CONVERT_ARG_CHECKED(JSObject, obj, 0); | 8134 CONVERT_ARG_CHECKED(JSObject, obj, 0); |
| 8135 CONVERT_ARG_CHECKED(String, name, 1); | 8135 CONVERT_ARG_CHECKED(String, name, 1); |
| 8136 | 8136 |
| 8137 // Make sure to set the current context to the context before the debugger was | 8137 // Make sure to set the current context to the context before the debugger was |
| 8138 // entered (if the debugger is entered). The reason for switching context here | 8138 // entered (if the debugger is entered). The reason for switching context here |
| 8139 // is that for some property lookups (accessors and interceptors) callbacks | 8139 // is that for some property lookups (accessors and interceptors) callbacks |
| 8140 // into the embedding application can occour, and the embedding application | 8140 // into the embedding application can occour, and the embedding application |
| 8141 // could have the assumption that its own global context is the current | 8141 // could have the assumption that its own global context is the current |
| 8142 // context and not some internal debugger context. | 8142 // context and not some internal debugger context. |
| 8143 SaveContext save; | 8143 SaveContext save(isolate); |
| 8144 if (isolate->debug()->InDebugger()) { | 8144 if (isolate->debug()->InDebugger()) { |
| 8145 isolate->set_context(*isolate->debug()->debugger_entry()->GetContext()); | 8145 isolate->set_context(*isolate->debug()->debugger_entry()->GetContext()); |
| 8146 } | 8146 } |
| 8147 | 8147 |
| 8148 // Skip the global proxy as it has no properties and always delegates to the | 8148 // Skip the global proxy as it has no properties and always delegates to the |
| 8149 // real global object. | 8149 // real global object. |
| 8150 if (obj->IsJSGlobalProxy()) { | 8150 if (obj->IsJSGlobalProxy()) { |
| 8151 obj = Handle<JSObject>(JSObject::cast(obj->GetPrototype())); | 8151 obj = Handle<JSObject>(JSObject::cast(obj->GetPrototype())); |
| 8152 } | 8152 } |
| 8153 | 8153 |
| (...skipping 1366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9520 Handle<SerializedScopeInfo> scope_info(function->shared()->scope_info()); | 9520 Handle<SerializedScopeInfo> scope_info(function->shared()->scope_info()); |
| 9521 ScopeInfo<> sinfo(*scope_info); | 9521 ScopeInfo<> sinfo(*scope_info); |
| 9522 | 9522 |
| 9523 // Traverse the saved contexts chain to find the active context for the | 9523 // Traverse the saved contexts chain to find the active context for the |
| 9524 // selected frame. | 9524 // selected frame. |
| 9525 SaveContext* save = isolate->save_context(); | 9525 SaveContext* save = isolate->save_context(); |
| 9526 while (save != NULL && !save->below(frame)) { | 9526 while (save != NULL && !save->below(frame)) { |
| 9527 save = save->prev(); | 9527 save = save->prev(); |
| 9528 } | 9528 } |
| 9529 ASSERT(save != NULL); | 9529 ASSERT(save != NULL); |
| 9530 SaveContext savex; | 9530 SaveContext savex(isolate); |
| 9531 isolate->set_context(*(save->context())); | 9531 isolate->set_context(*(save->context())); |
| 9532 | 9532 |
| 9533 // Create the (empty) function replacing the function on the stack frame for | 9533 // Create the (empty) function replacing the function on the stack frame for |
| 9534 // the purpose of evaluating in the context created below. It is important | 9534 // the purpose of evaluating in the context created below. It is important |
| 9535 // that this function does not describe any parameters and local variables | 9535 // that this function does not describe any parameters and local variables |
| 9536 // in the context. If it does then this will cause problems with the lookup | 9536 // in the context. If it does then this will cause problems with the lookup |
| 9537 // in Context::Lookup, where context slots for parameters and local variables | 9537 // in Context::Lookup, where context slots for parameters and local variables |
| 9538 // are looked at before the extension object. | 9538 // are looked at before the extension object. |
| 9539 Handle<JSFunction> go_between = | 9539 Handle<JSFunction> go_between = |
| 9540 isolate->factory()->NewFunction(isolate->factory()->empty_string(), | 9540 isolate->factory()->NewFunction(isolate->factory()->empty_string(), |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9619 ASSERT(args.length() == 3); | 9619 ASSERT(args.length() == 3); |
| 9620 Object* check_result = Runtime_CheckExecutionState(args, isolate); | 9620 Object* check_result = Runtime_CheckExecutionState(args, isolate); |
| 9621 if (check_result->IsFailure()) return check_result; | 9621 if (check_result->IsFailure()) return check_result; |
| 9622 CONVERT_ARG_CHECKED(String, source, 1); | 9622 CONVERT_ARG_CHECKED(String, source, 1); |
| 9623 CONVERT_BOOLEAN_CHECKED(disable_break, args[2]); | 9623 CONVERT_BOOLEAN_CHECKED(disable_break, args[2]); |
| 9624 | 9624 |
| 9625 // Handle the processing of break. | 9625 // Handle the processing of break. |
| 9626 DisableBreak disable_break_save(disable_break); | 9626 DisableBreak disable_break_save(disable_break); |
| 9627 | 9627 |
| 9628 // Enter the top context from before the debugger was invoked. | 9628 // Enter the top context from before the debugger was invoked. |
| 9629 SaveContext save; | 9629 SaveContext save(isolate); |
| 9630 SaveContext* top = &save; | 9630 SaveContext* top = &save; |
| 9631 while (top != NULL && *top->context() == *isolate->debug()->debug_context()) { | 9631 while (top != NULL && *top->context() == *isolate->debug()->debug_context()) { |
| 9632 top = top->prev(); | 9632 top = top->prev(); |
| 9633 } | 9633 } |
| 9634 if (top != NULL) { | 9634 if (top != NULL) { |
| 9635 isolate->set_context(*top->context()); | 9635 isolate->set_context(*top->context()); |
| 9636 } | 9636 } |
| 9637 | 9637 |
| 9638 // Get the global context now set to the top context from before the | 9638 // Get the global context now set to the top context from before the |
| 9639 // debugger was invoked. | 9639 // debugger was invoked. |
| (...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10625 #define SETUP_RUNTIME_ENTRIES(Name, argc, resize) \ | 10625 #define SETUP_RUNTIME_ENTRIES(Name, argc, resize) \ |
| 10626 entries_[lut_index].method = &CodeGenerator::Generate##Name; \ | 10626 entries_[lut_index].method = &CodeGenerator::Generate##Name; \ |
| 10627 entries_[lut_index].name = "_" #Name; \ | 10627 entries_[lut_index].name = "_" #Name; \ |
| 10628 entries_[lut_index++].nargs = argc; | 10628 entries_[lut_index++].nargs = argc; |
| 10629 INLINE_RUNTIME_FUNCTION_LIST(SETUP_RUNTIME_ENTRIES); | 10629 INLINE_RUNTIME_FUNCTION_LIST(SETUP_RUNTIME_ENTRIES); |
| 10630 #undef SETUP_RUNTIME_ENTRIES | 10630 #undef SETUP_RUNTIME_ENTRIES |
| 10631 } | 10631 } |
| 10632 | 10632 |
| 10633 | 10633 |
| 10634 } } // namespace v8::internal | 10634 } } // namespace v8::internal |
| OLD | NEW |