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

Side by Side Diff: src/runtime.cc

Issue 11530011: Avoid object layout changes during GC. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comment Created 8 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 | « src/runtime.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 13091 matching lines...) Expand 10 before | Expand all | Expand 10 after
13102 RUNTIME_FUNCTION(MaybeObject*, Runtime_MarkOneShotGetter) { 13102 RUNTIME_FUNCTION(MaybeObject*, Runtime_MarkOneShotGetter) {
13103 ASSERT_EQ(args.length(), 1); 13103 ASSERT_EQ(args.length(), 1);
13104 CONVERT_ARG_HANDLE_CHECKED(JSFunction, fun, 0); 13104 CONVERT_ARG_HANDLE_CHECKED(JSFunction, fun, 0);
13105 HandleScope scope(isolate); 13105 HandleScope scope(isolate);
13106 Handle<String> key = isolate->factory()->hidden_stack_trace_symbol(); 13106 Handle<String> key = isolate->factory()->hidden_stack_trace_symbol();
13107 JSObject::SetHiddenProperty(fun, key, key); 13107 JSObject::SetHiddenProperty(fun, key, key);
13108 return *fun; 13108 return *fun;
13109 } 13109 }
13110 13110
13111 13111
13112 // Retrieve the raw stack trace collected on stack overflow and delete 13112 // Retrieve the stack trace. This could be the raw stack trace collected
13113 // it since it is used only once to avoid keeping it alive. 13113 // on stack overflow or the already formatted stack trace string.
13114 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetOverflowedRawStackTrace) { 13114 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetOverflowedStackTrace) {
13115 HandleScope scope(isolate);
13115 ASSERT_EQ(args.length(), 1); 13116 ASSERT_EQ(args.length(), 1);
13116 CONVERT_ARG_CHECKED(JSObject, error_object, 0); 13117 CONVERT_ARG_CHECKED(JSObject, error_object, 0);
13117 String* key = isolate->heap()->hidden_stack_trace_symbol(); 13118 String* key = isolate->heap()->hidden_stack_trace_symbol();
13118 Object* result = error_object->GetHiddenProperty(key); 13119 Object* result = error_object->GetHiddenProperty(key);
13119 RUNTIME_ASSERT(result->IsJSArray() || result->IsUndefined()); 13120 RUNTIME_ASSERT(result->IsJSArray() ||
13120 error_object->DeleteHiddenProperty(key); 13121 result->IsString() ||
13122 result->IsUndefined());
13121 return result; 13123 return result;
13122 } 13124 }
13123 13125
13124 13126
13127 // Set or clear the stack trace attached to an stack overflow error object.
13128 RUNTIME_FUNCTION(MaybeObject*, Runtime_SetOverflowedStackTrace) {
13129 HandleScope scope(isolate);
13130 ASSERT_EQ(args.length(), 2);
13131 CONVERT_ARG_HANDLE_CHECKED(JSObject, error_object, 0);
13132 CONVERT_ARG_HANDLE_CHECKED(HeapObject, value, 1);
13133 Handle<String> key = isolate->factory()->hidden_stack_trace_symbol();
13134 if (value->IsUndefined()) {
13135 error_object->DeleteHiddenProperty(*key);
13136 } else {
13137 RUNTIME_ASSERT(value->IsString());
13138 JSObject::SetHiddenProperty(error_object, key, value);
13139 }
13140 return *error_object;
13141 }
13142
13143
13125 // Returns V8 version as a string. 13144 // Returns V8 version as a string.
13126 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetV8Version) { 13145 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetV8Version) {
13127 ASSERT_EQ(args.length(), 0); 13146 ASSERT_EQ(args.length(), 0);
13128 13147
13129 NoHandleAllocation ha; 13148 NoHandleAllocation ha;
13130 13149
13131 const char* version_string = v8::V8::GetVersion(); 13150 const char* version_string = v8::V8::GetVersion();
13132 13151
13133 return isolate->heap()->AllocateStringFromOneByte(CStrVector(version_string), 13152 return isolate->heap()->AllocateStringFromOneByte(CStrVector(version_string),
13134 NOT_TENURED); 13153 NOT_TENURED);
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
13515 // Handle last resort GC and make sure to allow future allocations 13534 // Handle last resort GC and make sure to allow future allocations
13516 // to grow the heap without causing GCs (if possible). 13535 // to grow the heap without causing GCs (if possible).
13517 isolate->counters()->gc_last_resort_from_js()->Increment(); 13536 isolate->counters()->gc_last_resort_from_js()->Increment();
13518 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, 13537 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags,
13519 "Runtime::PerformGC"); 13538 "Runtime::PerformGC");
13520 } 13539 }
13521 } 13540 }
13522 13541
13523 13542
13524 } } // namespace v8::internal 13543 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698