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

Side by Side Diff: src/api.cc

Issue 1519027: Make VM state tracking to be independent of logging and profiling. (Closed)
Patch Set: Created 10 years, 8 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
« no previous file with comments | « src/SConscript ('k') | src/log.h » ('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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 2843 matching lines...) Expand 10 before | Expand all | Expand 10 after
2854 "Writing internal field out of bounds")) { 2854 "Writing internal field out of bounds")) {
2855 return; 2855 return;
2856 } 2856 }
2857 ENTER_V8; 2857 ENTER_V8;
2858 i::Handle<i::Object> val = Utils::OpenHandle(*value); 2858 i::Handle<i::Object> val = Utils::OpenHandle(*value);
2859 obj->SetInternalField(index, *val); 2859 obj->SetInternalField(index, *val);
2860 } 2860 }
2861 2861
2862 2862
2863 void v8::Object::SetPointerInInternalField(int index, void* value) { 2863 void v8::Object::SetPointerInInternalField(int index, void* value) {
2864 ENTER_V8;
2864 i::Object* as_object = reinterpret_cast<i::Object*>(value); 2865 i::Object* as_object = reinterpret_cast<i::Object*>(value);
2865 if (as_object->IsSmi()) { 2866 if (as_object->IsSmi()) {
2866 Utils::OpenHandle(this)->SetInternalField(index, as_object); 2867 Utils::OpenHandle(this)->SetInternalField(index, as_object);
2867 return; 2868 return;
2868 } 2869 }
2869 HandleScope scope; 2870 HandleScope scope;
2870 i::Handle<i::Proxy> proxy = 2871 i::Handle<i::Proxy> proxy =
2871 i::Factory::NewProxy(reinterpret_cast<i::Address>(value), i::TENURED); 2872 i::Factory::NewProxy(reinterpret_cast<i::Address>(value), i::TENURED);
2872 if (!proxy.is_null()) 2873 if (!proxy.is_null())
2873 Utils::OpenHandle(this)->SetInternalField(index, *proxy); 2874 Utils::OpenHandle(this)->SetInternalField(index, *proxy);
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
3418 if (!self->HasFastElements()) { 3419 if (!self->HasFastElements()) {
3419 return Local<Object>(); 3420 return Local<Object>();
3420 } 3421 }
3421 i::FixedArray* elms = i::FixedArray::cast(self->elements()); 3422 i::FixedArray* elms = i::FixedArray::cast(self->elements());
3422 i::Object* paragon = elms->get(index); 3423 i::Object* paragon = elms->get(index);
3423 if (!paragon->IsJSObject()) { 3424 if (!paragon->IsJSObject()) {
3424 return Local<Object>(); 3425 return Local<Object>();
3425 } 3426 }
3426 i::Handle<i::JSObject> paragon_handle(i::JSObject::cast(paragon)); 3427 i::Handle<i::JSObject> paragon_handle(i::JSObject::cast(paragon));
3427 EXCEPTION_PREAMBLE(); 3428 EXCEPTION_PREAMBLE();
3429 ENTER_V8;
3428 i::Handle<i::JSObject> result = i::Copy(paragon_handle); 3430 i::Handle<i::JSObject> result = i::Copy(paragon_handle);
3429 has_pending_exception = result.is_null(); 3431 has_pending_exception = result.is_null();
3430 EXCEPTION_BAILOUT_CHECK(Local<Object>()); 3432 EXCEPTION_BAILOUT_CHECK(Local<Object>());
3431 return Utils::ToLocal(result); 3433 return Utils::ToLocal(result);
3432 } 3434 }
3433 3435
3434 3436
3435 Local<String> v8::String::NewSymbol(const char* data, int length) { 3437 Local<String> v8::String::NewSymbol(const char* data, int length) {
3436 EnsureInitialized("v8::String::NewSymbol()"); 3438 EnsureInitialized("v8::String::NewSymbol()");
3437 LOG_API("String::NewSymbol(char)"); 3439 LOG_API("String::NewSymbol(char)");
(...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after
4204 4206
4205 4207
4206 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { 4208 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) {
4207 HandleScopeImplementer* thread_local = 4209 HandleScopeImplementer* thread_local =
4208 reinterpret_cast<HandleScopeImplementer*>(storage); 4210 reinterpret_cast<HandleScopeImplementer*>(storage);
4209 thread_local->IterateThis(v); 4211 thread_local->IterateThis(v);
4210 return storage + ArchiveSpacePerThread(); 4212 return storage + ArchiveSpacePerThread();
4211 } 4213 }
4212 4214
4213 } } // namespace v8::internal 4215 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/SConscript ('k') | src/log.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698