Chromium Code Reviews| 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 12252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 12263 RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugGetPrototype) { | 12263 RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugGetPrototype) { |
| 12264 ASSERT(args.length() == 1); | 12264 ASSERT(args.length() == 1); |
| 12265 | 12265 |
| 12266 CONVERT_ARG_CHECKED(JSObject, obj, 0); | 12266 CONVERT_ARG_CHECKED(JSObject, obj, 0); |
| 12267 | 12267 |
| 12268 // Use the __proto__ accessor. | 12268 // Use the __proto__ accessor. |
| 12269 return Accessors::ObjectPrototype.getter(obj, NULL); | 12269 return Accessors::ObjectPrototype.getter(obj, NULL); |
| 12270 } | 12270 } |
| 12271 | 12271 |
| 12272 | 12272 |
| 12273 // Returns internal property PrimitiveValue value for standard objects | |
| 12274 // Boolean, Number and String (not for Date). Otherwise returns undefined. | |
| 12275 // args[0]: the object that possibly holds PrimitiveValue property. | |
| 12276 RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugGetPrimitiveValue) { | |
| 12277 ASSERT(args.length() == 1); | |
| 12278 | |
| 12279 CONVERT_ARG_CHECKED(JSObject, obj, 0); | |
| 12280 | |
| 12281 if (!obj->IsJSValue()) { | |
| 12282 return isolate->heap()->undefined_value(); | |
| 12283 } | |
| 12284 JSValue* value = JSValue::cast(obj); | |
| 12285 | |
| 12286 return value->value(); | |
| 12287 } | |
|
Yang
2012/04/17 12:48:44
This seems to do the same as %_ValueOf (see FullCo
Peter Rybin
2012/04/18 12:36:09
Done.
| |
| 12288 | |
| 12289 | |
| 12273 // Patches script source (should be called upon BeforeCompile event). | 12290 // Patches script source (should be called upon BeforeCompile event). |
| 12274 RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugSetScriptSource) { | 12291 RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugSetScriptSource) { |
| 12275 HandleScope scope(isolate); | 12292 HandleScope scope(isolate); |
| 12276 ASSERT(args.length() == 2); | 12293 ASSERT(args.length() == 2); |
| 12277 | 12294 |
| 12278 CONVERT_ARG_HANDLE_CHECKED(JSValue, script_wrapper, 0); | 12295 CONVERT_ARG_HANDLE_CHECKED(JSValue, script_wrapper, 0); |
| 12279 Handle<String> source(String::cast(args[1])); | 12296 Handle<String> source(String::cast(args[1])); |
| 12280 | 12297 |
| 12281 RUNTIME_ASSERT(script_wrapper->value()->IsScript()); | 12298 RUNTIME_ASSERT(script_wrapper->value()->IsScript()); |
| 12282 Handle<Script> script(Script::cast(script_wrapper->value())); | 12299 Handle<Script> script(Script::cast(script_wrapper->value())); |
| (...skipping 1071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 13354 // Handle last resort GC and make sure to allow future allocations | 13371 // Handle last resort GC and make sure to allow future allocations |
| 13355 // to grow the heap without causing GCs (if possible). | 13372 // to grow the heap without causing GCs (if possible). |
| 13356 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13373 isolate->counters()->gc_last_resort_from_js()->Increment(); |
| 13357 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 13374 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
| 13358 "Runtime::PerformGC"); | 13375 "Runtime::PerformGC"); |
| 13359 } | 13376 } |
| 13360 } | 13377 } |
| 13361 | 13378 |
| 13362 | 13379 |
| 13363 } } // namespace v8::internal | 13380 } } // namespace v8::internal |
| OLD | NEW |