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

Side by Side Diff: src/vm-state-inl.h

Issue 4888002: [Isolates] Pass isolate to VMState constructor. (Closed)
Patch Set: Created 10 years, 1 month 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/top.cc ('K') | « src/vm-state.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 case COMPILER: 48 case COMPILER:
49 return "COMPILER"; 49 return "COMPILER";
50 case OTHER: 50 case OTHER:
51 return "OTHER"; 51 return "OTHER";
52 default: 52 default:
53 UNREACHABLE(); 53 UNREACHABLE();
54 return NULL; 54 return NULL;
55 } 55 }
56 } 56 }
57 57
58 VMState::VMState(StateTag state) 58 VMState::VMState(Isolate* isolate, StateTag state)
59 : disabled_(true), 59 : isolate_(isolate),
60 disabled_(true),
60 state_(OTHER), 61 state_(OTHER),
61 external_callback_(NULL), 62 external_callback_(NULL) {
62 isolate_(Isolate::Current()) { 63 ASSERT(isolate == Isolate::Current());
64
63 #ifdef ENABLE_LOGGING_AND_PROFILING 65 #ifdef ENABLE_LOGGING_AND_PROFILING
64 if (!LOGGER->is_logging() && !CpuProfiler::is_profiling()) { 66 if (!isolate_->logger()->is_logging() &&
67 !CpuProfiler::is_profiling(isolate_)) {
65 return; 68 return;
66 } 69 }
67 #endif 70 #endif
68 71
69 disabled_ = false; 72 disabled_ = false;
70 #if !defined(ENABLE_HEAP_PROTECTION) 73 #if !defined(ENABLE_HEAP_PROTECTION)
71 // When not protecting the heap, there is no difference between 74 // When not protecting the heap, there is no difference between
72 // EXTERNAL and OTHER. As an optimization in that case, we will not 75 // EXTERNAL and OTHER. As an optimization in that case, we will not
73 // perform EXTERNAL->OTHER transitions through the API. We thus 76 // perform EXTERNAL->OTHER transitions through the API. We thus
74 // compress the two states into one. 77 // compress the two states into one.
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 isolate_->heap()->Protect(); 133 isolate_->heap()->Protect();
131 } 134 }
132 } 135 }
133 #endif // ENABLE_HEAP_PROTECTION 136 #endif // ENABLE_HEAP_PROTECTION
134 } 137 }
135 #endif // ENABLE_VMSTATE_TRACKING 138 #endif // ENABLE_VMSTATE_TRACKING
136 139
137 } } // namespace v8::internal 140 } } // namespace v8::internal
138 141
139 #endif // V8_VM_STATE_INL_H_ 142 #endif // V8_VM_STATE_INL_H_
OLDNEW
« src/top.cc ('K') | « src/vm-state.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698