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

Side by Side Diff: src/runtime.cc

Issue 7598030: Implement Harmony semantics for typeof null (behind a flag). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 4 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
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 4835 matching lines...) Expand 10 before | Expand all | Expand 10 after
4846 if (instance_type < FIRST_NONSTRING_TYPE) { 4846 if (instance_type < FIRST_NONSTRING_TYPE) {
4847 return isolate->heap()->string_symbol(); 4847 return isolate->heap()->string_symbol();
4848 } 4848 }
4849 4849
4850 switch (instance_type) { 4850 switch (instance_type) {
4851 case ODDBALL_TYPE: 4851 case ODDBALL_TYPE:
4852 if (heap_obj->IsTrue() || heap_obj->IsFalse()) { 4852 if (heap_obj->IsTrue() || heap_obj->IsFalse()) {
4853 return isolate->heap()->boolean_symbol(); 4853 return isolate->heap()->boolean_symbol();
4854 } 4854 }
4855 if (heap_obj->IsNull()) { 4855 if (heap_obj->IsNull()) {
4856 return isolate->heap()->object_symbol(); 4856 return FLAG_harmony_typeof ? isolate->heap()->null_symbol()
4857 : isolate->heap()->object_symbol();
Kevin Millikin (Chromium) 2011/08/10 09:52:21 Normal V8 style seems to be to break like this: r
rossberg 2011/08/10 12:01:35 Done.
4857 } 4858 }
4858 ASSERT(heap_obj->IsUndefined()); 4859 ASSERT(heap_obj->IsUndefined());
4859 return isolate->heap()->undefined_symbol(); 4860 return isolate->heap()->undefined_symbol();
4860 case JS_FUNCTION_TYPE: 4861 case JS_FUNCTION_TYPE:
4861 return isolate->heap()->function_symbol(); 4862 return isolate->heap()->function_symbol();
4862 default: 4863 default:
4863 // For any kind of object not handled above, the spec rule for 4864 // For any kind of object not handled above, the spec rule for
4864 // host objects gives that it is okay to return "object" 4865 // host objects gives that it is okay to return "object"
4865 return isolate->heap()->object_symbol(); 4866 return isolate->heap()->object_symbol();
4866 } 4867 }
(...skipping 7970 matching lines...) Expand 10 before | Expand all | Expand 10 after
12837 } else { 12838 } else {
12838 // Handle last resort GC and make sure to allow future allocations 12839 // Handle last resort GC and make sure to allow future allocations
12839 // to grow the heap without causing GCs (if possible). 12840 // to grow the heap without causing GCs (if possible).
12840 isolate->counters()->gc_last_resort_from_js()->Increment(); 12841 isolate->counters()->gc_last_resort_from_js()->Increment();
12841 isolate->heap()->CollectAllGarbage(false); 12842 isolate->heap()->CollectAllGarbage(false);
12842 } 12843 }
12843 } 12844 }
12844 12845
12845 12846
12846 } } // namespace v8::internal 12847 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698