| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stdlib.h> | 5 #include <stdlib.h> |
| 6 #include <limits> | 6 #include <limits> |
| 7 | 7 |
| 8 #include "v8.h" | 8 #include "v8.h" |
| 9 | 9 |
| 10 #include "accessors.h" | 10 #include "accessors.h" |
| (...skipping 3100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3111 if (isolate->logger()->is_logging_code_events() || | 3111 if (isolate->logger()->is_logging_code_events() || |
| 3112 isolate->cpu_profiler()->is_profiling()) { | 3112 isolate->cpu_profiler()->is_profiling()) { |
| 3113 isolate->logger()->LogExistingFunction( | 3113 isolate->logger()->LogExistingFunction( |
| 3114 source_shared, Handle<Code>(source_shared->code())); | 3114 source_shared, Handle<Code>(source_shared->code())); |
| 3115 } | 3115 } |
| 3116 | 3116 |
| 3117 return *target; | 3117 return *target; |
| 3118 } | 3118 } |
| 3119 | 3119 |
| 3120 | 3120 |
| 3121 RUNTIME_FUNCTION(Runtime_SetExpectedNumberOfProperties) { | |
| 3122 HandleScope scope(isolate); | |
| 3123 ASSERT(args.length() == 2); | |
| 3124 CONVERT_ARG_HANDLE_CHECKED(JSFunction, func, 0); | |
| 3125 CONVERT_SMI_ARG_CHECKED(num, 1); | |
| 3126 RUNTIME_ASSERT(num >= 0); | |
| 3127 | |
| 3128 func->shared()->set_expected_nof_properties(num); | |
| 3129 if (func->has_initial_map()) { | |
| 3130 Handle<Map> new_initial_map = Map::Copy(handle(func->initial_map())); | |
| 3131 new_initial_map->set_unused_property_fields(num); | |
| 3132 func->set_initial_map(*new_initial_map); | |
| 3133 } | |
| 3134 return isolate->heap()->undefined_value(); | |
| 3135 } | |
| 3136 | |
| 3137 | |
| 3138 RUNTIME_FUNCTION(RuntimeHidden_CreateJSGeneratorObject) { | 3121 RUNTIME_FUNCTION(RuntimeHidden_CreateJSGeneratorObject) { |
| 3139 HandleScope scope(isolate); | 3122 HandleScope scope(isolate); |
| 3140 ASSERT(args.length() == 0); | 3123 ASSERT(args.length() == 0); |
| 3141 | 3124 |
| 3142 JavaScriptFrameIterator it(isolate); | 3125 JavaScriptFrameIterator it(isolate); |
| 3143 JavaScriptFrame* frame = it.frame(); | 3126 JavaScriptFrame* frame = it.frame(); |
| 3144 Handle<JSFunction> function(frame->function()); | 3127 Handle<JSFunction> function(frame->function()); |
| 3145 RUNTIME_ASSERT(function->shared()->is_generator()); | 3128 RUNTIME_ASSERT(function->shared()->is_generator()); |
| 3146 | 3129 |
| 3147 Handle<JSGeneratorObject> generator; | 3130 Handle<JSGeneratorObject> generator; |
| (...skipping 12040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15188 } | 15171 } |
| 15189 return NULL; | 15172 return NULL; |
| 15190 } | 15173 } |
| 15191 | 15174 |
| 15192 | 15175 |
| 15193 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { | 15176 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { |
| 15194 return &(kIntrinsicFunctions[static_cast<int>(id)]); | 15177 return &(kIntrinsicFunctions[static_cast<int>(id)]); |
| 15195 } | 15178 } |
| 15196 | 15179 |
| 15197 } } // namespace v8::internal | 15180 } } // namespace v8::internal |
| OLD | NEW |