| 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 static Handle<Value> Throw(const char* message) { | 83 static Handle<Value> Throw(const char* message) { |
| 84 return ThrowException(String::New(message)); | 84 return ThrowException(String::New(message)); |
| 85 } | 85 } |
| 86 | 86 |
| 87 | 87 |
| 88 | 88 |
| 89 class PerIsolateData { | 89 class PerIsolateData { |
| 90 public: | 90 public: |
| 91 explicit PerIsolateData(Isolate* isolate) : isolate_(isolate), realms_(NULL) { | 91 explicit PerIsolateData(Isolate* isolate) : isolate_(isolate), realms_(NULL) { |
| 92 HandleScope scope(isolate); | 92 HandleScope scope(isolate); |
| 93 isolate->SetData(this); | 93 isolate->SetData(0, this); |
| 94 } | 94 } |
| 95 | 95 |
| 96 ~PerIsolateData() { | 96 ~PerIsolateData() { |
| 97 isolate_->SetData(NULL); // Not really needed, just to be sure... | 97 isolate_->SetData(0, NULL); // Not really needed, just to be sure... |
| 98 } | 98 } |
| 99 | 99 |
| 100 inline static PerIsolateData* Get(Isolate* isolate) { | 100 inline static PerIsolateData* Get(Isolate* isolate) { |
| 101 return reinterpret_cast<PerIsolateData*>(isolate->GetData()); | 101 return reinterpret_cast<PerIsolateData*>(isolate->GetData(0)); |
| 102 } | 102 } |
| 103 | 103 |
| 104 class RealmScope { | 104 class RealmScope { |
| 105 public: | 105 public: |
| 106 explicit RealmScope(PerIsolateData* data); | 106 explicit RealmScope(PerIsolateData* data); |
| 107 ~RealmScope(); | 107 ~RealmScope(); |
| 108 private: | 108 private: |
| 109 PerIsolateData* data_; | 109 PerIsolateData* data_; |
| 110 }; | 110 }; |
| 111 | 111 |
| (...skipping 1673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1785 } | 1785 } |
| 1786 | 1786 |
| 1787 } // namespace v8 | 1787 } // namespace v8 |
| 1788 | 1788 |
| 1789 | 1789 |
| 1790 #ifndef GOOGLE3 | 1790 #ifndef GOOGLE3 |
| 1791 int main(int argc, char* argv[]) { | 1791 int main(int argc, char* argv[]) { |
| 1792 return v8::Shell::Main(argc, argv); | 1792 return v8::Shell::Main(argc, argv); |
| 1793 } | 1793 } |
| 1794 #endif | 1794 #endif |
| OLD | NEW |