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

Side by Side Diff: src/api.cc

Issue 5256004: Expose an API method for getting JSObject constructor name (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years 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 | Annotate | Revision Log
« no previous file with comments | « include/v8.h ('k') | src/heap-profiler.cc » ('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 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 2433 matching lines...) Expand 10 before | Expand all | Expand 10 after
2444 memcpy(ptr, postfix, postfix_len * v8::internal::kCharSize); 2444 memcpy(ptr, postfix, postfix_len * v8::internal::kCharSize);
2445 2445
2446 // Copy the buffer into a heap-allocated string and return it. 2446 // Copy the buffer into a heap-allocated string and return it.
2447 Local<String> result = v8::String::New(buf.start(), buf_len); 2447 Local<String> result = v8::String::New(buf.start(), buf_len);
2448 return result; 2448 return result;
2449 } 2449 }
2450 } 2450 }
2451 } 2451 }
2452 2452
2453 2453
2454 Local<String> v8::Object::GetConstructorName() {
2455 ON_BAILOUT("v8::Object::GetConstructorName()", return Local<v8::String>());
2456 ENTER_V8;
2457 i::Handle<i::JSObject> self = Utils::OpenHandle(this);
2458 i::Handle<i::String> name(self->constructor_name());
2459 return Utils::ToLocal(name);
2460 }
2461
2462
2454 bool v8::Object::Delete(v8::Handle<String> key) { 2463 bool v8::Object::Delete(v8::Handle<String> key) {
2455 ON_BAILOUT("v8::Object::Delete()", return false); 2464 ON_BAILOUT("v8::Object::Delete()", return false);
2456 ENTER_V8; 2465 ENTER_V8;
2457 HandleScope scope; 2466 HandleScope scope;
2458 i::Handle<i::JSObject> self = Utils::OpenHandle(this); 2467 i::Handle<i::JSObject> self = Utils::OpenHandle(this);
2459 i::Handle<i::String> key_obj = Utils::OpenHandle(*key); 2468 i::Handle<i::String> key_obj = Utils::OpenHandle(*key);
2460 return i::DeleteProperty(self, key_obj)->IsTrue(); 2469 return i::DeleteProperty(self, key_obj)->IsTrue();
2461 } 2470 }
2462 2471
2463 2472
(...skipping 2541 matching lines...) Expand 10 before | Expand all | Expand 10 after
5005 5014
5006 5015
5007 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { 5016 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) {
5008 HandleScopeImplementer* thread_local = 5017 HandleScopeImplementer* thread_local =
5009 reinterpret_cast<HandleScopeImplementer*>(storage); 5018 reinterpret_cast<HandleScopeImplementer*>(storage);
5010 thread_local->IterateThis(v); 5019 thread_local->IterateThis(v);
5011 return storage + ArchiveSpacePerThread(); 5020 return storage + ArchiveSpacePerThread();
5012 } 5021 }
5013 5022
5014 } } // namespace v8::internal 5023 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8.h ('k') | src/heap-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698