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

Side by Side Diff: src/execution.cc

Issue 210953005: Clean up some "GetProperty" methods/functions. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comments 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/bootstrapper.cc ('k') | src/handles.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 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 765 matching lines...) Expand 10 before | Expand all | Expand 10 after
776 776
777 Handle<Object> Execution::CharAt(Handle<String> string, uint32_t index) { 777 Handle<Object> Execution::CharAt(Handle<String> string, uint32_t index) {
778 Isolate* isolate = string->GetIsolate(); 778 Isolate* isolate = string->GetIsolate();
779 Factory* factory = isolate->factory(); 779 Factory* factory = isolate->factory();
780 780
781 int int_index = static_cast<int>(index); 781 int int_index = static_cast<int>(index);
782 if (int_index < 0 || int_index >= string->length()) { 782 if (int_index < 0 || int_index >= string->length()) {
783 return factory->undefined_value(); 783 return factory->undefined_value();
784 } 784 }
785 785
786 Handle<Object> char_at = GetProperty( 786 Handle<Object> char_at = Object::GetProperty(
787 isolate, isolate->js_builtins_object(), factory->char_at_string()); 787 isolate->js_builtins_object(), factory->char_at_string());
788 if (!char_at->IsJSFunction()) { 788 if (!char_at->IsJSFunction()) {
789 return factory->undefined_value(); 789 return factory->undefined_value();
790 } 790 }
791 791
792 bool caught_exception; 792 bool caught_exception;
793 Handle<Object> index_object = factory->NewNumberFromInt(int_index); 793 Handle<Object> index_object = factory->NewNumberFromInt(int_index);
794 Handle<Object> index_arg[] = { index_object }; 794 Handle<Object> index_arg[] = { index_object };
795 Handle<Object> result = TryCall(Handle<JSFunction>::cast(char_at), 795 Handle<Object> result = TryCall(Handle<JSFunction>::cast(char_at),
796 string, 796 string,
797 ARRAY_SIZE(index_arg), 797 ARRAY_SIZE(index_arg),
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
1048 ASSERT(isolate->concurrent_recompilation_enabled()); 1048 ASSERT(isolate->concurrent_recompilation_enabled());
1049 stack_guard->Continue(INSTALL_CODE); 1049 stack_guard->Continue(INSTALL_CODE);
1050 isolate->optimizing_compiler_thread()->InstallOptimizedFunctions(); 1050 isolate->optimizing_compiler_thread()->InstallOptimizedFunctions();
1051 } 1051 }
1052 isolate->runtime_profiler()->OptimizeNow(); 1052 isolate->runtime_profiler()->OptimizeNow();
1053 return isolate->heap()->undefined_value(); 1053 return isolate->heap()->undefined_value();
1054 } 1054 }
1055 1055
1056 1056
1057 } } // namespace v8::internal 1057 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/bootstrapper.cc ('k') | src/handles.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698