| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 12259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12270 RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugGetPrototype) { | 12270 RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugGetPrototype) { |
| 12271 ASSERT(args.length() == 1); | 12271 ASSERT(args.length() == 1); |
| 12272 | 12272 |
| 12273 CONVERT_ARG_CHECKED(JSObject, obj, 0); | 12273 CONVERT_ARG_CHECKED(JSObject, obj, 0); |
| 12274 | 12274 |
| 12275 // Use the __proto__ accessor. | 12275 // Use the __proto__ accessor. |
| 12276 return Accessors::ObjectPrototype.getter(obj, NULL); | 12276 return Accessors::ObjectPrototype.getter(obj, NULL); |
| 12277 } | 12277 } |
| 12278 | 12278 |
| 12279 | 12279 |
| 12280 // Patches script source (should be called upon BeforeCompile event). |
| 12281 RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugSetScriptSource) { |
| 12282 HandleScope scope(isolate); |
| 12283 ASSERT(args.length() == 2); |
| 12284 |
| 12285 CONVERT_ARG_HANDLE_CHECKED(JSValue, script_wrapper, 0); |
| 12286 Handle<String> source(String::cast(args[1])); |
| 12287 |
| 12288 RUNTIME_ASSERT(script_wrapper->value()->IsScript()); |
| 12289 Handle<Script> script(Script::cast(script_wrapper->value())); |
| 12290 |
| 12291 int compilation_state = Smi::cast(script->compilation_state())->value(); |
| 12292 RUNTIME_ASSERT(compilation_state == Script::COMPILATION_STATE_INITIAL); |
| 12293 script->set_source(*source); |
| 12294 |
| 12295 return isolate->heap()->undefined_value(); |
| 12296 } |
| 12297 |
| 12298 |
| 12280 RUNTIME_FUNCTION(MaybeObject*, Runtime_SystemBreak) { | 12299 RUNTIME_FUNCTION(MaybeObject*, Runtime_SystemBreak) { |
| 12281 ASSERT(args.length() == 0); | 12300 ASSERT(args.length() == 0); |
| 12282 CPU::DebugBreak(); | 12301 CPU::DebugBreak(); |
| 12283 return isolate->heap()->undefined_value(); | 12302 return isolate->heap()->undefined_value(); |
| 12284 } | 12303 } |
| 12285 | 12304 |
| 12286 | 12305 |
| 12287 RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugDisassembleFunction) { | 12306 RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugDisassembleFunction) { |
| 12288 #ifdef DEBUG | 12307 #ifdef DEBUG |
| 12289 HandleScope scope(isolate); | 12308 HandleScope scope(isolate); |
| (...skipping 1052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13342 // Handle last resort GC and make sure to allow future allocations | 13361 // Handle last resort GC and make sure to allow future allocations |
| 13343 // to grow the heap without causing GCs (if possible). | 13362 // to grow the heap without causing GCs (if possible). |
| 13344 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13363 isolate->counters()->gc_last_resort_from_js()->Increment(); |
| 13345 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 13364 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
| 13346 "Runtime::PerformGC"); | 13365 "Runtime::PerformGC"); |
| 13347 } | 13366 } |
| 13348 } | 13367 } |
| 13349 | 13368 |
| 13350 | 13369 |
| 13351 } } // namespace v8::internal | 13370 } } // namespace v8::internal |
| OLD | NEW |