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

Side by Side Diff: src/api.cc

Issue 4634003: Landing for Justin Schuh.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 1 month 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/flag-definitions.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 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 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 386
387 v8::Handle<Boolean> False() { 387 v8::Handle<Boolean> False() {
388 LOG_API("False"); 388 LOG_API("False");
389 return ImplementationUtilities::False(); 389 return ImplementationUtilities::False();
390 } 390 }
391 391
392 392
393 ResourceConstraints::ResourceConstraints() 393 ResourceConstraints::ResourceConstraints()
394 : max_young_space_size_(0), 394 : max_young_space_size_(0),
395 max_old_space_size_(0), 395 max_old_space_size_(0),
396 max_executable_size_(0),
396 stack_limit_(NULL) { } 397 stack_limit_(NULL) { }
397 398
398 399
399 bool SetResourceConstraints(ResourceConstraints* constraints) { 400 bool SetResourceConstraints(ResourceConstraints* constraints) {
400 int young_space_size = constraints->max_young_space_size(); 401 int young_space_size = constraints->max_young_space_size();
401 int old_gen_size = constraints->max_old_space_size(); 402 int old_gen_size = constraints->max_old_space_size();
402 if (young_space_size != 0 || old_gen_size != 0) { 403 int max_executable_size = constraints->max_executable_size();
403 bool result = i::Heap::ConfigureHeap(young_space_size / 2, old_gen_size); 404 if (young_space_size != 0 || old_gen_size != 0 || max_executable_size != 0) {
405 bool result = i::Heap::ConfigureHeap(young_space_size / 2,
406 old_gen_size,
407 max_executable_size);
404 if (!result) return false; 408 if (!result) return false;
405 } 409 }
406 if (constraints->stack_limit() != NULL) { 410 if (constraints->stack_limit() != NULL) {
407 uintptr_t limit = reinterpret_cast<uintptr_t>(constraints->stack_limit()); 411 uintptr_t limit = reinterpret_cast<uintptr_t>(constraints->stack_limit());
408 i::StackGuard::SetStackLimit(limit); 412 i::StackGuard::SetStackLimit(limit);
409 } 413 }
410 return true; 414 return true;
411 } 415 }
412 416
413 417
(...skipping 2838 matching lines...) Expand 10 before | Expand all | Expand 10 after
3252 return i::V8::Initialize(NULL); 3256 return i::V8::Initialize(NULL);
3253 } 3257 }
3254 3258
3255 3259
3256 bool v8::V8::Dispose() { 3260 bool v8::V8::Dispose() {
3257 i::V8::TearDown(); 3261 i::V8::TearDown();
3258 return true; 3262 return true;
3259 } 3263 }
3260 3264
3261 3265
3262 HeapStatistics::HeapStatistics(): total_heap_size_(0), used_heap_size_(0) { } 3266 HeapStatistics::HeapStatistics(): total_heap_size_(0),
3267 total_heap_size_executable_(0),
3268 used_heap_size_(0) { }
3263 3269
3264 3270
3265 void v8::V8::GetHeapStatistics(HeapStatistics* heap_statistics) { 3271 void v8::V8::GetHeapStatistics(HeapStatistics* heap_statistics) {
3266 heap_statistics->set_total_heap_size(i::Heap::CommittedMemory()); 3272 heap_statistics->set_total_heap_size(i::Heap::CommittedMemory());
3273 heap_statistics->set_total_heap_size_executable(
3274 i::Heap::CommittedMemoryExecutable());
3267 heap_statistics->set_used_heap_size(i::Heap::SizeOfObjects()); 3275 heap_statistics->set_used_heap_size(i::Heap::SizeOfObjects());
3268 } 3276 }
3269 3277
3270 3278
3271 bool v8::V8::IdleNotification() { 3279 bool v8::V8::IdleNotification() {
3272 // Returning true tells the caller that it need not 3280 // Returning true tells the caller that it need not
3273 // continue to call IdleNotification. 3281 // continue to call IdleNotification.
3274 if (!i::V8::IsRunning()) return true; 3282 if (!i::V8::IsRunning()) return true;
3275 return i::V8::IdleNotification(); 3283 return i::V8::IdleNotification();
3276 } 3284 }
(...skipping 1715 matching lines...) Expand 10 before | Expand all | Expand 10 after
4992 5000
4993 5001
4994 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { 5002 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) {
4995 HandleScopeImplementer* thread_local = 5003 HandleScopeImplementer* thread_local =
4996 reinterpret_cast<HandleScopeImplementer*>(storage); 5004 reinterpret_cast<HandleScopeImplementer*>(storage);
4997 thread_local->IterateThis(v); 5005 thread_local->IterateThis(v);
4998 return storage + ArchiveSpacePerThread(); 5006 return storage + ArchiveSpacePerThread();
4999 } 5007 }
5000 5008
5001 } } // namespace v8::internal 5009 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8.h ('k') | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698