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 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1238 } else { | 1238 } else { |
1239 Isolate* isolate = context_->GetIsolate(); | 1239 Isolate* isolate = context_->GetIsolate(); |
1240 isolate->set_context(*context_); | 1240 isolate->set_context(*context_); |
1241 isolate->set_save_context(prev_); | 1241 isolate->set_save_context(prev_); |
1242 } | 1242 } |
1243 } | 1243 } |
1244 | 1244 |
1245 Handle<Context> context() { return context_; } | 1245 Handle<Context> context() { return context_; } |
1246 SaveContext* prev() { return prev_; } | 1246 SaveContext* prev() { return prev_; } |
1247 | 1247 |
1248 // Returns true if this save context is below a given JavaScript frame. | 1248 // Returns true if this save context is above a given JavaScript frame. |
1249 bool below(JavaScriptFrame* frame) { | 1249 bool IsAboveFrame(JavaScriptFrame* frame) { |
Kevin Millikin (Chromium)
2011/10/28 11:09:08
Let's rename this to use "Below", and you can chan
| |
1250 return (js_sp_ == 0) || (frame->sp() < js_sp_); | 1250 // Every frame is below topmost SaveContext. |
1251 return (c_entry_fp_ == 0) || (c_entry_fp_ > frame->sp()); | |
1251 } | 1252 } |
1252 | 1253 |
1253 private: | 1254 private: |
1254 Handle<Context> context_; | 1255 Handle<Context> context_; |
1255 #if __GNUC_VERSION__ >= 40100 && __GNUC_VERSION__ < 40300 | 1256 #if __GNUC_VERSION__ >= 40100 && __GNUC_VERSION__ < 40300 |
1256 Handle<Context> dummy_; | 1257 Handle<Context> dummy_; |
1257 #endif | 1258 #endif |
1258 SaveContext* prev_; | 1259 SaveContext* prev_; |
1259 Address js_sp_; // The top JS frame's sp when saving context. | 1260 Address c_entry_fp_; |
1260 }; | 1261 }; |
1261 | 1262 |
1262 | 1263 |
1263 class AssertNoContextChange BASE_EMBEDDED { | 1264 class AssertNoContextChange BASE_EMBEDDED { |
1264 #ifdef DEBUG | 1265 #ifdef DEBUG |
1265 public: | 1266 public: |
1266 AssertNoContextChange() : | 1267 AssertNoContextChange() : |
1267 scope_(Isolate::Current()), | 1268 scope_(Isolate::Current()), |
1268 context_(Isolate::Current()->context(), Isolate::Current()) { | 1269 context_(Isolate::Current()->context(), Isolate::Current()) { |
1269 } | 1270 } |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1359 | 1360 |
1360 // Mark the global context with out of memory. | 1361 // Mark the global context with out of memory. |
1361 inline void Context::mark_out_of_memory() { | 1362 inline void Context::mark_out_of_memory() { |
1362 global_context()->set_out_of_memory(HEAP->true_value()); | 1363 global_context()->set_out_of_memory(HEAP->true_value()); |
1363 } | 1364 } |
1364 | 1365 |
1365 | 1366 |
1366 } } // namespace v8::internal | 1367 } } // namespace v8::internal |
1367 | 1368 |
1368 #endif // V8_ISOLATE_H_ | 1369 #endif // V8_ISOLATE_H_ |
OLD | NEW |