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

Side by Side Diff: src/objects.cc

Issue 238933002: First round of runtime.cc handlification. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Landing Created 6 years, 8 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/objects.h ('k') | src/runtime.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 889 matching lines...) Expand 10 before | Expand all | Expand 10 after
900 Object); 900 Object);
901 if (!result->IsTheHole()) return result; 901 if (!result->IsTheHole()) return result;
902 } 902 }
903 } 903 }
904 904
905 return isolate->factory()->undefined_value(); 905 return isolate->factory()->undefined_value();
906 } 906 }
907 907
908 908
909 Object* Object::GetPrototype(Isolate* isolate) { 909 Object* Object::GetPrototype(Isolate* isolate) {
910 DisallowHeapAllocation no_alloc;
910 if (IsSmi()) { 911 if (IsSmi()) {
911 Context* context = isolate->context()->native_context(); 912 Context* context = isolate->context()->native_context();
912 return context->number_function()->instance_prototype(); 913 return context->number_function()->instance_prototype();
913 } 914 }
914 915
915 HeapObject* heap_object = HeapObject::cast(this); 916 HeapObject* heap_object = HeapObject::cast(this);
916 917
917 // The object is either a number, a string, a boolean, 918 // The object is either a number, a string, a boolean,
918 // a real JS object, or a Harmony proxy. 919 // a real JS object, or a Harmony proxy.
919 if (heap_object->IsJSReceiver()) { 920 if (heap_object->IsJSReceiver()) {
(...skipping 11 matching lines...) Expand all
931 return context->symbol_function()->instance_prototype(); 932 return context->symbol_function()->instance_prototype();
932 } 933 }
933 if (heap_object->IsBoolean()) { 934 if (heap_object->IsBoolean()) {
934 return context->boolean_function()->instance_prototype(); 935 return context->boolean_function()->instance_prototype();
935 } else { 936 } else {
936 return isolate->heap()->null_value(); 937 return isolate->heap()->null_value();
937 } 938 }
938 } 939 }
939 940
940 941
942 Handle<Object> Object::GetPrototype(Isolate* isolate,
943 Handle<Object> object) {
944 return handle(object->GetPrototype(isolate), isolate);
945 }
946
947
941 Map* Object::GetMarkerMap(Isolate* isolate) { 948 Map* Object::GetMarkerMap(Isolate* isolate) {
942 if (IsSmi()) return isolate->heap()->heap_number_map(); 949 if (IsSmi()) return isolate->heap()->heap_number_map();
943 return HeapObject::cast(this)->map(); 950 return HeapObject::cast(this)->map();
944 } 951 }
945 952
946 953
947 Object* Object::GetHash() { 954 Object* Object::GetHash() {
948 // The object is either a number, a name, an odd-ball, 955 // The object is either a number, a name, an odd-ball,
949 // a real JS object, or a Harmony proxy. 956 // a real JS object, or a Harmony proxy.
950 if (IsNumber()) { 957 if (IsNumber()) {
(...skipping 15741 matching lines...) Expand 10 before | Expand all | Expand 10 after
16692 #define ERROR_MESSAGES_TEXTS(C, T) T, 16699 #define ERROR_MESSAGES_TEXTS(C, T) T,
16693 static const char* error_messages_[] = { 16700 static const char* error_messages_[] = {
16694 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) 16701 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)
16695 }; 16702 };
16696 #undef ERROR_MESSAGES_TEXTS 16703 #undef ERROR_MESSAGES_TEXTS
16697 return error_messages_[reason]; 16704 return error_messages_[reason];
16698 } 16705 }
16699 16706
16700 16707
16701 } } // namespace v8::internal 16708 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698