Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(725)

Side by Side Diff: src/isolate.h

Issue 16578008: Improved function entry hook coverage (Closed) Base URL: https://chromium.googlesource.com/external/v8.git@post_fix
Patch Set: Remove reliance on space->Contains check, which is only valid for V8-allocated memory. Go to unsign… Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« src/ic.cc ('K') | « src/ic.cc ('k') | src/isolate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 Address get_address_from_id(AddressId id); 542 Address get_address_from_id(AddressId id);
543 543
544 // Access to top context (where the current function object was created). 544 // Access to top context (where the current function object was created).
545 Context* context() { return thread_local_top_.context_; } 545 Context* context() { return thread_local_top_.context_; }
546 void set_context(Context* context) { 546 void set_context(Context* context) {
547 ASSERT(context == NULL || context->IsContext()); 547 ASSERT(context == NULL || context->IsContext());
548 thread_local_top_.context_ = context; 548 thread_local_top_.context_ = context;
549 } 549 }
550 Context** context_address() { return &thread_local_top_.context_; } 550 Context** context_address() { return &thread_local_top_.context_; }
551 551
552 SaveContext* save_context() {return thread_local_top_.save_context_; } 552 SaveContext* save_context() { return thread_local_top_.save_context_; }
553 void set_save_context(SaveContext* save) { 553 void set_save_context(SaveContext* save) {
554 thread_local_top_.save_context_ = save; 554 thread_local_top_.save_context_ = save;
555 } 555 }
556 556
557 // Access to current thread id. 557 // Access to current thread id.
558 ThreadId thread_id() { return thread_local_top_.thread_id_; } 558 ThreadId thread_id() { return thread_local_top_.thread_id_; }
559 void set_thread_id(ThreadId id) { thread_local_top_.thread_id_ = id; } 559 void set_thread_id(ThreadId id) { thread_local_top_.thread_id_ = id; }
560 560
561 // Interface to pending exception. 561 // Interface to pending exception.
562 MaybeObject* pending_exception() { 562 MaybeObject* pending_exception() {
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
1046 thread_local_top_.top_lookup_result_ = top; 1046 thread_local_top_.top_lookup_result_ = top;
1047 } 1047 }
1048 1048
1049 bool context_exit_happened() { 1049 bool context_exit_happened() {
1050 return context_exit_happened_; 1050 return context_exit_happened_;
1051 } 1051 }
1052 void set_context_exit_happened(bool context_exit_happened) { 1052 void set_context_exit_happened(bool context_exit_happened) {
1053 context_exit_happened_ = context_exit_happened; 1053 context_exit_happened_ = context_exit_happened;
1054 } 1054 }
1055 1055
1056 bool initialized_from_snapshot() { return initialized_from_snapshot_; }
1057
1056 double time_millis_since_init() { 1058 double time_millis_since_init() {
1057 return OS::TimeCurrentMillis() - time_millis_at_init_; 1059 return OS::TimeCurrentMillis() - time_millis_at_init_;
1058 } 1060 }
1059 1061
1060 DateCache* date_cache() { 1062 DateCache* date_cache() {
1061 return date_cache_; 1063 return date_cache_;
1062 } 1064 }
1063 1065
1064 void set_date_cache(DateCache* date_cache) { 1066 void set_date_cache(DateCache* date_cache) {
1065 if (date_cache != date_cache_) { 1067 if (date_cache != date_cache_) {
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
1103 CallbackTable* callback_table() { 1105 CallbackTable* callback_table() {
1104 return callback_table_; 1106 return callback_table_;
1105 } 1107 }
1106 void set_callback_table(CallbackTable* callback_table) { 1108 void set_callback_table(CallbackTable* callback_table) {
1107 callback_table_ = callback_table; 1109 callback_table_ = callback_table;
1108 } 1110 }
1109 1111
1110 HStatistics* GetHStatistics(); 1112 HStatistics* GetHStatistics();
1111 HTracer* GetHTracer(); 1113 HTracer* GetHTracer();
1112 1114
1115 FunctionEntryHook function_entry_hook() { return function_entry_hook_; }
1116 void set_function_entry_hook(FunctionEntryHook function_entry_hook) {
1117 function_entry_hook_ = function_entry_hook;
1118 }
1119
1113 private: 1120 private:
1114 Isolate(); 1121 Isolate();
1115 1122
1116 int id() const { return static_cast<int>(id_); } 1123 int id() const { return static_cast<int>(id_); }
1117 1124
1118 friend struct GlobalState; 1125 friend struct GlobalState;
1119 friend struct InitializeGlobalState; 1126 friend struct InitializeGlobalState;
1120 1127
1121 enum State { 1128 enum State {
1122 UNINITIALIZED, // Some components may not have been allocated. 1129 UNINITIALIZED, // Some components may not have been allocated.
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
1285 regexp_macro_assembler_canonicalize_; 1292 regexp_macro_assembler_canonicalize_;
1286 RegExpStack* regexp_stack_; 1293 RegExpStack* regexp_stack_;
1287 DateCache* date_cache_; 1294 DateCache* date_cache_;
1288 unibrow::Mapping<unibrow::Ecma262Canonicalize> interp_canonicalize_mapping_; 1295 unibrow::Mapping<unibrow::Ecma262Canonicalize> interp_canonicalize_mapping_;
1289 CodeStubInterfaceDescriptor* code_stub_interface_descriptors_; 1296 CodeStubInterfaceDescriptor* code_stub_interface_descriptors_;
1290 1297
1291 // The garbage collector should be a little more aggressive when it knows 1298 // The garbage collector should be a little more aggressive when it knows
1292 // that a context was recently exited. 1299 // that a context was recently exited.
1293 bool context_exit_happened_; 1300 bool context_exit_happened_;
1294 1301
1302 // True if this isolate was initialized from a snapshot.
1303 bool initialized_from_snapshot_;
1304
1295 // Time stamp at initialization. 1305 // Time stamp at initialization.
1296 double time_millis_at_init_; 1306 double time_millis_at_init_;
1297 1307
1298 #if defined(V8_TARGET_ARCH_ARM) && !defined(__arm__) || \ 1308 #if defined(V8_TARGET_ARCH_ARM) && !defined(__arm__) || \
1299 defined(V8_TARGET_ARCH_MIPS) && !defined(__mips__) 1309 defined(V8_TARGET_ARCH_MIPS) && !defined(__mips__)
1300 bool simulator_initialized_; 1310 bool simulator_initialized_;
1301 HashMap* simulator_i_cache_; 1311 HashMap* simulator_i_cache_;
1302 Redirection* simulator_redirection_; 1312 Redirection* simulator_redirection_;
1303 #endif 1313 #endif
1304 1314
1305 #ifdef DEBUG 1315 #ifdef DEBUG
1306 // A static array of histogram info for each type. 1316 // A static array of histogram info for each type.
1307 HistogramInfo heap_histograms_[LAST_TYPE + 1]; 1317 HistogramInfo heap_histograms_[LAST_TYPE + 1];
1308 JSObject::SpillInformation js_spill_information_; 1318 JSObject::SpillInformation js_spill_information_;
1309 int code_kind_statistics_[Code::NUMBER_OF_KINDS]; 1319 int code_kind_statistics_[Code::NUMBER_OF_KINDS];
1310 #endif 1320 #endif
1311 1321
1312 #ifdef ENABLE_DEBUGGER_SUPPORT 1322 #ifdef ENABLE_DEBUGGER_SUPPORT
1313 Debugger* debugger_; 1323 Debugger* debugger_;
1314 Debug* debug_; 1324 Debug* debug_;
1315 #endif 1325 #endif
1316 CpuProfiler* cpu_profiler_; 1326 CpuProfiler* cpu_profiler_;
1317 HeapProfiler* heap_profiler_; 1327 HeapProfiler* heap_profiler_;
1328 FunctionEntryHook function_entry_hook_;
1318 1329
1319 #define GLOBAL_BACKING_STORE(type, name, initialvalue) \ 1330 #define GLOBAL_BACKING_STORE(type, name, initialvalue) \
1320 type name##_; 1331 type name##_;
1321 ISOLATE_INIT_LIST(GLOBAL_BACKING_STORE) 1332 ISOLATE_INIT_LIST(GLOBAL_BACKING_STORE)
1322 #undef GLOBAL_BACKING_STORE 1333 #undef GLOBAL_BACKING_STORE
1323 1334
1324 #define GLOBAL_ARRAY_BACKING_STORE(type, name, length) \ 1335 #define GLOBAL_ARRAY_BACKING_STORE(type, name, length) \
1325 type name##_[length]; 1336 type name##_[length];
1326 ISOLATE_INIT_ARRAY_LIST(GLOBAL_ARRAY_BACKING_STORE) 1337 ISOLATE_INIT_ARRAY_LIST(GLOBAL_ARRAY_BACKING_STORE)
1327 #undef GLOBAL_ARRAY_BACKING_STORE 1338 #undef GLOBAL_ARRAY_BACKING_STORE
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
1491 1502
1492 // Mark the native context with out of memory. 1503 // Mark the native context with out of memory.
1493 inline void Context::mark_out_of_memory() { 1504 inline void Context::mark_out_of_memory() {
1494 native_context()->set_out_of_memory(HEAP->true_value()); 1505 native_context()->set_out_of_memory(HEAP->true_value());
1495 } 1506 }
1496 1507
1497 1508
1498 } } // namespace v8::internal 1509 } } // namespace v8::internal
1499 1510
1500 #endif // V8_ISOLATE_H_ 1511 #endif // V8_ISOLATE_H_
OLDNEW
« src/ic.cc ('K') | « src/ic.cc ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698