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 3115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3126 if (isolate->logger()->is_logging_code_events() || | 3126 if (isolate->logger()->is_logging_code_events() || |
3127 isolate->cpu_profiler()->is_profiling()) { | 3127 isolate->cpu_profiler()->is_profiling()) { |
3128 isolate->logger()->LogExistingFunction( | 3128 isolate->logger()->LogExistingFunction( |
3129 source_shared, Handle<Code>(source_shared->code())); | 3129 source_shared, Handle<Code>(source_shared->code())); |
3130 } | 3130 } |
3131 | 3131 |
3132 return *target; | 3132 return *target; |
3133 } | 3133 } |
3134 | 3134 |
3135 | 3135 |
3136 RUNTIME_FUNCTION(Runtime_SetExpectedNumberOfProperties) { | |
3137 HandleScope scope(isolate); | |
3138 ASSERT(args.length() == 2); | |
3139 CONVERT_ARG_HANDLE_CHECKED(JSFunction, func, 0); | |
3140 CONVERT_SMI_ARG_CHECKED(num, 1); | |
3141 RUNTIME_ASSERT(num >= 0); | |
3142 | |
3143 func->shared()->set_expected_nof_properties(num); | |
3144 if (func->has_initial_map()) { | |
3145 Handle<Map> new_initial_map = Map::Copy(handle(func->initial_map())); | |
3146 new_initial_map->set_unused_property_fields(num); | |
3147 func->set_initial_map(*new_initial_map); | |
3148 } | |
3149 return isolate->heap()->undefined_value(); | |
3150 } | |
3151 | |
3152 | |
3153 RUNTIME_FUNCTION(RuntimeHidden_CreateJSGeneratorObject) { | 3136 RUNTIME_FUNCTION(RuntimeHidden_CreateJSGeneratorObject) { |
3154 HandleScope scope(isolate); | 3137 HandleScope scope(isolate); |
3155 ASSERT(args.length() == 0); | 3138 ASSERT(args.length() == 0); |
3156 | 3139 |
3157 JavaScriptFrameIterator it(isolate); | 3140 JavaScriptFrameIterator it(isolate); |
3158 JavaScriptFrame* frame = it.frame(); | 3141 JavaScriptFrame* frame = it.frame(); |
3159 Handle<JSFunction> function(frame->function()); | 3142 Handle<JSFunction> function(frame->function()); |
3160 RUNTIME_ASSERT(function->shared()->is_generator()); | 3143 RUNTIME_ASSERT(function->shared()->is_generator()); |
3161 | 3144 |
3162 Handle<JSGeneratorObject> generator; | 3145 Handle<JSGeneratorObject> generator; |
(...skipping 12050 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15213 } | 15196 } |
15214 return NULL; | 15197 return NULL; |
15215 } | 15198 } |
15216 | 15199 |
15217 | 15200 |
15218 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { | 15201 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { |
15219 return &(kIntrinsicFunctions[static_cast<int>(id)]); | 15202 return &(kIntrinsicFunctions[static_cast<int>(id)]); |
15220 } | 15203 } |
15221 | 15204 |
15222 } } // namespace v8::internal | 15205 } } // namespace v8::internal |
OLD | NEW |