OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1212 | 1212 |
1213 DISALLOW_COPY_AND_ASSIGN(Isolate); | 1213 DISALLOW_COPY_AND_ASSIGN(Isolate); |
1214 }; | 1214 }; |
1215 | 1215 |
1216 | 1216 |
1217 // If the GCC version is 4.1.x or 4.2.x an additional field is added to the | 1217 // If the GCC version is 4.1.x or 4.2.x an additional field is added to the |
1218 // class as a work around for a bug in the generated code found with these | 1218 // class as a work around for a bug in the generated code found with these |
1219 // versions of GCC. See V8 issue 122 for details. | 1219 // versions of GCC. See V8 issue 122 for details. |
1220 class SaveContext BASE_EMBEDDED { | 1220 class SaveContext BASE_EMBEDDED { |
1221 public: | 1221 public: |
1222 explicit SaveContext(Isolate* isolate) : prev_(isolate->save_context()) { | 1222 inline explicit SaveContext(Isolate* isolate); |
1223 if (isolate->context() != NULL) { | |
1224 context_ = Handle<Context>(isolate->context()); | |
1225 #if __GNUC_VERSION__ >= 40100 && __GNUC_VERSION__ < 40300 | |
1226 dummy_ = Handle<Context>(isolate->context()); | |
1227 #endif | |
1228 } | |
1229 isolate->set_save_context(this); | |
1230 | |
1231 // If there is no JS frame under the current C frame, use the value 0. | |
1232 JavaScriptFrameIterator it(isolate); | |
1233 js_sp_ = it.done() ? 0 : it.frame()->sp(); | |
1234 } | |
1235 | 1223 |
1236 ~SaveContext() { | 1224 ~SaveContext() { |
1237 if (context_.is_null()) { | 1225 if (context_.is_null()) { |
1238 Isolate* isolate = Isolate::Current(); | 1226 Isolate* isolate = Isolate::Current(); |
1239 isolate->set_context(NULL); | 1227 isolate->set_context(NULL); |
1240 isolate->set_save_context(prev_); | 1228 isolate->set_save_context(prev_); |
1241 } else { | 1229 } else { |
1242 Isolate* isolate = context_->GetIsolate(); | 1230 Isolate* isolate = context_->GetIsolate(); |
1243 isolate->set_context(*context_); | 1231 isolate->set_context(*context_); |
1244 isolate->set_save_context(prev_); | 1232 isolate->set_save_context(prev_); |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1362 | 1350 |
1363 // Mark the global context with out of memory. | 1351 // Mark the global context with out of memory. |
1364 inline void Context::mark_out_of_memory() { | 1352 inline void Context::mark_out_of_memory() { |
1365 global_context()->set_out_of_memory(HEAP->true_value()); | 1353 global_context()->set_out_of_memory(HEAP->true_value()); |
1366 } | 1354 } |
1367 | 1355 |
1368 | 1356 |
1369 } } // namespace v8::internal | 1357 } } // namespace v8::internal |
1370 | 1358 |
1371 #endif // V8_ISOLATE_H_ | 1359 #endif // V8_ISOLATE_H_ |
OLD | NEW |