OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 "src/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/arguments.h" | 8 #include "src/arguments.h" |
9 #include "src/compiler.h" | 9 #include "src/compiler.h" |
10 #include "src/frames-inl.h" | 10 #include "src/frames-inl.h" |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 // Mark both, the source and the target, as un-flushable because the | 159 // Mark both, the source and the target, as un-flushable because the |
160 // shared unoptimized code makes them impossible to enqueue in a list. | 160 // shared unoptimized code makes them impossible to enqueue in a list. |
161 DCHECK(target_shared->code()->gc_metadata() == NULL); | 161 DCHECK(target_shared->code()->gc_metadata() == NULL); |
162 DCHECK(source_shared->code()->gc_metadata() == NULL); | 162 DCHECK(source_shared->code()->gc_metadata() == NULL); |
163 target_shared->set_dont_flush(true); | 163 target_shared->set_dont_flush(true); |
164 source_shared->set_dont_flush(true); | 164 source_shared->set_dont_flush(true); |
165 | 165 |
166 // Set the code, scope info, formal parameter count, and the length | 166 // Set the code, scope info, formal parameter count, and the length |
167 // of the target shared function info. | 167 // of the target shared function info. |
168 target_shared->ReplaceCode(source_shared->code()); | 168 target_shared->ReplaceCode(source_shared->code()); |
| 169 if (source_shared->HasBytecodeArray()) { |
| 170 target_shared->set_function_data(source_shared->bytecode_array()); |
| 171 } |
169 target_shared->set_scope_info(source_shared->scope_info()); | 172 target_shared->set_scope_info(source_shared->scope_info()); |
170 target_shared->set_length(source_shared->length()); | 173 target_shared->set_length(source_shared->length()); |
171 target_shared->set_feedback_vector(source_shared->feedback_vector()); | 174 target_shared->set_feedback_vector(source_shared->feedback_vector()); |
172 target_shared->set_internal_formal_parameter_count( | 175 target_shared->set_internal_formal_parameter_count( |
173 source_shared->internal_formal_parameter_count()); | 176 source_shared->internal_formal_parameter_count()); |
174 target_shared->set_start_position_and_type( | 177 target_shared->set_start_position_and_type( |
175 source_shared->start_position_and_type()); | 178 source_shared->start_position_and_type()); |
176 target_shared->set_end_position(source_shared->end_position()); | 179 target_shared->set_end_position(source_shared->end_position()); |
177 bool was_native = target_shared->native(); | 180 bool was_native = target_shared->native(); |
178 target_shared->set_compiler_hints(source_shared->compiler_hints()); | 181 target_shared->set_compiler_hints(source_shared->compiler_hints()); |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 DCHECK_EQ(1, args.length()); | 355 DCHECK_EQ(1, args.length()); |
353 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, function, 0); | 356 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, function, 0); |
354 return function->IsJSBoundFunction() | 357 return function->IsJSBoundFunction() |
355 ? *JSBoundFunction::ToString( | 358 ? *JSBoundFunction::ToString( |
356 Handle<JSBoundFunction>::cast(function)) | 359 Handle<JSBoundFunction>::cast(function)) |
357 : *JSFunction::ToString(Handle<JSFunction>::cast(function)); | 360 : *JSFunction::ToString(Handle<JSFunction>::cast(function)); |
358 } | 361 } |
359 | 362 |
360 } // namespace internal | 363 } // namespace internal |
361 } // namespace v8 | 364 } // namespace v8 |
OLD | NEW |