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

Side by Side Diff: src/runtime.cc

Issue 15681004: Revert "Make Object.freeze fast" (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « src/runtime.h ('k') | src/v8natives.js » ('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 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 2674 matching lines...) Expand 10 before | Expand all | Expand 10 after
2685 CONVERT_ARG_HANDLE_CHECKED(JSGeneratorObject, generator, 0); 2685 CONVERT_ARG_HANDLE_CHECKED(JSGeneratorObject, generator, 0);
2686 int continuation = generator->continuation(); 2686 int continuation = generator->continuation();
2687 const char* message = continuation == JSGeneratorObject::kGeneratorClosed ? 2687 const char* message = continuation == JSGeneratorObject::kGeneratorClosed ?
2688 "generator_finished" : "generator_running"; 2688 "generator_finished" : "generator_running";
2689 Vector< Handle<Object> > argv = HandleVector<Object>(NULL, 0); 2689 Vector< Handle<Object> > argv = HandleVector<Object>(NULL, 0);
2690 Handle<Object> error = isolate->factory()->NewError(message, argv); 2690 Handle<Object> error = isolate->factory()->NewError(message, argv);
2691 return isolate->Throw(*error); 2691 return isolate->Throw(*error);
2692 } 2692 }
2693 2693
2694 2694
2695 RUNTIME_FUNCTION(MaybeObject*, Runtime_ObjectFreeze) {
2696 NoHandleAllocation ha(isolate);
2697 ASSERT(args.length() == 1);
2698 CONVERT_ARG_CHECKED(JSObject, object, 0);
2699 return object->Freeze(isolate);
2700 }
2701
2702
2703 MUST_USE_RESULT static MaybeObject* CharFromCode(Isolate* isolate, 2695 MUST_USE_RESULT static MaybeObject* CharFromCode(Isolate* isolate,
2704 Object* char_code) { 2696 Object* char_code) {
2705 if (char_code->IsNumber()) { 2697 if (char_code->IsNumber()) {
2706 return isolate->heap()->LookupSingleCharacterStringFromCode( 2698 return isolate->heap()->LookupSingleCharacterStringFromCode(
2707 NumberToUint32(char_code) & 0xffff); 2699 NumberToUint32(char_code) & 0xffff);
2708 } 2700 }
2709 return isolate->heap()->empty_string(); 2701 return isolate->heap()->empty_string();
2710 } 2702 }
2711 2703
2712 2704
(...skipping 10593 matching lines...) Expand 10 before | Expand all | Expand 10 after
13306 CONVERT_ARG_CHECKED(JSObject, obj, 0); \ 13298 CONVERT_ARG_CHECKED(JSObject, obj, 0); \
13307 return isolate->heap()->ToBoolean(obj->Has##Name()); \ 13299 return isolate->heap()->ToBoolean(obj->Has##Name()); \
13308 } 13300 }
13309 13301
13310 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastSmiElements) 13302 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastSmiElements)
13311 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastObjectElements) 13303 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastObjectElements)
13312 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastSmiOrObjectElements) 13304 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastSmiOrObjectElements)
13313 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastDoubleElements) 13305 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastDoubleElements)
13314 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastHoleyElements) 13306 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastHoleyElements)
13315 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(DictionaryElements) 13307 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(DictionaryElements)
13316 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(NonStrictArgumentsElements)
13317 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(ExternalPixelElements) 13308 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(ExternalPixelElements)
13318 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(ExternalArrayElements) 13309 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(ExternalArrayElements)
13319 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(ExternalByteElements) 13310 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(ExternalByteElements)
13320 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(ExternalUnsignedByteElements) 13311 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(ExternalUnsignedByteElements)
13321 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(ExternalShortElements) 13312 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(ExternalShortElements)
13322 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(ExternalUnsignedShortElements) 13313 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(ExternalUnsignedShortElements)
13323 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(ExternalIntElements) 13314 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(ExternalIntElements)
13324 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(ExternalUnsignedIntElements) 13315 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(ExternalUnsignedIntElements)
13325 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(ExternalFloatElements) 13316 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(ExternalFloatElements)
13326 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(ExternalDoubleElements) 13317 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(ExternalDoubleElements)
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
13504 // Handle last resort GC and make sure to allow future allocations 13495 // Handle last resort GC and make sure to allow future allocations
13505 // to grow the heap without causing GCs (if possible). 13496 // to grow the heap without causing GCs (if possible).
13506 isolate->counters()->gc_last_resort_from_js()->Increment(); 13497 isolate->counters()->gc_last_resort_from_js()->Increment();
13507 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, 13498 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags,
13508 "Runtime::PerformGC"); 13499 "Runtime::PerformGC");
13509 } 13500 }
13510 } 13501 }
13511 13502
13512 13503
13513 } } // namespace v8::internal 13504 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime.h ('k') | src/v8natives.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698