| 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 22 matching lines...) Expand all Loading... |
| 33 #include "ast.h" | 33 #include "ast.h" |
| 34 #include "bootstrapper.h" | 34 #include "bootstrapper.h" |
| 35 #include "codegen.h" | 35 #include "codegen.h" |
| 36 #include "compilation-cache.h" | 36 #include "compilation-cache.h" |
| 37 #include "cpu-profiler.h" | 37 #include "cpu-profiler.h" |
| 38 #include "debug.h" | 38 #include "debug.h" |
| 39 #include "deoptimizer.h" | 39 #include "deoptimizer.h" |
| 40 #include "heap-profiler.h" | 40 #include "heap-profiler.h" |
| 41 #include "hydrogen.h" | 41 #include "hydrogen.h" |
| 42 #include "isolate-inl.h" | 42 #include "isolate-inl.h" |
| 43 #include "lexer/experimental-scanner.h" |
| 43 #include "lithium-allocator.h" | 44 #include "lithium-allocator.h" |
| 44 #include "log.h" | 45 #include "log.h" |
| 45 #include "messages.h" | 46 #include "messages.h" |
| 46 #include "platform.h" | 47 #include "platform.h" |
| 47 #include "regexp-stack.h" | 48 #include "regexp-stack.h" |
| 48 #include "runtime-profiler.h" | 49 #include "runtime-profiler.h" |
| 49 #include "sampler.h" | 50 #include "sampler.h" |
| 50 #include "scopeinfo.h" | 51 #include "scopeinfo.h" |
| 51 #include "serialize.h" | 52 #include "serialize.h" |
| 52 #include "simulator.h" | 53 #include "simulator.h" |
| (...skipping 1238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1291 for (Object* prototype = *obj; !prototype->IsNull(); | 1292 for (Object* prototype = *obj; !prototype->IsNull(); |
| 1292 prototype = prototype->GetPrototype(this)) { | 1293 prototype = prototype->GetPrototype(this)) { |
| 1293 if (!prototype->IsJSObject()) return false; | 1294 if (!prototype->IsJSObject()) return false; |
| 1294 if (JSObject::cast(prototype)->map()->constructor() == error_constructor) { | 1295 if (JSObject::cast(prototype)->map()->constructor() == error_constructor) { |
| 1295 return true; | 1296 return true; |
| 1296 } | 1297 } |
| 1297 } | 1298 } |
| 1298 return false; | 1299 return false; |
| 1299 } | 1300 } |
| 1300 | 1301 |
| 1302 |
| 1303 void Isolate::UpdateScannersAfterGC(v8::Isolate* isolate, |
| 1304 GCType, |
| 1305 GCCallbackFlags) { |
| 1306 reinterpret_cast<i::Isolate*>(isolate)->UpdateScannersAfterGC(); |
| 1307 } |
| 1308 |
| 1309 |
| 1310 void Isolate::UpdateScannersAfterGC() { |
| 1311 for (std::set<ScannerBase*>::const_iterator it = scanners_.begin(); |
| 1312 it != scanners_.end(); |
| 1313 ++it) |
| 1314 (*it)->UpdateBufferBasedOnHandle(); |
| 1315 } |
| 1316 |
| 1317 |
| 1301 static int fatal_exception_depth = 0; | 1318 static int fatal_exception_depth = 0; |
| 1302 | 1319 |
| 1303 void Isolate::DoThrow(Object* exception, MessageLocation* location) { | 1320 void Isolate::DoThrow(Object* exception, MessageLocation* location) { |
| 1304 ASSERT(!has_pending_exception()); | 1321 ASSERT(!has_pending_exception()); |
| 1305 | 1322 |
| 1306 HandleScope scope(this); | 1323 HandleScope scope(this); |
| 1307 Handle<Object> exception_handle(exception, this); | 1324 Handle<Object> exception_handle(exception, this); |
| 1308 | 1325 |
| 1309 // Determine reporting and whether the exception is caught externally. | 1326 // Determine reporting and whether the exception is caught externally. |
| 1310 bool catchable_by_javascript = is_catchable_by_javascript(exception); | 1327 bool catchable_by_javascript = is_catchable_by_javascript(exception); |
| (...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2514 Isolate::code_stub_interface_descriptor(int index) { | 2531 Isolate::code_stub_interface_descriptor(int index) { |
| 2515 return code_stub_interface_descriptors_ + index; | 2532 return code_stub_interface_descriptors_ + index; |
| 2516 } | 2533 } |
| 2517 | 2534 |
| 2518 | 2535 |
| 2519 Object* Isolate::FindCodeObject(Address a) { | 2536 Object* Isolate::FindCodeObject(Address a) { |
| 2520 return inner_pointer_to_code_cache()->GcSafeFindCodeForInnerPointer(a); | 2537 return inner_pointer_to_code_cache()->GcSafeFindCodeForInnerPointer(a); |
| 2521 } | 2538 } |
| 2522 | 2539 |
| 2523 | 2540 |
| 2541 void Isolate::AddScanner(ScannerBase* scanner) { |
| 2542 if (scanners_.empty()) { |
| 2543 heap()->AddGCEpilogueCallback( |
| 2544 &Isolate::UpdateScannersAfterGC, kGCTypeAll, false); |
| 2545 } |
| 2546 scanners_.insert(scanner); |
| 2547 } |
| 2548 |
| 2549 |
| 2550 void Isolate::RemoveScanner(ScannerBase* scanner) { |
| 2551 scanners_.erase(scanner); |
| 2552 if (scanners_.empty()) { |
| 2553 heap()->RemoveGCEpilogueCallback(&Isolate::UpdateScannersAfterGC); |
| 2554 } |
| 2555 } |
| 2556 |
| 2557 |
| 2524 #ifdef DEBUG | 2558 #ifdef DEBUG |
| 2525 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ | 2559 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ |
| 2526 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); | 2560 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); |
| 2527 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) | 2561 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) |
| 2528 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) | 2562 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) |
| 2529 #undef ISOLATE_FIELD_OFFSET | 2563 #undef ISOLATE_FIELD_OFFSET |
| 2530 #endif | 2564 #endif |
| 2531 | 2565 |
| 2532 } } // namespace v8::internal | 2566 } } // namespace v8::internal |
| OLD | NEW |